// ==UserScript==
// @name 普法网(宪法小卫士)课后练习、考试自动答题
// @namespace Ne-21
// @version 1.3.6
// @description 第七届全国学生“学宪法 讲宪法”活动
// @author Ne-21
// @match *://static.qspfw.moe.gov.cn/*
// @icon https://blog.gocos.cn/wp-content/uploads/2021/07/2021-07-2782.ico
// @connect cx.gocos.cn
// @run-at document-end
// @grant unsafeWindow
// @license MIT
// @require https://cdn.staticfile.org/jquery/3.6.0/jquery.min.js
// @require https://cdn.staticfile.org/limonte-sweetalert2/11.0.1/sweetalert2.all.min.js
// ==/UserScript==
var _self = unsafeWindow,
$ = _self.jQuery || top.jQuery,
Swal = Swal || window.Swal,
columnId = getQueryVariable("columnId"),
answer_list = [],
exam_list = [],
time = 5e3, // 答题间隔时间,最好为5秒
num = {"A": 1,"B": 2, "C": 3, "D": 4};
(function() {
if (window.location.pathname == '/xf2022/learn_exam.html') {
Swal.fire('宪法小助手提示','点击确定开始考试','info').then(()=>{
Swal.fire({
position: 'top-end',
title: '脚本将在5秒后开始自动作答!',
showConfirmButton: false,
timer: 4000
})
getExam();
let t = setInterval( function() {
doExam(t)
},time);
})
} else if (window.location.pathname == '/xf2022/learn-practice.html') {
Swal.fire('宪法小助手提示','点击确定开始练习,脚本会自动收录本练习题目数据','info').then(()=>{
getAnswer(columnId);
let t = setInterval( function() {
doQuestion(t)
},time);
})
} else if (window.location.pathname == '/xf2022/learn_practice_list.html') {
Swal.fire('宪法小助手提示','使用说明:
1.做综合评价之前请先把练习做完以收集题目数据。
2.脚本运行故障如综合测评无操作等,请使用Edge浏览器+ScriptCat。
3.问题联系邮箱nawlgzs@gmail.com')
} else if (window.location.pathname == '/xf2022/evaluation.html') {
Swal.fire({
html:`
参考答案:'+ answerText + '
') : $('#exam_question').append('参考答案:'+ answerText + '