Last active
September 24, 2020 12:37
-
-
Save aliahmadcse/f86ac6b0e64c154d07e32b0837bd4924 to your computer and use it in GitHub Desktop.
UETIANS, We all know, how frustrating is it to fill course survey for each subject and marking those dumb radio buttons. So I have written this short script π to automate this process. On your survey question air page, open developer tools (ctrl+shift+I) and then JS console and copy paste this script into console and hit enter. And that's it, alβ¦
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// for random selection of radio buttons | |
const radioContainers = document.querySelectorAll(".js_radio"); | |
radioContainers.forEach((container) => { | |
const radioInputs = container.querySelectorAll("input"); | |
const index = Math.round(Math.random() * 4); | |
radioInputs[index].checked = true; | |
}); | |
window.scrollTo(0, document.body.scrollHeight); |
Author
aliahmadcse
commented
Sep 23, 2020
•
//for all 4 star ratings
const radioContainers = document.querySelectorAll(".js_radio");
radioContainers.forEach((container) => {
const radioInputs = container.querySelectorAll("input");
radioInputs[1].checked = true;
});
window.scrollTo(0, document.body.scrollHeight);
//for all 3 star ratings
const radioContainers = document.querySelectorAll(".js_radio");
radioContainers.forEach((container) => {
const radioInputs = container.querySelectorAll("input");
radioInputs[2].checked = true;
});
window.scrollTo(0, document.body.scrollHeight);
//for all 2 star ratings
const radioContainers = document.querySelectorAll(".js_radio");
radioContainers.forEach((container) => {
const radioInputs = container.querySelectorAll("input");
radioInputs[3].checked = true;
});
window.scrollTo(0, document.body.scrollHeight);
//for all 1-star ratings, if you are this much desperate
const radioContainers = document.querySelectorAll(".js_radio");
radioContainers.forEach((container) => {
const radioInputs = container.querySelectorAll("input");
radioInputs[4].checked = true;
});
window.scrollTo(0, document.body.scrollHeight);
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment