// ==UserScript== // @name 问卷星脚本(有题库版) // @version 0.1.3 // @description try to take over the world! // @author Ye_Tianshun(fusluv修改) // @match *://*.wjx.top/* // @match *://*.wjx.cn/* // @grant none // @namespace https://greasyfork.org/users/669052 // @downloadURL none // ==/UserScript== /************************************* * 在控制台输入wjx.help()获取帮助 * 单选多选判断测试 * https://ks.wjx.top/jq/85957028.aspx *************************************/ (function() { function R(a) { ona = "on" + a; if (window.addEventListener) window.addEventListener(a, function(e) { for (var n = e.originalTarget; n; n = n.parentNode) n[ona] = null; }, true); window[ona] = null; document[ona] = null; if (document.body) document.body[ona] = null; } R("contextmenu"); R("click"); R("mousedown"); R("mouseup"); R("selectstart"); window.validate = function() { return true; } window.wjx = { help: function() { console.log("问卷星脚本 \n帮助:\n请自行修改题库(支持单选多选判断)\n" + "wjx.clearCookie(): 清除cookie数据\n" + "wjx.getAnswer():自动填写答案\n"); }, clearCookie: function() { var keys = document.cookie.match(/[^ =;]+(?==)/g); if (keys) { for (var i = keys.length; i--;) { document.cookie = keys[i] + '=0;path=/;expires=' + new Date(0).toUTCString(); document.cookie = keys[i] + '=0;path=/;domain=' + document.domain + ';expires=' + new Date(0).toUTCString(); document.cookie = keys[i] + '=0;path=/;domain=ratingdog.cn;expires=' + new Date(0).toUTCString(); } } console.log("cookie数据已清除"); location.reload(); }, writeAnswer: function(ansarr) { var questions, curQuestion, a; questions = document.getElementsByClassName("div_question"); curQuestion = 0; for (var i = 0; i < questions.length; i++) { a = questions.item(i).getElementsByTagName("li"); if (a.length >= 0 ) { var x; for(var m = 0;m