Last active
August 22, 2019 14:22
-
-
Save sdushantha/5c8a559ee97f308db02c20215097ab4b to your computer and use it in GitHub Desktop.
Solve multiple choice questions on ThinkIB.net
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
// Author: Siddharth Dushantha | |
// | |
// Solve multiple choice questions on ThinkIB.net | |
// | |
// Disclaimer: This script has only been tested out on Physics questions | |
// but it should work on other subjects as well. | |
// | |
// How to use this script: | |
// Open up inspect element, then go to the Console tab | |
// Paste the code code below into the console | |
try{ | |
var N=0 | |
while (true){ | |
// All the correct answers have the class name "right". So get all those | |
// classes, and then click on the Nth button with the class name "right". | |
document.getElementsByClassName("right")[N].click(); | |
// Same thing as above, but clicking on the "Show" button | |
document.getElementsByClassName("btn quiz-show")[N].click(); | |
// Go to the next N | |
N++; | |
} | |
} | |
catch(err) { | |
// In case there is an error, show the error message | |
console.log(err.message); | |
} | |
// When completed, let the user know :) | |
alert("All answers have been completed") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment