Skip to content

Instantly share code, notes, and snippets.

@jukbot
Last active April 10, 2017 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jukbot/f2bb037c985a7e2c0778c6291cd9b799 to your computer and use it in GitHub Desktop.
Save jukbot/f2bb037c985a7e2c0778c6291cd9b799 to your computer and use it in GitHub Desktop.
KMUTNB LECTURER EVALUATE SCRIPT (2017)
How to use this Evaluate script
=======================================================================
1. visit https://grade.icit.kmutnb.ac.th/en/courselist.aspx?
2. select registered courses then enter the evaluation page.
3. right click at any radio button of the form !! then Inspect > Console
4. choose the script below only 1 script per enter, copy and paste it in command box.
5. enter and done!!
(Note: type "allow parsing" for first use in Firefox browser)
======================================================================
// SCRIPT 1 : He's pretty good teacher (RANDOM 4-5)
const myNodeList = document.querySelectorAll('input[type=radio]');
const nodeArr = Array.from(myNodeList);
const arrays = [], size = 5;
while (nodeArr.length > 0) {
arrays.push(nodeArr.splice(0, size));
}
for(let i in arrays) {
let x = (Math.floor(Math.random() * arrays.length-1) + 1)%2; // level 0-4
arrays[i][x].checked = true;
}
console.log("You have been selected " + arrays.length + " questions.");
// SCRIPT 2 : He's teaching well, almost perfect. (RANDOM 3-5)
const myNodeList = document.querySelectorAll('input[type=radio]');
const nodeArr = Array.from(myNodeList);
const arrays = [], size = 5;
while (nodeArr.length > 0) {
arrays.push(nodeArr.splice(0, size));
}
for(let i in arrays) {
let x = (Math.floor(Math.random() * arrays.length-1) + 1)%3; // level 0-4
arrays[i][x].checked = true;
}
console.log("You have been selected " + arrays.length + " questions.");
// SCRIPT 3 : Ahh, he need some improve. (RANDOM 2-5)
const myNodeList = document.querySelectorAll('input[type=radio]');
const nodeArr = Array.from(myNodeList);
const arrays = [], size = 5;
while (nodeArr.length > 0) {
arrays.push(nodeArr.splice(0, size));
}
for(let i in arrays) {
let x = (Math.floor(Math.random() * 4) + 0); // level 0-4
arrays[i][x].checked = true;
}
console.log("You have been selected " + arrays.length + " questions.");
// SCRIPT 4 : For bad ass (RANDOM 1-3)
const myNodeList = document.querySelectorAll('input[type=radio]');
const nodeArr = Array.from(myNodeList);
const arrays = [], size = 5;
while (nodeArr.length > 0) {
arrays.push(nodeArr.splice(0, size));
}
for(let i in arrays) {
let x = (Math.floor(Math.random() * 3) + 2); // level 0-4
arrays[i][x].checked = true;
}
console.log("You have been selected " + arrays.length + " questions.");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment