普法网(宪法小卫士)课后练习、考试自动答题

全国学生“学宪法 讲宪法”活动自动答题脚本,因缺少测试账号无法保证每年都能用,欢迎大家提供测试账号以支持此脚本长期可用,测试账号登录信息请发送至我们的邮箱nawlgzs@gmail.com

// ==UserScript==
// @name         普法网(宪法小卫士)课后练习、考试自动答题
// @namespace    Ne-21
// @version      1.4.1
// @description  全国学生“学宪法 讲宪法”活动自动答题脚本,因缺少测试账号无法保证每年都能用,欢迎大家提供测试账号以支持此脚本长期可用,测试账号登录信息请发送至我们的邮箱nawlgzs@gmail.com
// @author       Ne-21
// @match        *://static.qspfw.moe.gov.cn/*
// @icon         data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACsAAAArCAYAAADhXXHAAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6N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DWk4fgs+iePO0P0z627y7VmUu78qQmiv88bz/ZQLNRROFEuL0i6h+8K0P7S6tOJ0ikEFEqoIijgGROga/v1Kuylcwz5bCWNo6Qc4tqNJiIR/89kIxP3RWoaQWw2SB1nkBZOHFzw4o7HzYkDN8ZaeHy72d1Bg4tOUYUF9qRU1e0rYwTMkIEqJ/C1xEPYYJymY1GpGjIf3qA0idAwHXpS7pUCsrUm9zvScaSU2AhT70xOkTWqcOoK2p8sfc2ccfJuvWML+cb6GIZlwc2fTdRjhQcNqVxqaxcy0dSYIjRbBL2ak6AJeCF5HXFC2VWyo7EKZwU8nSbpipPUDs26LlQLCV1K4xKukpfaXb15G3jMeg+J++w2LJitCq40GsMkjEyXB5YlhgZk1SwcebOgvT/C3gGGqT1k4Fe0CGfImdgGLMn21EVoxaroRZNXQRpZ8rTxFFMh9WqSpQhpyaw6Y0VsCodmD7I1By0oh01ap1YmSyBrF70wPjfHxuFjDGb4Egp5YIUJ69LYq6mc5pBkN4YfWYMRjI8jEGnEcClvr3BNtIhO2MJdFHLzkgqL5v0pncsDB2G56buztIsyzOvQM/O7bs//PrlPRl8Np6qW3x5YMVQEo3ngjR/8TsnDcJNmd7ElLmRGGbqlkUqrsZILALZOdQWURgYSO7S0TDR70cpZ4eI2Ro5/O6od/jgcY12nkFSc0kcNIrJ5qs8dKB7vPvsnvc9HRStATzHr7g8sJZIAnd3DWGCZTc+Oqcsp84sPGSJQvTTONNFYI+FPOEZrWcffcAdCh+ghvIl+QQbAU0HVMd8K0dWKjwRTJ+UTPQl/SFKEYoL0VvGTdKIbktfPKKAtVIanL+b/YcAAwARLZvTKDgQZgAAAABJRU5ErkJggg==
// @run-at       document-end
// @grant        unsafeWindow
// @grant        GM_setValue
// @grant        GM_getValue
// @license      MIT
// @require      https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.6.0/jquery.min.js
// @require      https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/limonte-sweetalert2/11.0.1/sweetalert2.all.min.js
// @require      https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/crypto-js/4.1.1/crypto-js.min.js
// ==/UserScript==

var _self = unsafeWindow,
    $ = _self.jQuery || top.jQuery,
    Swal = Swal || window.Swal,
    columnId = getQueryVariable("columnId"),
    answer_list = [],
    exam_list = [],
    time = 3e3, // 答题间隔时间,最好为5秒
    save_key = "xfxws2024",
    num = {"A": 1,"B": 2, "C": 3, "D": 4};

(function() {
    // 题目切换其实可以不依靠定时器,不过懒得改了,能用就行。。。
    if (window.location.pathname.indexOf('learn_exam.html') != -1) {
        Swal.fire('宪法小助手提示','点击确定开始考试','info').then(()=>{
            Swal.fire({
                position: 'top-end',
                title: '脚本将在3秒后开始自动作答!',
                showConfirmButton: false,
                timer: 3000
            })
            getExam();
            let t = setInterval( function() {
                doExam(t)
            },time);
        })
    } else if (window.location.pathname.indexOf('learn-practice.html') != -1) {
        Swal.fire('宪法小助手提示','点击确定开始练习,脚本会自动收录本练习题目数据','info').then(()=>{
            getAnswer(columnId);
            let t = setInterval( function() {
                doQuestion(t)
            },time);
        })
    } else if (window.location.pathname.indexOf('learn_practice_list.html') != -1) {
        Swal.fire('宪法小助手提示','<div style="font-size: 13px;">脚本最后更新时间:2024.10.26<br />使用说明:<br /><div><span style="color: red;">1.脚本题库数据托管于本地,请在做综合评价前逐个完成练习,收集答案!!!</span><br />2.脚本运行故障如综合测评无操作等,请使用Edge浏览器+ScriptCat。<br />3.问题联系邮箱nawlgzs@gmail.com<br />4.脚本数据来自本网站后端返回的明文JSON数据包,脚本不涉及任何逆向操作!<br />5.脚本仅供学习交流,请勿用于商业用途,否则后果自负!</div></div>')
    } else if (window.location.pathname.indexOf('evaluation.html') != -1) {
       
    } else {
        console.log(window.location.pathname)
    }
})();

// 解析url参数
function getQueryVariable(variable) {
       var query = window.location.search.substring(1);
       var vars = query.split("&");
       for (var i=0;i<vars.length;i++) {
               var pair = vars[i].split("=");
               if(pair[0] == variable){return pair[1];}
       }
       return(false);
};

