首页 > 程序资源 > 教育部全国青少年普法网-考试题库与答案(自动获取题库脚本)

教育部全国青少年普法网-考试题库与答案(自动获取题库脚本)

说多了都是泪,还不是因为准小姨子的任务,考了四遍都没过,还剩最后一次机会找她姐紧急求助来了。。。

自动获取题库的脚本在下面,使用方法:

复制脚本后,打开 “Chrome” 类的新型浏览器,按 F12 键,再打开的新“窗口”中找到 Console 将代码粘贴到下面的空白框中,回车执行即可,执行完毕会自动获取最新题库并输出。

注意,一定要登录并已经选择年纪后,才可以自动获取答案。

Snipaste_2020-10-16_22-26-03.png

let result_text = [], oMap = ['A', 'B', 'C', 'D', 'E'];

function getPractice(columnId) {
    $.ajax({
        url: `${config.practice.host}${config.practice.practice}?columnId=${columnId}`,
        headers: config.apiConfig.header,
        async: false
    }).done(function (res) {
        res.data.questionBankList.forEach(item => {
            result_text.push("问题:" + item.content);

            item.answerOptions.split("@!@").forEach((option, index) => {
                result_text.push(oMap[index] + ": " + option)
            });

            result_text.push("答案:" + item.answer);
            result_text.push("解析:" + item.analysis);
            result_text.push("========")
        });
        console.log('Ok', columnId)
    });
    return;
}

function getColumnList() {
    $.ajax({
        url: `${config.practice.host}${config.practice.getColumnList}`,
        headers: config.apiConfig.header,
        async: false
    }).then(function (res) {
        let { status, message,data } = res;
        if (status != '0' || data.columnList.length <= 0) {
            alert('错误:' + (message || '数据异常,没有课程'));
            return;
        }

        data.columnList.forEach(item => {
            getPractice(item.columnId);
        });

        console.log(result_text.join("\n"));
    }, function (info) {
            alert('还没有登陆');
    });
}

getColumnList();

下面是 高中组-二年级 的答案,其他年级需要自己执行脚本获取(因为我没有账号)

高中组-二年级-题库.txt

题库内容预览.png

上一篇: 谷歌翻译(非公开)接口 tk 值计算方式(附简易实现接口调用)。

下一篇: Laravel写单元测试时,提示 Facade 不存在的原因及解决方案。

最近回复

标签