某高校问卷网防诈骗自动填写正确答案
测试链接:https://www.wenjuan.group/s/iQFzQz6/```
var questionpageIdListname;
var question;
var question_type;
var optionGroupListProcessed;
// 单选多选选择
function answerParse(i, question) {
var lists = document.querySelectorAll('.question-box');
lists.querySelectorAll("span input").click();
}
// 填空
function textareaValue(number, newText) {
try {
var lists = document.querySelectorAll('.question-box');
var inputDom = lists.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);
}
}
let student = {"name":"小k","xuehao":"128","classname":"2023班"}; // 前三题自定义
window.scrollTo(0, document.body.scrollHeight);
questionpageIdListname = Object.values(window.globalData.project.pageList);
// 处理问题
for (var i = 0; i < questionpageIdListname.question_list.length; i++) {
var theTitle = i + 1;
question = questionpageIdListname.question_list;
question_type = question.question_type;
if (question_type == 6) {
if (i == 0) {
textareaValue(theTitle, student.name);
}
if (i == 1) {
textareaValue(theTitle, student.xuehao);
}
if (i == 2) {
textareaValue(theTitle, student.classname);
}
}
if (.includes(question_type)) {
optionGroupListProcessed = question.optionGroupListProcessed;
for (var d = 0; d < optionGroupListProcessed.option_list.length; d++) {
var duooption = optionGroupListProcessed.option_list.custom_attr.is_correct;
if (duooption == 1) {
answerParse(theTitle, d);
}
}
}
}``` 好用,这个方法能适用其他的答题系统吗? yt1010306 发表于 2024-10-30 10:29
好用,这个方法能适用其他的答题系统吗?
比如网络考试自动答题? willallen 发表于 2024-10-30 11:02
比如网络考试自动答题?
对头啊。能匹配个AI自动搜题就好了。
页:
[1]