// 正则匹配
function getStr(str, start, end) {
    let res = str.match(new RegExp(`${start}(.*?)${end}`))
    return res ? res[1] : null
}

// 获取答案
function getAnswer(columnId) {
    $.ajax({
        url: _self.config.practice.host + _self.config.practice.practice + "?columnId="+ columnId + "&taskId=" + _self.config.taskId,
        headers: _self.config.apiConfig.header,
        async: false,
        success: function (res) {
            const { data, status } = res;
            if (status === "0") {
                var questionBankList = data.questionBankList
                answer_list = questionBankList;
                upload(answer_list)
            } else if (status === "1") {
                alert("请先学习当前模块");
                window.history.go(-1);
            } else if (status === "-2") {
                alert("请重新登陆");
            } else {

            }
        },
        error: function (err) {
        }
    });
}

// 答题操作
function doQuestion(t) {
    var cur_topic = $('#currentTopic').text(),
        tol_topic = $('#totalTopic').text(),
        answer = answer_list[cur_topic - 1].answer;
    $('#exam_answer > div:nth-child(' + num[answer] + ')').click();
    if (cur_topic == tol_topic) {
        clearInterval(t);
        setTimeout(function(){Swal.fire('宪法小助手提示','答题完成','info')},time / 2);
    } else{
        setTimeout(function(){$('#next_question').click()},time / 2);
    };
}

// 获取考试题目
function getExam(){
    $.ajax({
        url: _self.config.wexam.host + _self.config.wexam.getPaper + "?taskId=" + _self.config.taskId,
        headers: _self.config.apiConfig.header,
        async: false,
        success: function (res) {
            const { data, status, message } = res;
            if (status === "0") {
                var question_data = res.data;
                var paper = question_data.paper;
                var paperInfo = paper.paperInfo;
                exam_list = paperInfo;
            } else {
                alert('获取考试题目失败!')
            }
        },
        error: function (err) {
        }
    });
}

// 考试答题操作
function doExam(t){
    let db_json = []
    if (GM_getValue(save_key) && JSON.parse(GM_getValue(save_key)).length >= 0) {
        db_json = JSON.parse(GM_getValue(save_key))
    } else {
        $('#ne21ans')[0] ? $('#ne21ans').html('<p style="color: red;">未匹配到答案,请手动作答~</p>') : $('#exam_question').append('<div id="ne21ans"><p style="color: red;">未匹配到答案,请手动作答~</p></div>')
        return
    }

    console.log(JSON.parse(GM_getValue(save_key)))
    $('#ne21ans')[0] ? $('#ne21ans').html('<p style="color: red;">正在搜索答案~</p>') : $('#exam_question').append('<div id="ne21ans"><p style="color: red;">正在搜索答案~</p></div>')

    var cur_topic = $('#currentTopic').text(),
        tol_topic = $('#totalTopic').text(),
        questionInfo = exam_list[cur_topic - 1];


    ans_index = []
    let question = filterStr(questionInfo.content) 
    let ops = questionInfo.answerOptions.split("@!@")
    ops.map((el)=> filterStr(el) )
    for (var i = 0; i < ops.length; i++) {
        hash_tmp = MD555(question+"|"+ops[i])
        db_json.forEach((item)=>{
            if (item.hash == hash_tmp) {
                ans_index.push(i)
            }
        }) 
    }

    if (ans_index.length == 0) {
        $('#ne21ans')[0] ? $('#ne21ans').html('<p style="color: red;">无题库数据,请先收集答案或自己作答~</p>') : $('#exam_question').append('<div id="ne21ans"><p style="color: red;">无题库数据,请先收集答案或自己作答~</p></div>')
        return
    }

    ans_index.forEach((item1)=>{
        $('#ne21ans').html('<p style="color: red;">参考答案:'+ ops[item1] + '</p>')
        $('#exam_answer > div:nth-child(' + (item1+1) + ')').click();  
    })

    if (cur_topic == tol_topic) {
         clearInterval(t);
         setTimeout(function(){Swal.fire('宪法小助手提示','答题完成,请自己点击交卷!','info')},time / 2);
    } else{
         setTimeout(function(){$('#next_question').click()},time / 2);
    };

}

function upload(question_data) {
    let db_json = []
    if (GM_getValue(save_key) && JSON.parse(GM_getValue(save_key)).length >= 0) {
        db_json = JSON.parse(GM_getValue(save_key))
    }
    question_data.forEach((item)=>{
        let question = filterStr(item.content)
        let ans_index = []
        item.answer.split().forEach(((item1)=>{
            let index_tmp = "ABCDEFG".indexOf(item1)
            ans_index.push(index_tmp)
        }))
        let ans_ops = item.answerOptions.split("@!@")
        ans_ops.map((el)=> filterStr(el) )
        ans_index.forEach((item3)=>{
            db_json.push({
                "hash":MD555(question+"|"+ans_ops[item3]), 
                "question": question, 
                "answer": ans_ops[item3]
                })
        })
    })

    let dbJson = uniqueByField(db_json,"hash")
    GM_setValue(save_key,JSON.stringify(dbJson))
    // console.log(JSON.parse(GM_getValue(save_key)))
}

function MD555(str) {
    return CryptoJS.MD5(str).toString()
}

// 重复数据过滤
function uniqueByField(array, field) {
    const seen = new Set();
    return array.filter((item) => {
        const key = item[field];
        return seen.has(key) ? false : seen.add(key);
    });
}

// 去除字符串中的空格、换行、制表符
function filterStr(str){
   return str.replace(/[\r\n\s<br>]/g, "").trim()
}