Auto-Answer Script

try to take over the world!

  1. // ==UserScript==
  2. // @name Auto-Answer Script
  3. // @namespace http://nead.pro.br/
  4. // @version 0.1
  5. // @description try to take over the world!
  6. // @author irineu, voce nao sabe nem eu
  7. // @match *://nead.pro.br/*
  8. // @grant none
  9. // ==/UserScript==
  10. var correct = `<div class="correctness incorrect">Errado</div>`;
  11. //document.body.style.backgroundImage = "url('http://eskipaper.com/images/blue-background-2.jpg')";
  12.  
  13.  
  14. function clickelementbyname(elementname){
  15. document.getElementsByName(elementname)[0].click();
  16. }
  17. /*
  18. function clickelementbyclassname(elementclassname){
  19. document.getElementsByClassName(elementclassname)[0].click();
  20. }
  21. */
  22.  
  23. if(window.location.href.indexOf("nead.pro.br/mod/quiz/attempt.php?") > -1){
  24. console.log("Questionary page detected.");
  25. //var id = document.getElementsByName('questionids')[0].value;
  26. var s1 = document.getElementsByClassName('submit btn')[0].getAttribute('onclick').split(`'`)[1];
  27. var id = s1.split('q')[1];
  28. var questionID = document.getElementsByName('questionids')[0].value;
  29. var questioncode = document.getElementById(`q${id}`).innerHTML;
  30. var correctness = document.getElementsByClassName("correctness correct")[0];
  31. console.log("Checking question grading.");
  32. if(correctness !== undefined){
  33. console.log("Question is right, saving data.");
  34. localStorage.setItem('que'+ id, questioncode);
  35. if(document.getElementsByClassName("next")[0] !== undefined){
  36. console.log("Going to next page.");
  37. document.getElementsByClassName("next")[0].click();
  38. }
  39. if(document.getElementsByClassName("next")[0] === undefined){
  40. console.log("Questionary is finished.");
  41. alert("Questionary is finished.");
  42. }
  43. }
  44. if(correctness === undefined){
  45. console.log("Question isn't right, looking for question data");
  46. if(localStorage.getItem('que' + id) === null){
  47. alert("No data found, you must answer this question");
  48. console.log("No data found, human must answer");
  49. }
  50. if(localStorage.getItem('que' + id) !== null){
  51. document.getElementById(`q${id}`).innerHTML = localStorage.getItem('que' + id);
  52. setTimeout(clickelementbyname, 250, 'resp' + id + '_submit');
  53. console.log("Data found, changing page.");
  54. }
  55. }
  56. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址