// ==UserScript== // @name (2023最新)问卷网破解答案自动填写并显示 // @namespace http://tampermonkey.net/ // @version 1.1 // @description 破解问卷网考试答案,目前支持单选,多选,填空,有其它问题或者题型请进群反馈QQ交流群:1027881795 // @author 阿龙 // @include https://www.wenjuan.ltd/* // @include https://www.wenjuan.com/* // @icon https://preview.qiantucdn.com/agency/dp/dp_thumbs/5266903/143966767/staff_1024.jpg!kuan320_webp // @grant none // @require https://cdn.jsdelivr.net/npm/jquery@2.2.3/dist/jquery.min.js // @license MIT // @downloadURL https://update.greasyfork.icu/scripts/456714/%EF%BC%882023%E6%9C%80%E6%96%B0%EF%BC%89%E9%97%AE%E5%8D%B7%E7%BD%91%E7%A0%B4%E8%A7%A3%E7%AD%94%E6%A1%88%E8%87%AA%E5%8A%A8%E5%A1%AB%E5%86%99%E5%B9%B6%E6%98%BE%E7%A4%BA.user.js // @updateURL https://update.greasyfork.icu/scripts/456714/%EF%BC%882023%E6%9C%80%E6%96%B0%EF%BC%89%E9%97%AE%E5%8D%B7%E7%BD%91%E7%A0%B4%E8%A7%A3%E7%AD%94%E6%A1%88%E8%87%AA%E5%8A%A8%E5%A1%AB%E5%86%99%E5%B9%B6%E6%98%BE%E7%A4%BA.meta.js // ==/UserScript== var information = 0; var anslist = []; var no_answer = ""; let question_lists var Id var optionGroupList var questionpageIdListname var question var question_type var optionGroupListProcessed var optionList var alltheAnswers=[] var topicAnswer var totalnumber=0 function Radiojudgmentoptions(question) { var options=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","","","",""] for (var cc = 0; cc< question.length; cc++) { if(question[cc]==1){ return options[cc];} } } //多选判断选项 function JudgingMultiplechoice(question) { var options=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","","","",""] var collection=[] for (var cc = 0; cc< question.length; cc++) { if(question[cc]==1){ collection.push(options[cc]);} } return collection } (function () { let questionpageIdList=this.__INITIAL_STATE__.QUESTIONPAGE_DICT let questionpage=this.__INITIAL_STATE__.questionpageIdList for (var x = 0; x < questionpage.length; x++) { Id=questionpage[x] questionpageIdListname=questionpageIdList[Id] totalnumber+=questionpageIdListname.question_list.length for (var i = 0; i < questionpageIdListname.question_list.length; i++) { var num=questionpageIdListname.question_list.length var theTitle=totalnumber-num+i+1 question=questionpageIdListname.question_list[i] question_type=question.question_type optionList=[] if(question_type==2){ optionGroupListProcessed=question.optionGroupListProcessed[0] for (var c = 0; c < optionGroupListProcessed.option_list.length; c++) { var option=optionGroupListProcessed.option_list[c].custom_attr.is_correct if(option==1){ optionList.push(option) answerParse(theTitle,c)//自动选择代码 } else{ optionList.push(0) } } topicAnswer=Radiojudgmentoptions(optionList) alltheAnswers.push(topicAnswer) } if(question_type==6){ for (var p = 0; p { draggable = true; initX = e.clientX; initY = e.clientY; }, false); document.addEventListener("mousemove", e => { if (draggable === true) { var nowX = e.clientX, nowY = e.clientY, disX = nowX - initX, disY = nowY - initY; container.style.left = containerLeft + disX + "px"; container.style.top = containerRight + disY + "px"; } }); handle.addEventListener("mouseup", () => { draggable = false; containerLeft = get_css(container, "left"); containerRight = get_css(container, "top"); }, false); } (function () { make_draggable(document.querySelector("#area"), document.querySelector("#area")); var li = document.createElement("li"); $(li).attr("id", `annotationAnswer`); li.innerHTML ="QQ交流群:1027881795
注:请自行删去的自动填写的填空题中的多余的空格
答案仅供参考" menu.appendChild(li) for (var p = 0; p< alltheAnswers.length; p++) { li = document.createElement("li"); $(li).attr("id", `answer${p}`); li.innerHTML ="第"+(p+1)+"题"+alltheAnswers[p] menu.appendChild(li);} })(); //单选多选选择 function answerParse(i,question) { var lists=document.querySelectorAll('.question-box') lists[i-1].querySelectorAll("span input")[question].click() } //填空 function textareaValue(number,newText){ try{ var lists=document.querySelectorAll('.question-box') var inputDom=lists[number-1].querySelector('textarea') inputDom.value = newText inputDom.dispatchEvent(new Event('input')) inputDom.dispatchEvent(new Event('click')) inputDom.dispatchEvent(new Event('focus')) inputDom.dispatchEvent(new Event('blur')) } catch(err){ //console.log(err) } }