Quizizz | - | - | Assistant

Learns from your mistakes, does the quiz for you after (NO LONGER WORKING, WILL NOT BE FIXED).

  1. // ==UserScript==
  2. // @name Quizizz | - | - | Assistant
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.01
  5. // @description Learns from your mistakes, does the quiz for you after (NO LONGER WORKING, WILL NOT BE FIXED).
  6. // @author GSRHackZ
  7. // @match https://quizizz.com/join/*
  8. // @icon https://cf.quizizz.com/img/favicon/apple-touch-icon.png
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. let answers = [],miner=true;
  13. if(localStorage.getItem("answers")!==null){answers=JSON.parse(localStorage.getItem("answers"))};
  14. setInterval(()=>{
  15. if(document.getElementsByClassName("primary-action-btn")[0]!==undefined){
  16. document.getElementsByClassName("primary-action-btn")[0].click();
  17. }
  18. if(document.getElementsByClassName("primary-button")[0]!==undefined){
  19. document.getElementsByClassName("primary-button")[0].click();
  20. }
  21. if(document.getElementsByClassName("resizeable question-text-color")[0]!==undefined){
  22. let quest = document.getElementsByClassName("resizeable question-text-color")[0].innerText;
  23. if(document.getElementsByClassName("options-grid")[0]!==undefined){
  24. let choices = document.getElementsByClassName("options-grid")[0].children;
  25. let uid=false;
  26. if(document.getElementsByClassName("question-media")[0]!==undefined){
  27. if(document.getElementsByClassName("question-media")[0].children[0].classList.contains("question-image")){
  28. uid = document.getElementsByClassName("question-media")[0].children[0].src.split("?")[0];
  29. }
  30. }
  31. if(!answer(quest,choices,uid)){
  32. for(let i=0;i<choices.length;i++){
  33. choices[i].children[0].children[0].addEventListener("click",()=>{
  34. setTimeout(()=>{
  35. if(getCorr(choices)!==false){
  36. let save = {"quest":quest,"answr":getCorr(choices),"uid":uid}
  37. if(!isKnown(save)){
  38. answers.push(save);
  39. localStorage.setItem("answers",JSON.stringify(answers));
  40. }
  41. if(document.getElementsByClassName("right-navigator")[0]!==undefined){
  42. document.getElementsByClassName("right-navigator")[0].click();
  43. }
  44. }
  45. },250)
  46. })
  47. }
  48. }
  49. if(miner){
  50. setInterval(()=>{
  51. choices[Math.floor(Math.random()*choices.length)].children[0].children[0].click();
  52. },250)
  53. }
  54. }
  55. }
  56. else{
  57. if(document.getElementsByClassName("right-navigator")[0]!==undefined){
  58. document.getElementsByClassName("right-navigator")[0].click();
  59. }
  60. if(document.getElementsByClassName("selectors-container")[0]!==undefined){
  61. let redemQuests = document.getElementsByClassName("selectors-container")[0].children;
  62. redemQuests[Math.floor(Math.random()*redemQuests.length)].click();
  63. }
  64. }
  65. },500)
  66. function isKnown(obj){
  67. for(let i=0;i<answers.length;i++){
  68. if(answers[i].quest==obj.quest&&answers[i].answr==obj.answr&&answers[i].uid==obj.uid){
  69. return true;
  70. }
  71. }
  72. return false;
  73. }
  74. function answer(quest,choices,uid){
  75. for(let i=0;i<choices.length;i++){
  76. if(isKnown({"quest":quest,"answr":choices[i].children[0].children[0].innerText,"uid":uid})){
  77. choices[i].children[0].children[0].click();
  78. return true;
  79. }
  80. }
  81. return false;
  82. }
  83. function getCorr(arr){
  84. let correct = false;
  85. for(let i=0;i<arr.length;i++){
  86. if(arr[i].classList.contains("is-correct")){
  87. correct = arr[i].children[0].children[0].innerText;
  88. }
  89. }
  90. return correct;
  91. }