问卷星改分

更改问卷星答题的最后得分

  1. // ==UserScript==
  2. // @name 问卷星改分
  3. // @version 0.1
  4. // @description 更改问卷星答题的最后得分
  5. // @author 喝杯82年代Java压压惊
  6. // @match *://ks.wjx.top/wjx/join/completemobile2.aspx*
  7. // @require http://code.jquery.com/jquery-1.11.1.min.js
  8. // @grant none
  9. // @namespace https://gf.qytechs.cn/users/207098
  10. // ==/UserScript==
  11.  
  12. var name = "N/A";
  13. var correctAnwser = 0;
  14. var totalQuestion = 0;
  15. var score = 0;
  16. var maxScore = 0;
  17.  
  18. (function() {
  19. 'use strict';
  20. $(document).ready(function() {
  21. // Load information from current page.
  22. var score_form_dom = $("div.score-form__list.clearfix");
  23. if(score_form_dom.length != 1 && score_form_dom.children().length != 3)
  24. {
  25. alert("问卷星改分脚本提示:无效页面");
  26. return;
  27. }
  28. name = $(score_form_dom.children()[0]).find("strong").text();
  29. score = $(score_form_dom.children()[1]).find("strong").text();
  30. maxScore = $(score_form_dom.children()[1]).find("em").text().replace("/", "");
  31. correctAnwser = $(score_form_dom.children()[2]).find("strong").text();
  32. totalQuestion = $(score_form_dom.children()[2]).find("em").text().replace("/", "");
  33. var topDiv = $("div#divTopHeight");
  34. topDiv.append("<button id=\"wjxcc_automaxScore\">一键满分</button>");
  35. $("button#wjxcc_automaxScore").click(function() {
  36. if(wjxChangeScore(totalQuestion, totalQuestion, maxScore, maxScore))
  37. {
  38. alert("问卷星改分脚本提示:已改成满分");
  39. }
  40. else
  41. {
  42. alert("问卷星改分脚本提示:改分失败");
  43. }
  44. });
  45. });
  46. }) ();
  47.  
  48. function wjxChangeScore(pCorrectAnwser, pTotalQuestion, pScore, pMaxScore) {
  49. var score_form_dom = $("div.score-form__list.clearfix");
  50. if(score_form_dom.length != 1 && score_form_dom.children().length != 3)
  51. {
  52. return false;
  53. }
  54. $(score_form_dom.children()[1]).find("strong").text(pScore);
  55. $(score_form_dom.children()[1]).find("em").text("/" + pMaxScore);
  56. $(score_form_dom.children()[2]).find("strong").text(pCorrectAnwser);
  57. $(score_form_dom.children()[2]).find("em").text("/" + pTotalQuestion);
  58. return true;
  59. }

QingJ © 2025

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