Quizlet Match Hacker

The time will freeze and the answers will be the same color

  1. // ==UserScript==
  2. // @name Quizlet Match Hacker
  3. // @namespace Ray D. Adams
  4. // @version 1.1
  5. // @description The time will freeze and the answers will be the same color
  6. // @author You
  7. // @match https://quizlet.com/*/*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11. //Ignore the variable gravityScore because it doesn't work any more, but I decided to keep the code here
  12. var gravityScore,
  13. href = window.location.href;
  14. //<br><br><button class="UIButton" id="customWaitButton" type="button"><span class="UIButton-wrapper"><span>Inject</span></span></button>
  15. (function() {
  16. initLoad();
  17. function initLoad() {
  18. if (href.includes("quizlet.com")) {
  19. if (href.includes("/learn")) {
  20. cAlert('<h2>Game Mode: Learn</h2>Thank you for using Ray D. Adams Quizlet Exploit<br>Without you, this exploit wouldnt be possible.<br><h4>Instructions:</h4>Just wait for this script to finish!<br><br><button class="UIButton" id="learnButton" type="button"><span class="UIButton-wrapper"><span>Inject</span></span></button>');
  21. getId("learnButton").addEventListener("click", function() {
  22. document.getElementById("customMessageContainer").remove();
  23. learn();
  24. });
  25. } else if (href.includes("/flashcards")) {
  26. cAlert('<h2>Game Mode: Flashcards</h2>Thank you for using Ray D. Adams Quizlet Exploit<br>Without you, this exploit wouldnt be possible.<br><h4>Changelog:</h4>+ Added Match time freeze for regular match and diagrams<br>+ Added Gravity score exploit to get ANY score you want!<br>+ Added custom alert box<br>+ Fixed graphics<br>- Removed useless alert boxes.<h4>Instructions:</h4>Umm why are you here? Go cheat somewhere else...<br><br><button class="UIButton" id="flashcardsButton" type="button"><span class="UIButton-wrapper"><span>Inject</span></span></button>');
  27. getId("flashcardsButton").addEventListener("click", function() {
  28. document.getElementById("customMessageContainer").remove();
  29. });
  30. } else if (href.includes("/write")) {
  31. cAlert('<h2>Game Mode: Write</h2>Thank you for using Ray D. Adams Exploit<br>Without you, this exploit wouldnt be possible.<br><h4>Instructions:</h4>You dont even have to wait,<br> this is my favorite one to watch!<br><br><button class="UIButton" id="writeButton" type="button"><span class="UIButton-wrapper"><span>Inject</span></span></button>');
  32. getId("writeButton").addEventListener("click", function() {
  33. document.getElementById("customMessageContainer").remove();
  34. write();
  35. });
  36. } else if (href.includes("/spell")) {
  37. cAlert('<h2>Game Mode: Spell</h2>Thank you for using Ray D. Adams Quizlet Exploit<br>Without you, this exploit wouldnt be possible.<br><h4>Instructions:</h4>Hold down enter and wait.<br><br><button class="UIButton" id="spellButton" type="button"><span class="UIButton-wrapper"><span>Inject</span></span></button>');
  38. getId("spellButton").addEventListener("click", function() {
  39. document.getElementById("customMessageContainer").remove();
  40. spell();
  41. });
  42. } else if (href.includes("/test")) {
  43. cAlert('<h2>Game Mode: Test</h2>Thank you for using Ray D. Adams Quizlet Exploit<br>Without you, this exploit wouldnt be possible.<br><br><h4>Instructions:</h4>Right click to toggle answers.<br>(Be subtle when using)<br><br><button class="UIButton" id="testButton" type="button"><span class="UIButton-wrapper"><span>Inject</span></span></button>');
  44. getId("testButton").addEventListener("click", function() {
  45. document.getElementById("customMessageContainer").remove();
  46. testMode();
  47. });
  48. } else if (href.includes("/micromatch")) {
  49. cAlert('<h2>Game Mode: Micromatch</h2>Thank you for using Ray D. Adams Quizlet Exploit<br>Without you, this exploit wouldnt be possible.<br><h4>Instructions:</h4>The timer will be paused when at choosen time.<br>The answers will also be highlighted for you.<br>At your leisure, solve the questions.<br><h4>Match Time: </h4><input type="text" id="matchTimeInput" value="0"></input><br><br><button class="UIButton" id="micromatchButton" type="button"><span class="UIButton-wrapper"><span>Inject</span></span></button>');
  50. getId("micromatchButton").addEventListener("click", function() {
  51. document.getElementById("customMessageContainer").remove();
  52. micromatch();
  53. });
  54. } else if (href.includes("/match")) {
  55. cAlert('<h2>Game Mode: Match</h2>Thank you for using Ray D. Adams Quizlet Exploit<br>Without you, this exploit wouldnt be possible.<br><h4>Instructions:</h4>The timer will be paused when at choosen time.<br>The answers will also be highlighted for you.<br>At your leisure, solve the questions.<br><h4>Match Time: </h4><input type="text" id="matchTimeInput" value="0"></input><br><br><button class="UIButton" id="matchButton" type="button"><span class="UIButton-wrapper"><span>Inject</span></span></button>');
  56. getId("matchButton").addEventListener("click", function() {
  57. document.getElementById("customMessageContainer").remove();
  58. match();
  59. });
  60. } else if (href.includes("/gravity")) {
  61. try {
  62. document.getElementsByClassName("UIModal is-white is-open")[0].style.display = "none"
  63. } catch (e) {}
  64. cAlert('<h2>Game Mode: Gravity</h2>Thank you for using Ray D. Adams Quizlet Exploit<br>Without you, this exploit wouldnt be possible.<br> <h4>What score would you like?: <input type="number" id="gravityScoreInput" value="4294967295" onchange="gravityScore = parseInt(this.value);"></input></h4><br><br><button class="UIButton" id="gravityButton" type="button"><span class="UIButton-wrapper"><span>Inject</span></span></button>');
  65. getId("gravityButton").addEventListener("click", function() {
  66. document.getElementById("customMessageContainer").remove();
  67. gravity();
  68. });
  69. } else {
  70. }
  71. }
  72. function testMode() {
  73. var question = getClass("TermText notranslate lang-en");
  74. for (var i = 0; i < question.length; i++) {
  75. question[i].innerHTML += '<br><small style="font-weight: bold; display: block;" class="answers">' + findAnswerGlobal(question[i].innerHTML) + "</small>";
  76. }
  77. window.oncontextmenu = function(e) {
  78. e.preventDefault();
  79. var answer = getClass("answers");
  80. if (answer[0].style.display == "block") {
  81. for (var i = 0; i < answer.length; i++) {
  82. answer[i].style.display = "none";
  83. }
  84. } else {
  85. for (var i = 0; i < answer.length; i++) {
  86. answer[i].style.display = "block"
  87. }
  88. }
  89. }
  90. }
  91. function gravity() {
  92. if (gravityScore === undefined) {
  93. gravityScore = parseInt(prompt("Enter exact score:"));
  94. }
  95. var t = window.QJP([], [], ["hyek"]).a,
  96. n = t.grader.grade.bind(t.grader);
  97. t._startGame(), t.dataMap = t.dataMap.update("points", function(t) {
  98. return gravityScore;
  99. });
  100. for (var o = 0; o < 99; o++) t._advanceLevel();
  101. function s(e) {
  102. t.grader.grade = function(e, t, n) {
  103. return !0;
  104. }, e(), t.grader.grade = n
  105. }
  106. s(function() {
  107. console.log(null);
  108. });
  109. var a = t._promptCopyAnswer.bind(t);
  110. t._promptCopyAnswer = function(e) {
  111. a(e), setTimeout(function() {
  112. s(function() {
  113. t._checkCopiedAnswer({
  114. liveTermId: e,
  115. answer: ""
  116. });
  117. });
  118. }, 0);
  119. };
  120. }
  121. function write() {
  122. //This is sad... but works better...
  123. var remaining = parseInt(document.getElementsByClassName("LearnModeProgressBar-value")[0].innerHTML);
  124. for (var i = 0; i < remaining; i++) {
  125. getId("user-answer").value = Math.random();
  126. getId("js-learnModeAnswerButton").click();
  127. getClass("js-learnModeOverrideIncorrect")[0].click();
  128. }
  129. /*
  130. var buttons = document.querySelectorAll("button"),
  131. span = document.querySelectorAll("span");
  132. if (getId("user-answer")) {
  133. getId("user-answer").disabled = true;
  134. getId("user-answer").value = findAnswerGlobal(getClass("qDef lang-en TermText")[0].innerHTML);
  135. for (var i = 0; i < buttons.length; i++) {
  136. if (buttons[i].childNodes[0].innerHTML == "Answer") {
  137. buttons[i].click();
  138. }
  139. }
  140. try {
  141. for (var i = 0; i < span.length; i++) {
  142. if (span[i].childNodes[0].childNodes[0].innerHTML == "Override: I was right") {
  143. span[i].click;
  144. }
  145. }
  146. } catch (e) {}
  147. write();
  148. } else {
  149. for (var i = 0; i < buttons.length; i++) {
  150. if (buttons[i].innerHTML == "Press any key to continue") {
  151. buttons[i].click();
  152. } else if (buttons[i].innerHTML == "Start Over") {
  153. return 1;
  154. }
  155. }
  156. setTimeout(write, 0);
  157. }
  158. */
  159. }
  160. function spell() {
  161. if (getClass("SpellModeControls-progressValue")[0].innerHTML == "100%") {
  162. return 1;
  163. }
  164. if (getId("js-spellInput") !== null) {
  165. getId("js-spellInput").value = findAnswerGlobal(getClass("qDef lang-en TermText")[0].innerHTML);
  166. setTimeout(spell, 10);
  167. }
  168. }
  169. function match() {
  170. button = getClass("UIButton UIButton--hero")[0], button && button.click();
  171. setTimeout(function() {
  172. var matchLoop = setInterval(function() {
  173. waitForMatch();
  174. }, 0);
  175. function waitForMatch() {
  176. if (getClass("MatchModeQuestionScatterTile") || getClass("MatchModeQuestionGridBoard-tile")) {
  177. for (var F = setTimeout(";"), i = 0; i < F; i++) clearTimeout(i);
  178. var tiles = getClass("MatchModeQuestionScatterTile");
  179. var colors = ["#FF0000", "#FF0000", "#FF6600", "#FF6600", "#FFFF00", "#FFFF00", "#00FF00", "#00FF00", "#00FFFF", "#00FFFF", "#0033FF", "#0033FF", "#FF00FF", "#FF00FF", "#CC00FF", "#CC00FF", "#6E0DD0", "#6E0DD0", "#C0C0C0", "#C0C0C0", "#FFFFFF", "#FFFFFF", "#A52A2A", "#A52A2A", "#F6CFFF", "#F6CFFF", "#CFD9FF", "#CFD9FF", "#FBFFA3", "#FBFFA3", "#FFD1A3", "#FFD1A3", "#710000", "#710000"];
  180. for (var i = 0; i < tiles.length; i++) {
  181. tiles[i].style.backgroundColor = colors[i];
  182. for (var j = 0; j < tiles.length; j++) {
  183. if (tiles[j].childNodes[0].innerHTML == findAnswerGlobal(tiles[j].childNodes[0].innerHTML)) {
  184. tiles[j].style.backgroundColor = colors[i];
  185. }
  186. }
  187. }
  188. clearTimeout(matchLoop);
  189. }
  190. }
  191. }, 500);
  192. }
  193. function micromatch() {
  194. button = getClass("UIButton UIButton--hero")[0], button && button.click();
  195. setTimeout(function() {
  196. setTimeout(function() {
  197. for (var F = setTimeout(";"), o = 0; o < F; o++) clearTimeout(o);
  198. }, 0);
  199. var tiles = getClass("MatchModeQuestionGridTile-text"); //[0].childNodes[0].innerHTML
  200. for (var i = 0; i < tiles.length; i++) {
  201. if (getClass("MatchModeQuestionGridTile")[i].classList[1] != "is-selected") {
  202. click(getClass("MatchModeQuestionGridBoard-tile")[i].childNodes[0], "pointerdown");
  203. }
  204. for (var j = 0; j < tiles.length; j++) {
  205. if (tiles[j].childNodes[0].innerHTML == findAnswerGlobal(tiles[i].childNodes[0].innerHTML)) {
  206. if (getClass("MatchModeQuestionGridTile")[j].classList[1] != "is-selected") {
  207. click(getClass("MatchModeQuestionGridBoard-tile")[j].childNodes[0], "pointerdown");
  208. j = tiles.length;
  209. }
  210. }
  211. }
  212. }
  213. function click(e, t) {
  214. if (e.fireEvent) e.fireEvent("on" + t);
  215. else {
  216. var n = document.createEvent("Events");
  217. n.initEvent(t, !0, !1), e.dispatchEvent(n);
  218. }
  219. }
  220. }, 500);
  221. }
  222. function learn() {
  223. if (getClass("ProgressSegmentedSemicircle-percent")[0].innerHTML = "100%") {
  224. return 1;
  225. }
  226. checkCheckbox();
  227. if (getClass("AssistantMultipleChoiceQuestionPromptView-inner")[0] !== undefined) {
  228. var answer = findAnswerGlobal(getClass("FormattedText notranslate TermText lang-en")[0].innerHTML);
  229. var q1 = getClass("FormattedText notranslate TermText lang-en")[1];
  230. var q2 = getClass("FormattedText notranslate TermText lang-en")[2];
  231. var q3 = getClass("FormattedText notranslate TermText lang-en")[3];
  232. var q4 = getClass("FormattedText notranslate TermText lang-en")[4];
  233. if (answer == q1.innerHTML) {
  234. q1.click();
  235. } else if (answer == q2.innerHTML) {
  236. q2.click();
  237. } else if (answer == q3.innerHTML) {
  238. q3.click();
  239. } else if (answer == q4.innerHTML) {
  240. q4.click();
  241. } else {
  242. console.error("ERROR: Unable to find / click answer");
  243. return 0;
  244. }
  245. getClass("UIButton")[4].click();
  246. setTimeout(learn, 10);
  247. } else {
  248. setTimeout(learn, 100);
  249. }
  250. }
  251. function checkCheckbox() {
  252. document.getElementsByClassName("UIButton UIButton--whiteBorder UIButton--fill")[0].click();
  253. if (document.getElementsByClassName("UICheckbox-input")[3].checked && document.getElementsByClassName("UICheckbox-input")[2].checked !== true && document.getElementsByClassName("UICheckbox-input")[4].checked !== true) {
  254. document.getElementsByClassName("UIButton UIButton--inverted")[0].click();
  255. return 1;
  256. }
  257. if (document.getElementsByClassName("UICheckbox-input")[4].checked === true) {
  258. document.getElementsByClassName("UICheckbox-input")[4].click();
  259. }
  260. if (document.getElementsByClassName("UICheckbox-input")[2].checked === true) {
  261. document.getElementsByClassName("UICheckbox-input")[2].click();
  262. }
  263. if (document.getElementsByClassName("UICheckbox-input")[3].checked === false) {
  264. document.getElementsByClassName("UICheckbox-input")[3].click();
  265. }
  266. document.getElementsByClassName("UIButton UIButton--inverted")[0].click();
  267. }
  268. function findAnswerGlobal(question) {
  269. if (Quizlet.assistantModeData !== undefined) { //Quizlet.assistantModeData.terms
  270. return getAnswer(Quizlet.assistantModeData.terms, question);
  271. } else if (Quizlet.learnGameData !== undefined) { //Quizlet.learnGameData.allTerms
  272. return getAnswer(Quizlet.learnGameData.allTerms, question);
  273. } else if (Quizlet.testModeData !== undefined) { //Quizlet.testModeData.terms
  274. return getAnswer(Quizlet.testModeData.terms, question);
  275. } else if (Quizlet.spellModeData !== undefined) { //Quizlet.spellModeData.spellGameData.termsById
  276. return getAnswer(Quizlet.spellModeData.spellGameData.termsById, question);
  277. } else if (Quizlet.matchModeData !== undefined) { //Quizlet.matchModeData.terms
  278. return getAnswer(Quizlet.matchModeData.terms, question);
  279. } else if (Quizlet.gravityModeData !== undefined) { //Quizlet.gravityModeData.terms
  280. return getAnswer(Quizlet.gravityModeData.terms, question);
  281. } else {
  282. return 0;
  283. }
  284. function getAnswer(s, t) {
  285. var e = s;
  286. if (t.indexOf("_") != "-1") {
  287. if (t.slice(-1) == "_") { //Underscore at end
  288. for (var i=0; i<e.length; i++) {
  289. if (e[i].definition.indexOf(getClass("qDef lang-en TermText")[0].innerHTML.split("_")[0]) != "-1") {
  290. return e[i].word;
  291. } else if (e[i].word.indexOf(getClass("qDef lang-en TermText")[0].innerHTML.split("_")[0]) != "-1") {
  292. return e[i].definition;
  293. }
  294. }
  295. } else if (t[0] == "_") {
  296. for (var i=0; i<e.length; i++) { //Underscore at start
  297. if (e[i].definition.indexOf(getClass("qDef lang-en TermText")[0].innerHTML.split("_").slice(-1)[0]) != "-1") {
  298. return e[i].word;
  299. } else if (e[i].word.indexOf(getClass("qDef lang-en TermText")[0].innerHTML.split("_").slice(-1)[0]) != "-1") {
  300. return e[i].definition;
  301. }
  302. }
  303. } else {
  304. for (var i=0; i<e.length; i++) { //Underscore in middle
  305. if (e[i].definition.indexOf(getClass("qDef lang-en TermText")[0].innerHTML.split("_").slice(-1)[0]) != "-1" && e[i].definition.indexOf(getClass("qDef lang-en TermText")[0].innerHTML.split("_")[0]) != "-1") {
  306. return e[i].word;
  307. } else if (e[i].word.indexOf(getClass("qDef lang-en TermText")[0].innerHTML.split("_").slice(-1)[0]) != "-1" && e[i].word.indexOf(getClass("qDef lang-en TermText")[0].innerHTML.split("_")[0]) != "-1") {
  308. return e[i].definition;
  309. }
  310. }
  311. }
  312. }
  313. var answers = [];
  314. for (var i=0; i<e.length; i++) {
  315. e[i].definition = e[i].definition.replace("\n", "<br>");
  316. e[i].word = e[i].word.replace("\n", "<br>");
  317. if (t == e[i].word) {
  318. answers.push(e[i].definition);
  319. } else if (t == e[i].definition) {
  320. answers.push(e[i].word);
  321. }
  322. }
  323. return answers[Math.floor(Math.random() * answers.length)];
  324. }
  325. }
  326. }
  327. function cAlert(message) {
  328. var html = '<div class="UIModal is-white is-open" id="customMessageContainer" role="document" tabindex="-1"> <div class="UIModal-box"> <div class="UIModalHeader"> <div class="UIModalHeader-wrapper"> <span class="UIModalHeader-close"> <div class="UIModalHeader-closeIconButton"> <span class="UIIconButton"> <button class="UIButton UIButton--inverted" type="button" id="customCloseButton" onclick="document.getElementById(&quot;customMessageContainer&quot;).remove();"> <span class="UIButton-wrapper"> <svg class="UIIcon UIIcon--x-thin"> <noscript></noscript> <use xlink:href="#x-thin"></use> <noscript></noscript> </svg> </span> </button> </span> </div> </span> <div class="UIModalHeader-childrenWrapper"> <h3 class="UIHeading UIHeading--three"><span id="customTitle">Ray D. Adams Quizlet Exploit</span></h3> </div> </div> </div> <div class="UIModalBody"> <div class="UIDiv SetPageEmbedModal-content"> <div> <p class="UIParagraph"><span id="customMessage">'+message+'</span></p></div></div></div></div></div>';
  329. var j = document.createElement('div');
  330. j.innerHTML = html;
  331. document.body.appendChild(j);
  332. }
  333. })();
  334. function getId(id) {
  335. return document.getElementById(id);
  336. }
  337. function getClass(id) {
  338. return document.getElementsByClassName(id);
  339. }
  340. //var learnInsertJs = "function figure(match) {termsWord = window.Quizlet.assistantModeData.terms.filter(function z(x) {return x.word == match}); termsDefinition = window.Quizlet.assistantModeData.terms.filter(function z(x) {return x.definition === match}); if (termsWord.length > 0) {return termsWord[0].definition;}; if (termsDefinition.length > 0) {return termsDefinition[0].word;}}; function solve() {input = document.querySelector('#AssistantModeTarget > div > div > div > div.ModeLayout-content > div > span:nth-child(2) > div > div > div.AssistantScrollableViewLayout-content > div > div.AssistantMultipleChoiceQuestionPromptView-promptArea > div > div > div > span').innerHTML; output = figure(input); outs = document.querySelectorAll('.AssistantMultipleChoiceQuestionPromptView-termOptionInner > div > span'); for (var i = 0; i < outs.length; i++) {if (outs[i].innerText === output) {outs[i].click();}}; document.querySelector('#AssistantModeTarget > div > div > div > div.ModeLayout-content > div > span:nth-child(3) > div > div.AssistantFixedActionLayout-action > div > button').click(); if (document.querySelector('#AssistantModeTarget > div > div > div > div.ModeLayout-controls > div > div > div > div.ModeControls-main > div.ModeControls-progress > div > div > div > svg > text.ProgressSegmentedSemicircle-text.ProgressSegmentedSemicircle-progressText > tspan').innerHTML.slice(0, -1) !== '100') {setTimeout(solve, 10);};}; solve();"
  341. //backupOptionsSet = "/*document.querySelector('#AssistantModeTarget > div > div > div > div.ModeLayout-controls > div > div > div > div.ModeControls-main > div.ModeControls-actions > div > button > span > span').click(); if (document.querySelector('body > div:nth-child(4) > div.UIModal.is-white.is-open > div > div.UIModalBody > div > div:nth-child(3) > div > div > div > div > div > div:nth-child(3) > label > input').checked) {document.querySelector('body > div:nth-child(4) > div.UIModal.is-white.is-open > div > div.UIModalBody > div > div:nth-child(3) > div > div > div > div > div > div:nth-child(3) > label > input').click();}; if (document.querySelector('body > div:nth-child(4) > div.UIModal.is-white.is-open > div > div.UIModalBody > div > div:nth-child(3) > div > div > div > div > div > div:nth-child(1) > label > input').checked) {document.querySelector('body > div:nth-child(4) > div.UIModal.is-white.is-open > div > div.UIModalBody > div > div:nth-child(3) > div > div > div > div > div > div:nth-child(1) > label > input').click();}; document.querySelector('body > div:nth-child(4) > div.UIModal.is-white.is-open > div > div.UIModalHeader > div > span > div > span > button > span').click();*/"
  342. /*
  343. function solveLearn() {
  344. script = document.createElement('script');
  345. script.textContent = learnInsertJs;
  346. (document.head||document.documentElement).appendChild(script);
  347. script.remove();
  348. }
  349. chrome.runtime.onMessage.addListener(
  350. function(request, sender, sendResponse) {
  351. if (request.run == "write") {
  352. iters = parseInt($(".LearnModeProgressBar-value").html())
  353. for (var i = 0; i < iters; i++) {
  354. $("#user-answer")[0].value = "*";
  355. $("#js-learnModeAnswerButton")[0].click();
  356. document.evaluate('//*[@id="js-learnModeInner"]/div[1]/div/div[2]/div/div[2]/span/a', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.click();
  357. }
  358. sendResponse({out: 0});
  359. }
  360. else if (request.run === "learn") {
  361. solveLearn();
  362. sendResponse({out: 0});
  363. }
  364. else {
  365. sendResponse({out: 1});
  366. }
  367. });
  368. */