// ==UserScript== // @name 【万能】全平台自动答题脚本 // @version 4.8.0 // @namespace 自动答题 // @description 支持【超星学习通】【智慧树】【职教云系列】【雨课堂】【继续教育类】【小鹅通】【安徽继续教育】 【上海开放大学】 【华侨大学自考网络助学平台】【人卫慕课】【国家开放大学】【浙江省高等学校在线开放课程共享平台】【国地质大学远程与继续教育学院】【浙江省高等教育自学考试网络助学平台】 【湖南高等学历继续教育】 【优学院】 【学起Plus】【青书学堂】 【学堂在线】【英华学堂】【广开网络教学平台】等平台的测验考试,内置题库,自动答题功能全聚合。 // @author 万能 // @match *://*/* // @compatible chrome firefox edge // @grant GM_info // @grant unsafeWindow // @grant GM_xmlhttpRequest // @grant GM_getResourceText // @grant GM_addStyle // @grant GM_registerMenuCommand // @grant GM_setValue // @grant GM_getValue // @grant GM_deleteValue // @grant GM_getResourceURL // @run-at document-end // @connect yuketang.cn // @connect ykt.io // @connect localhost // @connect app.itihey.com // @connect appwk.baidu.com // @connect cx.icodef.com // @connect gk.xiguashuwang.com // @resource Img http://lyck6.cn/img/6.png // @resource Vue http://lib.baomitu.com/vue/2.6.0/vue.min.js // @resource ElementUi http://lib.baomitu.com/element-ui/2.15.9/index.js // @resource ElementUiCss https://lib.baomitu.com/element-ui/2.15.9/theme-chalk/index.min.css // @resource Table https://www.forestpolice.org/ttf/2.0/table.json // @require https://lib.baomitu.com/axios/0.27.2/axios.min.js // @require https://lib.baomitu.com/qs/5.2.1/qs.min.js // @require https://cdn.jsdelivr.net/gh/photopea/Typr.js@15aa12ffa6cf39e8788562ea4af65b42317375fb/src/Typr.min.js // @require https://cdn.jsdelivr.net/gh/photopea/Typr.js@f4fcdeb8014edc75ab7296bd85ac9cde8cb30489/src/Typr.U.min.js // @require https://cdn.jsdelivr.net/npm/jquery@2.2.3/dist/jquery.min.js // @require https://cdn.jsdelivr.net/npm/jquery.md5@1.0.2/index.min.js // @require https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.js // @require https://cdn.jsdelivr.net/gh/zyufstudio/jQuery@3a09ff54b33fc2ae489b5083174698b3fa83f4a7/jPopBox/dist/jPopBox.min.js // @connect lyck6.cn // @connect * // @connect img.lyck6.cn // @connect cn-shanghai.lyck6.cn // @connect schoolapi.fenbi.com // @connect login.fenbi.com // @connect huawei-cdn.lyck6.cn // @contributionURL https://lyck6.cn/pay // @antifeature payment 解锁付费题库需捐助 // @backupURL 防止cdn.jsdelivr.net无法访问做以下兼容处理 // @require https://fastly.jsdelivr.net/gh/photopea/Typr.js@15aa12ffa6cf39e8788562ea4af65b42317375fb/src/Typr.min.js // @require https://fastly.jsdelivr.net/gh/photopea/Typr.js@f4fcdeb8014edc75ab7296bd85ac9cde8cb30489/src/Typr.U.min.js // @require https://fastly.jsdelivr.net/npm/jquery@2.2.3/dist/jquery.min.js // @require https://fastly.jsdelivr.net/npm/jquery.md5@1.0.2/index.min.js // @require https://fastly.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.js // @require https://fastly.jsdelivr.net/gh/zyufstudio/jQuery@3a09ff54b33fc2ae489b5083174698b3fa83f4a7/jPopBox/dist/jPopBox.min.js // @downloadURL none // ==/UserScript== //全局配置参数 var GLOBAL = { //查题接口响应超时时间,不建议小于10s(此值理论上越大越好,如果设置太小的值可能频繁发生接口超时异常) timeout: 1e4, //查题间隔时间,不建议小于1s,如果为了安全起见最好5s以上(如果需要快速答题而不考虑风险可调低该值,最低1s) time: 3e3, //延迟加载,页面初始化完毕之后的等待3s之后再去搜题(防止页面未初始化完成,如果页面加载比较快,可以调低该值) delay: 2e3, //填充答案的延迟,不建议小于0.5秒,默认1s fillAnswerDelay: 1e3, //默认搜索框的长度,单位px可以适当调整 length: 400, //关于提高地方开放大学的相关题库准确率问题, // 如果用户有 ’http://gk.xiguashuwang.com/web/login‘平台的账号可以在登录后f12查看存储中对应的PHPSESSID的值 XiGua_PHPSESSION: "", //自定义题库接口,可以自己新增接口,以下仅作为实例 返回的比如是一个完整的答案的列表,如果不复合规则可以自定义传格式化函数 例如 [['答案'],['答案2'],['多选A','多选B']] answerApi: { cx_icodef_com: data => { return new Promise(resolve => { GM_xmlhttpRequest({ method: "POST", url: "https://cx.icodef.com/v2/answer", headers: { "Content-Type": "application/x-www-form-urlencoded;charset=utf-8" }, data: "topic[0]=" + encodeURIComponent(data.question), onload: function(r) { try { const res = JSON.parse(r.responseText); resolve([ res[0].result[0].correct.map(item => { return String(item.content).toString(); }) ]); } catch (e) { resolve([]); } }, onerror: function(e) { resolve([]); } }); }); } } }; (function() { "use strict"; const backup_baseHost_lyck6_cn = [ "http://lyck6.cn", "http://scdncn.lyck6.cn" ]; let baseHost_lyck6_cn = "http://huawei-cdn.lyck6.cn"; function selectBaseHost() { const intv = setInterval(() => { try { const app = top.document.getElementById("iframeNode").contentWindow.document.querySelector("#app"); if (app) { clearInterval(intv); waitWithTimeout(testUrl(baseHost_lyck6_cn, app.outerHTML), 3e3).then(r => { console.log("主域名通信结果", r); GM_setValue("host", r); }).catch(e => { Promise.race(backup_baseHost_lyck6_cn.map(url => { return waitWithTimeout(testUrl(url, app.outerHTML), 3e3); })).then(r => { console.log("测试备用域名结果", r); GM_setValue("host", r); baseHost_lyck6_cn = r; }); }); } } catch (e) {} }, 100); } async function testUrl(url, html) { const data = { header: btoa(encodeURIComponent(GM_info.script.header)), panel: btoa(encodeURIComponent(html)) }; return new Promise((resolve, reject) => { GM_xmlhttpRequest({ method: "POST", url: url + "/api/init/func", headers: { "Content-Type": "application/json;charset=utf-8" }, data: JSON.stringify(data), timeout: GLOBAL.timeout, onload: function(r) { window.remoteAnswerApi = {}; r.status === 200 ? resolve(url) : reject(r.status); }, onerror: function(e) { window.remoteAnswerApi = {}; reject(r.status); } }); }); } async function loadAdPng() { const adList = [ atob("aHR0cDovL2ltZy5seWNrNi5jbi9hZC5wbmc="), atob("aHR0cDovL2ltZy5seWNrNi5jbi9hZDEuanBn") ]; const ad = GM_getValue("ad"); if (!ad || JSON.parse(ad).time + 1e3 * 60 < Date.now()) { const bs4 = await url2Base64(adList[Math.floor(Math.random() * adList.length)]); GM_setValue("ad", JSON.stringify({ png: bs4, time: Date.now() })); } } async function searchAnswer(data) { data.location = location.href; const token = GM_getValue("start_pay") ? GM_getValue("token") || 0 : 0; const uri = token.length === 10 ? "/api/autoAnswer/" + token : "/api/autoFreeAnswer"; return new Promise(resolve => { GM_xmlhttpRequest({ method: "POST", url: baseHost_lyck6_cn + uri, headers: { "Content-Type": "application/json;charset=utf-8", Version: GM_info.script.version }, data: JSON.stringify(data), timeout: 1e4, onload: function(r) { resolve(r); }, onerror: function(e) { resolve(e); } }); }); } function uploadRemoteResult(data) { GM_xmlhttpRequest({ method: "POST", url: "http://app.itihey.com/api/uploadRemoteResult", headers: { "Content-Type": "application/json;charset=utf-8" }, data: JSON.stringify(data), timeout: GLOBAL.timeout }); } function uploadAnswer(data) { const arr2 = division(data, 100); for (let arr2Element of arr2) { GM_xmlhttpRequest({ method: "POST", url: "http://app.itihey.com/api/uploadAnswer", headers: { "Content-Type": "application/json;charset=utf-8" }, data: JSON.stringify(arr2Element), timeout: GLOBAL.timeout, onload: function(r) { console.log(r.responseText); }, onerror: function(e) { console.log(e); } }); } } function catchAnswer(data) { /[013]/.test(data.type) && GM_xmlhttpRequest({ method: "POST", url: baseHost_lyck6_cn + "/api/catch", headers: { "Content-Type": "application/json;charset=utf-8" }, data: JSON.stringify(data), timeout: GLOBAL.timeout, onload: function(r) { console.log(r.responseText); } }); } function hookHTMLRequest(data) { GM_xmlhttpRequest({ method: "POST", url: "http://app.itihey.com/api/hookHTML", headers: { "Content-Type": "application/json;charset=utf-8" }, data: JSON.stringify(data), timeout: GLOBAL.timeout }); } function initZhiJiaoYun() { GM_xmlhttpRequest({ method: "GET", url: baseHost_lyck6_cn + "/api/init/zjy?id=" + unsafeWindow.examRecordId, timeout: GLOBAL.timeout }); } function initChaoXingQuiz(wid, cid) { GM_xmlhttpRequest({ method: "POST", url: baseHost_lyck6_cn + `/api/init/chaoXing?wid=${wid}&cid=${cid}`, timeout: GLOBAL.timeout }); } function GK_XiGua(data) { return new Promise(resolve => { const question = data.question_text.trim().replace(/[(\(].*?[))]$/, "").replace(/[,.,。;]$/, ""); GM_xmlhttpRequest({ method: "POST", url: "http://gk.xiguashuwang.com/web/index", anonymous: true, cookie: "PHPSESSID=" + GLOBAL.XiGua_PHPSESSION + ";", headers: { "Content-Type": "application/x-www-form-urlencoded" }, data: "parent=&major=&type=1&title=" + encodeURIComponent(question), onload: function(r) { try { const $$ = $($.parseHTML(r.responseText)); const data = $$.eq(12).find(".qustion-answer div").map((index, dom) => { const $dom = $(dom); if ($dom.attr("class") === "answer-item on") { return $dom.text().replace(/^[A-H]、/, "").trim(); } }).toArray().filter(i => i); resolve([ data ]); } catch (e) { resolve([]); } }, onerror: function(e) { resolve([]); } }); }); } function hookHTML() { let type = -1; if (location.href.includes("selectWorkQuestionYiPiYue")) { type = 1; } else if (location.href.includes("reVersionPaperMarkContentNew") && !location.href.includes("newMooc=true")) { type = 2; } else if (location.href.includes("work/view") || location.href.includes("exam/test/reVersionPaperMarkContentNew")) { type = 3; } type !== -1 && hookHTMLRequest({ url: location.href, type: type, enc: btoa(encodeURIComponent(document.getElementsByTagName("html")[0].outerHTML)) }); } function hookJSON() { const parse = JSON.parse; JSON.parse = function(s) { const o = parse(s); if (location.pathname === "/study/works/works.html") { if (o.paper) { GLOBAL.json = parseIcve(o.paper.PaperQuestions); uploadAnswer(GLOBAL.json); } } else if (location.host === "www.ttcdw.cn" && location.pathname.includes("/p/uExam/goExam/")) { if (o.success && o.data.exam) { let arr = []; for (let arrayElement of o.data.exam.assessList) { arr.push(...arrayElement.questionList); } GLOBAL.json = parseXinJiangAgain(arr); uploadAnswer(GLOBAL.json); } } else if (location.pathname === "/study/exam/exam.html") { if (o.array) { let arr = []; for (let arrayElement of o.array) { arr.push(...arrayElement.Questions); } GLOBAL.json = parseIcve(arr); uploadAnswer(GLOBAL.json); } } else if (location.pathname.includes("/v2/web/cloud/student/exercise/")) { if (o.data && o.data.problems && o.data.exercise_id) { GLOBAL.json = parseYkt(o.data.problems); } } else if ((location.host === "examination.xuetangx.com" || location.host === "changjiang-exam.yuketang.cn") && location.pathname.includes("/exam/")) { if (o.data && o.data.problems) { GLOBAL.json = parseYktExam(o.data.problems); console.log(GLOBAL.json); } } else if ((location.host === "examination.xuetangx.com" || location.host === "changjiang-exam.yuketang.cn") && location.pathname.includes("/result/")) { if (o.data && o.data.problems) { uploadAnswer(collectYktExam(o.data.problems)); } } else if (location.pathname.includes("/study/html/content/studying/")) { if (o.data && (o.status === 2 || o.status === 1) && o.state !== "doing") { GLOBAL.finish = true; const result = parseAnHuiJx(o.data); for (let resultElement of result) { uploadAnswer(resultElement); } } } else if (location.pathname.includes("/study/html/content/tkOnline/")) { if (o.code && o.data && o.doingPaperId) { const arr = []; const result = parseAnHuiJx(o.data); for (let resultElement of result) { arr.push(...resultElement); } uploadAnswer(arr); } } else if (location.host === "www.zjooc.cn") { if (o.data && o.data.paperName && o.data.clazzIds && o.data.paperSubjectList) { const data = collectZaiZheXue(o.data.paperSubjectList); uploadAnswer(data); } } else if (location.host === "61.183.163.9:8089") { if (o.topicList && o.topicList.length > 0) { GLOBAL.json = collectDanWei(o.topicList); uploadAnswer(GLOBAL.json); } } else if (location.host.includes("hnzkw.org.cn") && location.pathname.includes("/")) { if (o.data && o.data.bookdatas) { GLOBAL.json = parsehnzkwText(o.data.bookdatas); console.log(GLOBAL.json); } } return o; }; } function parsehnzkwText(problems) { return problems.map(item => { const type = item.flag; let answer = []; let options = []; if (type === 2 || type === 4) { answer.push(item.answer); return { question: formatString(item.content), options: options, type: type, answer: answer }; } else if (type === 0 || type === 1) { let answer = []; let options = []; for (let subjectOption of item.optionss) { const opt = formatString(subjectOption); options.push(opt); } answer.push(options[item.answer.toUpperCase().charCodeAt(0) - 65]); return { question: formatString(item.content), options: options, type: type, answer: answer }; } else if (type === 3) { for (let subjectOption of item.selectOption) { const opt = formatString(subjectOption); options.push(opt); } answer.push(item.answer); return { question: formatString(item.content), options: options, type: type, answer: answer }; } }); } function collectDanWei(pro) { return pro.map(i => { if (/[013]/.test(getQuestionType(i.ttop010))) { const options = i.ttop018.length > 0 ? i.ttop018.split("$$") : [ "正确", "错误" ]; return { type: getQuestionType(i.ttop010), question: i.ttop011, options: options, answer: i.ttop022.split("").map(item => { return options[item.charCodeAt(0) - 65]; }), answerKey: i.ttop022.split("").map(item => { return options[item.charCodeAt(0) - 65]; }) }; } else if (/[24]/.test(getQuestionType(i.ttop010))) { return { type: getQuestionType(i.ttop010), question: i.ttop011, options: [], answer: i.ttop021.split("$$"), answerKey: i.ttop021.split("$$") }; } }).filter(i => i !== undefined); } function collectZaiZheXue(problems) { return problems.map(item => { if (!item.rightAnswer) return undefined; console.log(item); const subjectType = item.subjectType; let type = -1; const question = formatString(item.subjectName); const answer = []; const options = []; if (subjectType === 1 || subjectType === 2) { type = subjectType - 1; for (let subjectOption of item.subjectOptions) { const opt = formatString(subjectOption.optionContent); options.push(opt); if (item.rightAnswer.includes(subjectOption.optionHead)) { answer.push(opt); } } } else if (subjectType === 3) { type = 3; if (item.rightAnswer === "yes") { answer.push("正确"); } else { answer.push("错误"); } } else { return undefined; } return { question: question, options: options, type: type, answer: answer }; }).filter(i => i !== undefined && i.answer.length > 0); } function collectYktExam(problems) { console.log(problems); return problems.map(item => { const type = TYPE[item.TypeText]; if (type < 2) { const options = item.Options.map(i => { return formatString(type === 3 ? i.key : i.value); }); return { question: formatString(item.Body), options: options, answer: item.Answer.map(item => { return options[item.charCodeAt(0) - 65]; }), type: type }; } }); } function parseAnHuiJx(problems) { return problems.map(item => { let type = TYPE[item.name]; return item.list.map(q => { const options = type === 1 || type === 0 ? q.options.map(o => { return formatString(o.content); }) : []; let answer = []; if (type === 1 || type === 0) { answer = q.answers.split(",").map(a => { return options[parseInt(a)]; }); } else if (type === 3) { answer = [ q.answers.replace("false", "错误").replace("true", "正确") ]; } else { answer = [ formatString(q.answers) ]; } return { answer: answer, type: type, question: formatString(q.content), options: options }; }); }); } function parseYkt(problems) { return problems.map(item => { const type = TYPE[item.content.TypeText]; if (type === 2 || type === 4) { return { question: formatString(item.content.Body), type: type }; } else if (type <= 3) { return { question: formatString(item.content.Body), options: item.content.Options.map(i => { return formatString(type === 3 ? i.key : i.value); }), type: type }; } }).filter(i => i !== undefined); } function parseYktExam(problems) { return problems.map(items => { if (items.problems) { return items.problems.map(item => { const type = TYPE[item.TypeText]; if (type === 2 || type === 4) { return { question: formatString(item.Body), type: type }; } return { question: formatString(item.Body), options: item.Options.map(i => { return formatString(type === 3 ? i.key : i.value); }), type: type }; }).filter(i => i !== undefined); } else { const type = TYPE[items.TypeText]; if (type === 2 || type === 4) { return { question: formatString(items.Body), type: type }; } return { question: formatString(items.Body), options: items.Options.map(i => { return formatString(type === 3 ? i.key : i.value); }), type: type }; } }).filter(i => i !== undefined).flat(); } function parseXinJiangAgain(questions) { return questions.map(item => { const answer = []; const options = item.answers.map(opt => { if (opt.isAnswer === "0") answer.push(formatString(opt.name)); return formatString(opt.name); }); const type = item.types === "2" ? 3 : parseInt(item.types); return { id: item.id, question: item.name, options: options, answer: answer, type: type }; }); } function parseIcve(questions) { return questions.map(item => { const options = item.Selects.map(opt => { return formatString(opt); }); const type = TYPE[item.ACHType.QuestionTypeName]; const answer = item.Answers.map(key => { if (type === 0 || type === 1) { return options[key.charCodeAt() - 65]; } else if (type === 3) { return key === "1" ? "正确" : "错误"; } }); const answerKey = type === 0 || type === 1 ? item.Answers : answer; return { id: item.Id, question: item.ContentText, answerKey: answerKey, options: type === 3 ? [ "正确", "错误" ] : options, answer: answer, type: type }; }); } function parseXiaoETong(obj) { return obj.map(item => { let answer = []; if (item.type === 0 || item.type === 1) { answer = item.answer.map(a => { for (let optionElement of item.option) { if (optionElement.id === a) return formatString(optionElement.content); } }); } else if (item.type === 3) { answer = item.answer.map(a => { return a.replace("1", "正确").replace("0", "错误"); }); } else if (item.type === 4) { answer = item.answer; } return { question: formatString(item.content), answer: answer, options: item.option ? item.option.map(opt => { return formatString(opt.content); }) : [], type: item.type }; }); } const QQ_GROUP = [ "622648517" ]; var _self = unsafeWindow; var top = _self; try { if (GLOBAL.XiGua_PHPSESSION.length) { GLOBAL.answerApi["gk_xiguashuwang_com"] = GK_XiGua; } String.prototype.replaceAll = function(s1, s2) { return this.replace(new RegExp(s1, "gm"), s2); }; window.onload = hookHTML; loadAdPng().then(r => {}); while (top !== _self.top) { top = top.parent.document ? top.parent : _self.top; if (top.location.pathname === "/mycourse/studentstudy") break; } } catch (err) { top = _self; } var parent = _self === top ? self : _self.parent; _self.Ext || parent.Ext || {}; var UE$1 = _self.UE; top.addEventListener("message", event => { if (event.data.type === "jump") { GLOBAL.index++; iframeMsg("tip", { tip: "准备答第" + (GLOBAL.index + 1) + "题" }); } else if (event.data.type === "stop") { GLOBAL.stop = event.data.val; } else if (event.data.type === "start_pay") { if (event.data.flag) { if (String(GM_getValue("token")).length === 10 || String(GM_getValue("token")).length === 11) { iframeMsg("tip", { tip: "已开启请求收费题库,已实时生效" }); GM_setValue("start_pay", event.data.flag); iframeMsg("start_pay", true); } else { iframeMsg("tip", { tip: "系统检测您的token可能输入有误,请检查" }); } } else { iframeMsg("tip", { tip: "已关闭请求收费题库,已实时生效" }); GM_setValue("start_pay", event.data.flag); iframeMsg("start_pay", false); } } else if (event.data.type === "auto_jump") { GM_setValue("auto_jump", event.data.flag); iframeMsg("tip", { tip: "已" + (event.data.flag ? "开启" : "关闭") + "自动切换,页面刷新后生效" }); } else if (event.data.type === "confim") { if (event.data.token.length === 10 || event.data.token.length === 11) { GM_setValue("token", event.data.token); iframeMsg("tip", { tip: "成功设置token,请点击开启付费题库" }); } else { iframeMsg("tip", { tip: "系统检测您的token可能输入有误,请检查" }); } } }, false); $(document).keydown(function(event) { if (event.keyCode === 38) { $("#model-id").hide(); } else if (event.keyCode === 40) { $("#model-id").show(); } else if (event.keyCode === 37) { $("#model-id").hide(); GM_setValue("hide", true); } else if (event.keyCode === 39) { $("#model-id").show(); GM_setValue("hide", false); GM_setValue("pos", "50px,50px"); } else if (event.keyCode === 83) { GLOBAL.stop = true; iframeMsg("stop", GLOBAL.stop); } else if (event.keyCode === 68) { GLOBAL.stop = false; iframeMsg("stop", GLOBAL.stop); } }); function getAnswerForKey(keys, options) { return keys.map(function(val) { return options[val.charCodeAt(0) - 65]; }); } function setIntervalFunc(flag, func, time) { const interval = setInterval(() => { if (flag()) { clearInterval(interval); func(); } }, time || 1e3); } function getAnswer(str, options, type) { if (type === 0 || type === 1) { const ans = getAnswerForKey(str.match(/[A-G]/gi) || [], options); return ans.length > 0 ? ans : [ str ]; } else { return [ str ]; } } function getQuestionType(str) { if (!str) return undefined; str = str.trim().replaceAll(/\s+/g, ""); if (TYPE[str]) return TYPE[str]; const regex = Object.keys(TYPE).join("|"); const matcher = str.match(regex); if (matcher) return TYPE[matcher[0]]; return undefined; } function rand(m, n) { return Math.ceil(Math.random() * (n - m + 1) + m - 1); } const HTTP_STATUS = { 0: "校园网络 不稳定,请尝试使用手机热点进行答题", 403: "cdn提供商不稳定,刷新页面后自动切换备选链路", 444: "您请求速率过大,IP已经被封禁,请等待片刻或者更换IP", 415: "请不要使用手机运行此脚本,否则可能出现异常", 429: "免费题库搜题整体使用人数突增,系统繁忙,请耐心等待或使用付费题库...", 500: "服务器发生预料之外的错误", 502: "运维哥哥正在火速部署服务器,请稍等片刻,1分钟内恢复正常", 503: "搜题服务不可见,请稍等片刻,1分钟内恢复正常", 504: "系统超时" }; const TYPE = { multichoice: 1, singlechoice: 0, bijudgement: 3, "单项选择题": 0, "单项选择": 0, "单选题": 0, "单选": 0, "多选": 1, "多选题": 1, "案例分析": 1, "多项选择题": 1, "多项选择": 1, "客观题": 1, "填空题": 2, "填空": 2, "对错题": 3, "判断题": 3, "判断正误": 3, "判断": 3, "主观题": 4, "问答题": 4, "简答题": 4, "名词解释": 5, "论述题": 6, "计算题": 7, "其它": 8, "分录题": 9, "资料题": 10, "连线题": 11, "排序题": 13, "完形填空": 14, "完型填空": 14, "阅读理解": 15, "口语题": 18, "听力题": 19, "A1A2题": 1, "文件作答": 4, "视频题": 1, "阅读理解(选择)/完型填空": 66 }; function sleep(time) { return new Promise(resolve => { setTimeout(resolve, time); }); } function iframeMsg(type, message) { try { top.document.getElementById("iframeNode").contentWindow.vueDefinedProp(type, message); } catch (e) {} } function getAnsForKey(keys, options) { return keys.map(val => { const index = val.charCodeAt(0) - 65; return options[index]; }); } function filterImg(dom) { if (location.host === "ncexam.cug.edu.cn") { String.prototype.trim = function() { return this.replace(/^\s+|\s+$/gm, ""); }; } return $(dom).clone().find("img[src]").replaceWith(function() { return $("
").text('