// ==UserScript==
// @name 小柴答题助手|学习通 超星 自动刷课 AI答题 每天免费100题
// @namespace https://rainbowchaii.com/dati
// @version 1.7.2
// @description 学习通(超星)自动看课和 AI 答题:视频静音续播、文档自动完成、章节测验 AI 作答,看完自动进入下一节。不登录先送 30 题试用,邮箱注册登录后每天免费 100 题,用完可买积分。AI 答案不保证全对,交卷前请自己检查。
// @author 小柴
// @tag 超星学习通
// @tag 自动刷课
// @tag AI答题
// @antifeature payment 每天免费题数用完后,答题需要购买积分
// @match *://*/*
// @run-at document-start
// @icon data:image/webp;base64,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
// @grant GM_xmlhttpRequest
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_getResourceText
// @grant GM_info
// @grant unsafeWindow
// @grant GM_openInTab
// @connect api.rainbowchaii.com
// @connect *
// @require https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js
// @require https://cdn.jsdelivr.net/npm/js-md5@0.8.3/build/md5.min.js
// @resource cxTable https://cdn.jsdelivr.net/npm/tiku-static-assets@1.0.0/cx_table.json
// ==/UserScript==
/* 小柴答题助手 1.7.2 — 引擎、面板和 AI 接口为小柴自研;各平台的页面适配规则参考了社区答题脚本整理。 */
(function () {
"use strict";
const W = typeof unsafeWindow !== "undefined" ? unsafeWindow : window;
const $ = jQuery;
const IS_TOP = (() => { try { return window.top === window.self; } catch (e) { return false; } })();
/* ---------- 设置 ---------- */
const SVC = "https://api.rainbowchaii.com/api/dati"; // 小柴答题服务:账号、积分、代答
const DEFAULT_CFG = {
token: "", // 小柴答题登录凭证
acct: "", // 登录的账号(显示用,手机号中间打码)
delay: 1, // 每题填写间隔(秒)
concurrency: 4, // 同时向模型要几道题的答案
study: true, // 学习通:自动完成任务点(视频、文档、章节测验)并切下一节
autoChapter: true, // 学习通:「全自动」,本节任务点完成后自动进入下一节
studyRate: 1, // 学习通视频倍速(1–2,倍速有被判异常的风险)
autoSubmit: false, // 学习通章节测验答完自动提交(有题没答案时不交)
fillDelay: 600, // 点选项之间的间隔(毫秒)
autoNext: true, // 答完自动下一页/下一题
vision: false, // 题目里的图片发给模型
adapter: "", // 可选:自己的题库接口(POST {question,options,type} → {answer:{allAnswer}})
};
// 旧版「自带密钥」模式已删掉,读到当时存的字段就从本机清除
const OLD_KEYS = ["mode", "base", "key", "model"];
const cfg = () => {
const saved = GM_getValue("xc_cfg") || {};
if (OLD_KEYS.some((k) => k in saved)) { OLD_KEYS.forEach((k) => delete saved[k]); GM_setValue("xc_cfg", saved); }
return Object.assign({}, DEFAULT_CFG, saved);
};
// 设备编号:未登录试用额度按它记(服务器只存它的哈希)
const deviceId = () => {
let d = GM_getValue("xc_device");
if (!d) {
d = typeof crypto !== "undefined" && crypto.randomUUID ? crypto.randomUUID().replace(/-/g, "") : md5(Math.random() + "|" + Date.now() + "|" + navigator.userAgent);
GM_setValue("xc_device", d);
}
return d;
};
const saveCfg = (patch) => GM_setValue("xc_cfg", Object.assign(cfg(), patch));
const paused = () => Boolean(GM_getValue("xc_paused", false));
/* ---------- 运行时上下文(适配规则共用) ---------- */
const X = { json: [], index: 0, i: 0, matched: false, site: "" };
/* ---------- 基础工具 ---------- */
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
function waitUntil(cond, cb, every = 1000) {
const t = setInterval(() => { let ok = false; try { ok = cond(); } catch (e) {} if (ok) { clearInterval(t); cb(); } }, every);
}
function withTimeout(p, ms, fallback) {
let t;
return Promise.race([p, new Promise((res, rej) => { t = setTimeout(() => (fallback === undefined ? rej(new Error("超时")) : res(fallback)), ms); })]).finally(() => clearTimeout(t));
}
function decodeHTML(s) { const d = document.createElement("div"); d.innerHTML = s; return d.innerText || d.textContent || ""; }
/** 统一文本:全角转半角、压空白、统一引号、去尾部标点 */
function fmt(src) {
let s = String(src == null ? "" : src);
if (!/ String.fromCharCode(c.charCodeAt(0) - 0xfee0));
return s.replace(/\s+/g, " ").replace(/[“”]/g, '"').replace(/[‘’]/g, "'").replace(/。/g, ".").replace(/[,.?:!;]$/, "").trim();
}
/** 取元素文字,图片和 iframe 保留成
文本,方便识图 */
function imgText(el) {
const c = $(el).clone();
c.find("img[src]").each(function () { $(this).replaceWith($("
" + esc(m.text) + '
' + '" + esc(sub) + "
' + esc(r.question) + "
" + (r.answer ? "" + esc(r.answer) + "" : "") + 'AI 答题正确率达不到 100%,交卷前请自己检查一遍。
' + this.promoView(); const setView = this.acctView() + '
/gi, "");
obj.options = obj.options.map(i => i.trim().replace(/^[abAB]\)\s+/, "").replace(/^[A-Za-z]\s+/, "").trim());
}
});
site({
name: "职教云MOOCAI",
match: location.pathname.includes("/preview-exam") && location.host === "ai.icve.com.cn",
intv: () => $(".questions").length,
root: ".paper-content .questions",
elements: {
question: ".single-title-content,.multiple-title-content,.judge-title",
options: ".single-item-xxnr,.multiple-item-xxnr,.judge-item-xxnr",
$options: "label",
type: ".single-title-num,.multiple-title-num,.judge-title-num"
},
wrap: obj => {
obj.options = obj.options.map(i => i.trim().replace(/^[abAB]\)/, "").replace(/^[A-Za-z]/, "").trim());
},
finished: () => {
if ($(".ivu-btn:contains(下一题)").hasClass("btn_dis")) return false;
$(".ivu-btn:contains(下一题)").click();
return true;
}
});
function parseIcve(questions) {
return questions.map(item => {
const options = item.Selects.map(opt => fmt(opt));
const type = qtype(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
};
});
}
site({
name: "资源库 新版",
match: location.pathname === "/icve-study/jobTest" || location.pathname === "/icve-study/coursePreview/jobTest" || location.pathname === "/icve-study/coursePreview/test",
root: ".subjectDet",
elements: {
question: "h5,.titleTest span:last",
options: ".optionList label",
$options: ".optionList input",
type: ".title,.titleTest .xvhao"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
},
fill: (type, answer, $option) => {
if (type === 4 || type === 2) {
W.UE.getEditor($option.attr("name")).setContent(answer);
}
}
});
site({
name: "资源库 WWW开头",
match: location.pathname === "/study/works/works.html" || location.pathname === "/study/exam/exam.html",
root: ".questions",
elements: {
question: ".preview_stem",
options: "li .preview_cont",
$options: "li input",
type: "input:hidden"
},
hook: () => {
hookJSON(o => {
if (location.pathname === "/study/works/works.html") {
if (o.paper) {
X.json = parseIcve(o.paper.PaperQuestions);
}
} else if (location.pathname === "/study/exam/exam.html") {
if (o.array) {
X.json = parseIcve(o.array.map(item => item.Questions).flat());
}
}
});
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
function get_element(id) {
for (let jsonElement of X.json) {
if (jsonElement.id === id) {
return jsonElement;
}
}
}
const ele = get_element(obj.$item.find("input:hidden").val());
obj.question = ele.question;
obj.answer = ele.answerKey ? ele.answerKey : ele.answer;
obj.type = ele.type;
obj.options = ele.options;
},
fill: (type, answer, $option) => {
if (type === 4 || type === 2) {
W.UE.getEditor($option.attr("name")).setContent(answer);
}
}
});
site({
name: "智慧职教 作业/考试",
match: location.host.includes("zjy2.icve.com.cn"),
intv: () => $(".subjectDet").length,
root: ".subjectDet",
elements: {
question: "h5,.titleT .htmlP",
options: ".optionList .el-radio__label,.el-checkbox__label",
$options: ".optionList input",
type: ".titleTwo,.xvhao"
},
hook: () => {
const parse = ques => ques.map(i => {
const options = [];
const answer = [];
if (i.typeId === "3") {
answer.push(i.optionAnswer === "1" ? "正确" : "错误");
} else if (/[12]/.test(i.typeId)) {
options.push(...JSON.parse(i.dataJson).map(i => {
if (i.IsAnswer) {
answer.push(fmt(i.Content));
}
return fmt(i.Content);
}));
}
return {
options: options,
qid: i.id,
answer: answer
};
});
hookJSON(o => {
if (o.name && o.questions && o.totalScore) {
X.json = parse(o.questions);
} else if (o.data && o.data.questions) {
X.json = parse(o.data.questions);
}
});
},
ignore_click: $item => $($item).parent().attr("class") === "is-checked",
wrap: obj => {
function findAnswer(id) {
for (let jsonElement of X.json) {
if (jsonElement.qid === id) {
return jsonElement.answer;
}
}
}
obj.answer = findAnswer(obj.$item.attr("id"));
}
});
function parsehnzkwText(problems) {
return problems.map(item => {
const type = item.flag === 1 ? 2 : item.flag === 0 ? 0 : item.flag === 4 ? 1 : item.flag === 3 ? 3 : undefined;
let answer = [];
let options = [];
if (type === 2) {
answer.push(item.answer);
return {
question: fmt(item.content),
options: options,
type: type,
answer: answer
};
} else if (type === 0) {
for (let subjectOption of item.optionss) {
const opt = fmt(subjectOption);
options.push(opt);
}
if (type === 1) {
item.answer.split("|").map(i => {
answer.push(options[i.toUpperCase().charCodeAt(0) - 65]);
});
} else {
answer.push(options[item.answer.toUpperCase().charCodeAt(0) - 65]);
}
return {
question: fmt(item.content),
options: options,
type: type,
answer: answer
};
} else if (type === 3) {
for (let subjectOption of item.selectOption) {
const opt = fmt(subjectOption);
options.push(opt);
}
answer.push(item.answer);
return {
question: fmt(item.content),
options: options,
type: type,
answer: answer
};
}
});
}
function parseDanWei(pro) {
return pro.map(i => {
const type = qtype(i.ttop010);
const question = i.ttop011;
const options = [];
const answer = [];
if (type === 0 || type === 1 || type === 3) {
options.push(...i.ttop018.length > 0 ? i.ttop018.split("$$") : [ "正确", "错误" ]);
answer.push(...i.ttop022.split("").map(item => options[item.charCodeAt(0) - 65]));
} else if (type === 2 || type === 4) {
answer.push(...i.ttop021.split("$$"));
}
return {
question: question,
type: type,
answer: answer,
options: options
};
}).filter(i => i);
}
function parseYxbyunExam(problems) {
return problems.map(item => {
const type = qtype(item.dtmc);
return item.sjSjstSaveReqVOS.map(item => {
let answer = [];
let options = [];
if (type === 2) {
return {
question: fmt(item.tg),
options: options,
type: type,
answer: answer
};
} else if (type === 0 || type === 3 || type === 1) {
let answer = item?.dxpdtda ? item?.dxpdtda.split(",") : item?.dxtda ? item?.dxtda.split(",") : [];
let options = [];
for (let subjectOption of item?.tkStxxSaveReqVOS || []) {
const opt = fmt(subjectOption.xxnr);
options.push(opt);
}
return {
question: fmt(item.tg),
options: options,
type: type,
answer: answer
};
}
});
});
}
function parseYxbyunTest(problems) {
return problems.map(item => {
const type = qtype(item.bigName);
return item.smallContent.map(item => {
let answer = [];
let options = [];
if (type === 2) {
answer.push(item.answer);
return {
question: fmt(item.content),
options: options,
type: type,
answer: answer
};
} else if (type === 0 || type === 3 || type === 1) {
let answer = [];
let options = [];
for (let subjectOption of item.question.optionList) {
const opt = fmt(subjectOption.questionContent);
options.push(opt);
}
if (type === 1) {
item.question.questionAnswer.split(",").map(i => {
answer.push(options[i.toUpperCase().charCodeAt(0) - 65]);
});
} else {
answer.push(options[item.question.questionAnswer.toUpperCase().charCodeAt(0) - 65]);
}
return {
question: fmt(item.question.questionTitle),
options: options,
type: type,
answer: answer
};
}
});
});
}
function parseShihuaExam(problems) {
return problems.partitions.map(item => item.questions.map(item => {
const type = qtype(item.queTypeName);
let answer = [];
let options = [];
if (type === 2) {
answer.push(item.answer);
return {
question: fmt(item.stem),
options: options,
type: type,
answer: answer
};
} else if (type === 0 || type === 3 || type === 1) {
let answer = [];
let options = [];
if (type === 3) {
options = [ "对", "错" ];
} else {
item.options.map(i => {
const opt = fmt(i.optInfo);
options.push(opt);
});
}
if (type === 1) {
item.answer.split(",").map(i => {
answer.push(options[i - 0]);
});
} else if (type === 3) {
if (item.answer === "Y") {
answer = [ "对" ];
} else {
answer = [ "错" ];
}
} else {
answer.push(options[item.answer - 0]);
}
return {
question: fmt(item.stem),
options: options,
type: type,
answer: answer
};
}
}));
}
site({
name: "考试系统",
match: location.host === "gdrtvu.exam-cloud.cn" && location.pathname.includes("examRecordData"),
intv: () => $("#examing-home-question").length,
root: ".question-container",
elements: {
question: ".question-body:first",
options: ".option .question-options",
$options: ".option input",
type: ".question-header .container"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
const split = obj.question.split(/[A-G]\./);
if (split.length === obj.options.length + 1) {
obj.question = split.shift();
obj.options = split;
}
if (obj.type === undefined || obj.type === null || isNaN(obj.type) || obj.type > 3) {
obj.type = guessType(obj.$options);
}
if (document.querySelector(".question-container .right")) {
let current = 0;
const domItem = document.querySelectorAll(".item");
for (const dom of domItem) {
current++;
if (dom.className.includes("current-question")) {
break;
}
}
obj.question = `【第${current}小题】` + imgText(jQuery(".right .question-view .question-body")) + obj.question;
}
},
finished: async need_jump => {
await sleep(500);
if ($(".next a").length === 0) {
return false;
}
window.parent.document.querySelector(".next a").click();
return true;
}
});
site({
name: "云班课",
match: location.pathname === "/web/index.php" && location.href.includes("m=reply"),
root: ".topic-item",
elements: {
question: ".t-con .t-subject",
options: ".t-option label .option-content",
$options: ".el-radio__input,.el-checkbox__input",
type: ".t-info .t-type"
},
ignore_click: $item => $item.hasClass("is-checked"),
wrap: obj => {
if (obj.type === "A1A2题") {
obj.type = 1;
}
obj.question = obj.question.replace(/
/gi, "");
obj.options = obj.options.map(i => i.trim().replace(/^[abAB]\)\s+/, "").replace(/^[A-Za-z]\s+/, "").trim());
}
});
site({
name: "中国地质大学",
match: location.pathname.includes("/Exam/OnlineExamV2/"),
root: ".stViewItem",
elements: {
question: ".stViewHead div",
options: ".stViewCont .stViewOption a",
$options: ".stViewCont .stViewOption a,input"
},
intv: () => $(".ExamTime").length,
wrap: obj => {
obj.type = qtype(obj.$item.parent().parent().prev().find(".E_E_L_I_C_R_C_T_SubType").text());
obj.question = obj.question.replace(/\(\d+分\)/, "");
obj.options = obj.options.map(i => i.replace(/\([A-Za-z]\)/, "").trim());
},
fill: (type, answer, $option) => {
if (type === 4 || type === 2) {
$option.val(answer);
}
}
});
site({
name: "单位",
match: (location.host === "61.183.163.9:8089" || location.host === "zjpt.nnjjtgs.com:8081") && (location.href.includes("ksnr") || location.href.includes("lxnr")),
hook: () => {
hookJSON(o => {
if (o.topicList && o.topicList.length > 0) {
X.json = parseDanWei(o.topicList);
}
});
},
root: ".tm",
elements: {
question: ".tmnrbj span:last-child",
options: ".van-radio-group .dxt .van-radio__label,.van-checkbox__label",
$options: ".van-radio-group .dxt .van-radio__label,.van-checkbox__label,.van-field__control",
type: ".tmnrbj span"
},
intv: () => $(".ExamTime").length || document.getElementById("pup-b"),
wrap: obj => {
obj.answer = X.json[jQuery(".tmnrbj span:last-child").text().match(/^(\d+)、/)[1] - 1].answer;
},
finished: () => {
jQuery(".xyt").click();
return true;
}
});
site({
name: "小鹅通",
match: location.pathname.includes("/evaluation_wechat/examination/detail/"),
root: ".question-title,.title__text",
elements: {
question: "#detail_div",
options: "label .image-text-box p",
$options: "label,.simulation_inp"
},
ignore_click: ($item, type) => {
if (type === 0) {
return $item.html().includes("single-exam-radio-active");
} else if (type === 1) {
return $item.html().includes("check-i-active");
}
},
wrap: obj => {
const $item = obj.$item;
obj.$options = $item.parent().next().find(".option-item,.checking-option__container,.fill_blank");
obj.type = qtype($item.next().text());
if (obj.type === 2) {
obj.$options = $item.parent().parent();
}
if (obj.type === 3) {
obj.options = [ "正确", "错误" ];
} else {
obj.options = jQuery.map($item.parent().next().find(".option-item #detail_div"), function(val) {
return fmt(imgText(val));
});
}
},
fill: (type, answer, $option) => {
if (type === 2) {
const vue = $option.get(0).__vue__;
vue.content[0] = answer;
vue.emitAnswer();
$option.find(".simulation_inp").text(answer);
}
}
});
site({
name: "小饿通H5",
match: location.host.includes("h5.xiaoeknow") || location.href.includes("/exam/h5_evaluation/"),
root: ".practice-detail__body",
elements: {
question: ".question-wrap__title #detail_div",
options: ".question-option #detail_div",
$options: ".question-option #detail_div",
type: ".question-wrap__title-tag"
},
wrap: obj => {
const $item = obj.$item;
obj.$options = $item.parent().next().find(".option-item,.checking-option__container,.fill_blank");
obj.type = TYPE_MAP[$item.next().text().replace(/\s+/, "").replace("(", "").replace(")", "")];
if (obj.type === 2) {
obj.$options = $item.parent().parent();
}
if (obj.type === 3) {
obj.options = [ "正确", "错误" ];
} else {
obj.options = jQuery.map($item.parent().next().find(".option-item #detail_div"), function(val) {
return fmt(imgText(val));
});
}
},
finished: () => {
$(".practice-detail__bottom-item:last-child").click();
return $(".next").text() === "下一题";
}
});
site({
name: "人卫慕课测验",
match: location.pathname.includes("/memberFront/paper.zhtml"),
intv: () => $("#question_").attr("style").length === 0,
root: ".quesinfo",
elements: {
question: "dl dt",
options: "dd label",
$options: "dd input"
},
wrap: obj => {
if (obj.$options.length === 2) {
obj.type = 3;
obj.options = [ "正确", "错误" ];
} else {
obj.type = 0;
}
}
});
site({
name: "青书学堂考试",
match: location.host.includes("qingshuxuetang") && (location.pathname.includes("/Student/MakeupExamPaper") || location.pathname.includes("Student/ExamPaper")),
intv: () => $(".paper-container .question-detail-container").length,
root: ".paper-container .question-detail-container",
elements: {
question: ".question-detail-description .detail-description-content",
options: ".question-detail-options label .option-description",
$options: ".question-detail-options label input",
type: ".question-detail-type .question-detail-type-desc"
},
wrap: obj => {
obj.qid = obj.$item.attr("id");
obj.options = obj.options.map(i => i.replace(/\([A-Za-z]\)/, "").trim());
if (obj.type === 5 || obj.type === 4 || obj.type === 6) {
obj.$options = obj.$item.find("div[id^=cke_editor]");
}
},
fill: (type, answer, $option) => {
if (type === 4 || type === 5 || type === 6) {
W.CKEDITOR.instances[$option.attr("id").replace("cke_", "")].setData(answer);
}
},
ignore_click: $item => $item.prop("checked")
});
site({
name: "青书学堂测验",
match: location.host.includes("qingshuxuetang") && (location.pathname.includes("/Student/ExercisePaper") || location.pathname.includes("/Student/SimulationExercise")) || location.host === "quiz.qingshuxuetang.com" && location.pathname.includes("/Student/Quiz/Detail"),
intv: () => $(".question-detail-container").length,
root: ".question-detail-container",
elements: {
question: ".question-detail-description span",
options: ".question-detail-options label .option-description",
$options: ".question-detail-options div input,.question-detail-solution-textarea",
type: ".question-detail-type"
},
wrap: obj => {
obj.qid = obj.$item.attr("id");
obj.options = obj.options.map(i => i.replace(/\([A-Za-z]\)/, "").trim());
},
ignore_click: ($item, type) => {
if (type === 1) {
return $item.prop("checked");
}
},
fill: (type, answer, $option) => {
if (type === 4 || type === 2) {
$option.parents().find(".question-controller-wrapper .next").click();
}
}
});
site({
name: "优学院测验",
match: location.pathname === "/learnCourse/learnCourse.html",
intv: () => $(".question-setting-panel").length,
root: ".split-screen-wrapper",
elements: {
question: ".question-title-scroller .question-title-html",
options: ".choice-list .content-wrapper .text",
$options: ".choice-list .checkbox ,.question-body-wrapper .choice-btn",
type: ".question-title-scroller .question-type-tag"
},
wrap: obj => {
obj.options = obj.options.map(i => fmt(i.replaceAll(/[a-zA-z]\)\s+/g, "").replaceAll(/^[a-z]\s+/g, "").replaceAll(/^[a-z]、\s+/g, "").trim()));
},
ignore_click: $item => $item.hasClass("selected")
});
site({
name: "优学院作业",
match: location.pathname === "/quiz/pc.html",
intv: () => $(".questions").length,
root: ".question-item",
elements: {
question: ".question-title",
options: "ul label .choice-title",
$options: "ul label input",
type: ".title"
},
wrap: obj => {
obj.options = obj.options.map(i => fmt(i.replaceAll(/[a-zA-z]\)\s+/g, "").replaceAll(/^[a-z]\s+/g, "").replaceAll(/^[a-z]、\s+/g, "").trim()));
},
ignore_click: $item => $item.prop("checked")
});
site({
name: "优学院考试",
match: location.host === "utest.ulearning.cn" && location.pathname === "/",
intv: () => $(".section-area").length,
root: ".question-area .question-item",
elements: {
question: ".base-question .title .rich-text",
options: ".choice-list label .rich-text",
$options: ".choice-list label, .iconfont",
type: ".base-question .title .tip"
},
wrap: obj => {
obj.options = obj.options.map(i => fmt(i.replaceAll(/[a-zA-z]\)\s+/g, "").replaceAll(/^[a-z]\s+/g, "").replaceAll(/^[a-z]、\s+/g, "").trim()));
},
ignore_click: $item => $item.hasClass("is-checked"),
finished: () => {
if ($(".next-part:contains(下个部分)").length) {
$(".next-part").click();
return true;
} else {
return false;
}
}
});
site({
name: "优学院作业",
match: location.pathname === "/umooc/learner/homework.do",
intv: () => $(".multiple-choices").length,
root: ".multiple-choices,.judge",
elements: {
question: "h5 .position-rltv span:last-child",
options: "ul label span:last-child",
$options: "ul label input,.radios .radio input",
type: "h5 .typeName"
},
wrap: obj => {
obj.options = obj.options.map(i => fmt(i.replaceAll(/[a-zA-z]\)\s+/g, "").replaceAll(/^[a-z]\s+/g, "").replaceAll(/^[a-z]、\s+/g, "").trim()));
},
ignore_click: $item => $item.prev().hasClass("checkbox-checked")
});
site({
name: "万学",
match: location.pathname.includes("/sls/N2014_StudyController/next"),
root: ".question",
elements: {
question: "tr .nm2",
options: ".grey td p",
$options: ".option li label",
type: "tr .nm2"
},
wrap: obj => {
obj.question = obj.question.parent().find("td p").text();
}
});
site({
name: "wenJuanAutoFill",
match: location.host.includes("wenjuan.com") && location.pathname === "/s/",
root: "questionContent",
elements: {
question: ".title",
options: ".icheckbox_div .option_label",
$options: ".icheckbox_div label",
type: ".question_num"
},
ignore_click: $item => $item.attr("class").includes("checked")
});
site({
name: "学起(考试)",
match: location.pathname.includes("/oxer/page/ots/examIndex.html"),
intv: () => $(".tika_topline").length,
root: ".queItemClass",
elements: {
question: "dt .din:eq(1)",
options: ".clearfix div",
$options: ".clearfix .xuan,input"
},
ignore_click: $item => $item.parent().hasClass("cur"),
wrap: obj => {
obj.plat = 66;
obj.qid = obj.$item.attr("id");
obj.type = qtype(obj.$item.parent().find("div .fb:eq(0)").text());
if (obj.type === 3) {
obj.options = [ "正确", "错误" ];
}
}
});
site({
name: "学起(测试)",
match: location.pathname.includes("/oxer/page/ots/UniversityStart.html"),
intv: () => $(".uniQueList").length,
root: ".uniQueItem",
elements: {
question: ".QueStem",
options: "ul li span",
$options: "ul li"
},
ignore_click: $item => $item.parent().hasClass("lichecked"),
wrap: obj => {
obj.type = qtype(obj.$item.parents(".uniQueList").find(".fir").text());
if (obj.type === 3) {
obj.options = [ "正确", "错误" ];
}
}
});
site({
name: "易班考试",
match: location.host === "exam.yooc.me" && location.pathname.includes("/group"),
intv: () => $(".jsx-3527395752").length,
root: "main:last",
elements: {
question: "h3 div",
options: ".mb ul li .flex-auto",
$options: ".mb ul li",
type: ".mb-s"
},
ignore_click: $item => $item.hasClass("_c"),
fill: (type, answer, $option) => {
if (type === 4 || type === 2) {
$(".exam-input").val("answer");
}
},
finished: need_jump => {
if ($('.round:contains("下一题")').hasClass("ghost")) return false;
$('.round:contains("下一题")').click();
return true;
}
});
site({
name: "英华学堂",
match: () => {
const pathMatch = location.pathname.includes("/user/work") || location.pathname.includes("/user/exam");
const matchHostArr = [ "mooc.kdcnu.com", "mooc.yncjxy.com", "mooc.cdcas.com", "mooc.cqcst.edu.cn", "mooc.kmcc.edu.cn", "mooc.wuhues.com" ];
return pathMatch && matchHostArr.includes(location.host);
},
intv: () => $("#stateName").text().trim() === "进行中",
root: ".courseexamcon-main",
elements: {
question: ".name",
options: ".list li .txt",
$options: ".list li .exam-inp",
type: ".type"
},
ignore_click: $item => $item.prop("checked"),
fill: (type, answer, $option) => {},
finished: auto_jump => {
if ($(".next_exam").eq(3).prop("style")[0] == "display") return false;
$(".next_exam").click();
}
});
site({
name: "厦门在线教育测验",
match: location.pathname.includes("/nec/student/exam/exam-paper!test"),
root: "#paper_form > div:nth-child(4) > table:nth-child(1) > tbody:nth-child(2)>tr:even",
elements: {
question: "td:eq(1)",
options: ".optionUl label .el-radio__label,.el-checkbox__label",
$options: ".optionUl label"
},
wrap: obj => {
obj.options = obj.$item.next().find("tbody:first > tr tbody").map((i, y) => $(y).find("td:eq(1)").text()).toArray();
obj.$options = obj.$item.next().find("tbody:first > tr tbody").map((i, y) => $(y).find("input"));
obj.type = 0;
}
});
site({
name: "金牌学堂",
match: location.host === "www.goldgame.com.cn" && location.href.includes("/TestPage"),
intv: () => $(".tab-btn-box li").length,
root: ".test-type-box ul .white-bg",
elements: {
question: ".position-relative h3",
options: ".test-option label p:last-child",
$options: ".test-option label input"
},
wrap: obj => {
obj.question = obj.question.replace(/题目\d+\:/, "").trim().replace(/^\d+./, "");
obj.type = qtype(obj.$item.parent().parent().find(".test-type-tips").text());
if (obj.$options.length > 2 && obj.$options.eq(0).hasClass("radiobox")) {
obj.type = 0;
}
},
fillFinish: data => {
$(".answer-sheet li").eq(X.index).click();
}
});
site({
name: "青岛开放大学",
match: location.pathname.includes("/pages/exam/exam.html"),
intv: () => $(".exam-content-block .exam-content-topic").length,
root: ".exam-content-block .exam-content-topic",
elements: {
question: ".exam-topic-title",
options: ".exam-topic-answer .layui-unselect span",
$options: ".exam-topic-answer .layui-unselect"
},
wrap: obj => {
obj.type = qtype(obj.$item.parent().find(".exam-content-title .exam-content-num").text());
}
});
site({
name: "点墨考试",
match: location.pathname.includes("/Exam/StartExam"),
root: "#question div div:first",
elements: {
question: "div:first",
options: "div:first ~ div",
$options: "div:first ~ div input"
},
wrap: obj => {
obj.type = qtype($(".alert #groupNameSpan").text());
},
finished: () => {
$(".w-100 .btn-light:eq(1)").click();
return true;
}
});
site({
name: "点墨测验",
match: location.pathname.includes("/Course/TestPaper"),
root: ".question",
elements: {
question: " div div:first div:first",
options: " div div:first div:first ~ div",
$options: " div div:first div:first ~ div input"
},
wrap: obj => {
obj.type = qtype($("h3").text());
obj.question = obj.question.replace(/^\d+\./, "");
}
});
site({
name: "警官学院",
match: location.pathname.includes("/bsmytest/startTi.do"),
root: ".wrapper > div",
elements: {
question: ".dx",
options: "p",
$options: "p input"
},
wrap: obj => {
if ($(".wrapper .cl").length > 0) {
obj.question = obj.$item.text().replace(/[0-9]、/, "").replace(/(.*?)/g, "").trim().split("$")[0].replace(/\(.*?\)/g, "").trim();
} else {
obj.question = obj.question.replace(/[0-9]、/, "").replace(/(.*?)/g, "").trim();
}
obj.type = qtype(obj.$item.parent().find("h2").text());
obj.options = obj.options.map(item => item.replace(/[A-Za-z][:]/, "").replace(/[A-Za-z][:,\:]/, "").replace(/;/, "").trim());
}
});
site({
name: "exam2_euibe_com_exam",
match: location.hostname === "exam2.euibe.com" && location.pathname === "/KaoShi/ShiTiYe.aspx",
root: ".question",
elements: {
question: ".wenti",
options: "li label span",
$options: "li label"
},
wrap: obj => {
obj.type = qtype($(".question_head").text());
},
finished: need_jump => {
$(".paginationjs-next").click();
return true;
}
});
site({
name: "lzwyedu_jijiaool_com_exam",
match: () => {
const pathMatch = location.pathname.includes("/learnspace/course/test/") || location.pathname.includes("/Student/ExamManage/CourseOnlineExamination");
const matchHostArr = [ "lzwyedu.jijiaool.com", "cgjx.jsnu.edu.cn", "learn-cs.icve.com.cn", "nwnu.jijiaool.com", "lut.jijiaool.com", "learn.courshare.cn", "cj1027-kfkc.webtrn.cn" ];
return pathMatch && matchHostArr.includes(location.host);
},
root: ".test_item",
elements: {
question: ".test_item_tit",
options: ".test_item_theme label .zdh_op_con",
$options: "label input"
},
wrap: obj => {
obj.question = obj.question.replace(/该题未做$/, "").replace(/^\d+\./, "").replace(/^\d+、/, "").replace(/[((](\d+\s?(\.\d+)?分)[))]$/, "").replace(/^((\d+.(\s+)?)?)[\[((【](.*?)[】))\]]/, "").trim();
obj.type = qtype(obj.$item.prevAll(".test_item_type:first").text());
if (obj.type === 3) {
obj.options = [ "对", "错" ];
}
}
});
site({
name: "zzx_ouchn_edu_cn_exam",
match: location.hostname === "zzx.ouchn.edu.cn" && location.pathname.includes("/edu/public/student/"),
root: ".subject",
elements: {
question: ".question span",
options: ".answer>span>p:first-child",
$options: ".answer>span>p:first-child"
},
wrap: obj => {
if (obj.$options.length > 1) {
obj.type = 0;
}
}
});
site({
name: "zzx_ouchn_edu_cn_exam",
match: location.hostname === "zzx.ouchn.edu.cn" && location.pathname.includes("/edu/public/student/"),
root: ".subject",
elements: {
question: ".question span",
options: ".answer>span>p:first-child",
$options: ".answer>span>p:first-child"
},
wrap: obj => {
if (obj.$options.length > 1) {
obj.type = 0;
}
}
});
site({
name: "havust_hnscen_cn_exam",
match: location.hostname === "havust.hnscen.cn" && location.pathname.includes("/stuExam/examing/"),
root: ".main .mt_2 > div",
elements: {
question: ".flex_row+div",
options: ".flex_row+div+div .el-radio__label,.el-checkbox__label",
$options: ".flex_row+div+div .el-radio__label,.el-checkbox__label",
type: ".flex_row .mr_2"
}
});
site({
name: "www_zygbxxpt_com_exam",
match: location.hostname === "www.zygbxxpt.com" && location.pathname.includes("/exam"),
root: ".Body",
elements: {
question: ".QName",
options: ".QuestinXuanXiang p:parent",
$options: ".QuestinXuanXiang p:parent",
type: ".QName span"
},
wrap: obj => {
obj.question = obj.question.replace(/\([^\)]*\)/g, "").replace(/【.*?】/g, "");
obj.options = obj.options.map(item => item.split(">").pop().trim());
}
});
site({
name: "xuexi_jsou_cn_work",
match: location.hostname === "xuexi.jsou.cn" && location.pathname.includes("/jxpt-web/student/newHomework/showHomeworkByStatus"),
root: ".insert",
elements: {
question: ".window-title",
options: ".questionId-option .option-title div[style^=display]",
$options: ".questionId-option .option-title .numberCover"
},
wrap: obj => {
obj.type = {
1: 0,
2: 1,
7: 3
}[obj.$item.find(".question-type").val()];
if (obj.options.length == 2) {
obj.type = 3;
}
}
});
site({
name: "czvtc_cjEdu_com_exam",
match: () => {
const pathMatch = location.pathname.includes("/ExamInfo") || location.pathname.includes("/Examination");
const matchHostArr = location.host.includes("cj-edu.com");
return pathMatch && matchHostArr;
},
intv: () => $(".el-container .all_subject>.el-row").length,
root: ".el-container .all_subject>.el-row",
elements: {
question: ".stem div:last-child",
options: ".el-radio-group .el-radio__label,.el-checkbox-group .el-checkbox__label",
$options: ".el-radio-group .el-radio__original,.el-checkbox-group .el-checkbox__original"
},
wrap: obj => {
if (obj.$options.length < 3 && obj.$options.eq(0).attr("type") === "radio") {
obj.type = 3;
} else if (obj.$options.length > 2 && obj.$options.eq(0).attr("type") === "radio") {
obj.type = 0;
} else if (obj.$options.length > 2 && obj.$options.eq(0).attr("type") === "checkbox") {
obj.type = 1;
}
}
});
site({
name: "learning_mhtall_com_exam",
match: location.host.includes("learning.mhtall.com") && location.pathname.includes("/rest/course/exercise/item"),
root: "#div_item",
elements: {
question: ".item_title",
options: ".opt div label",
$options: ".opt div input:not(.button_short)",
type: "h4"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
if (obj.type === 0 || obj.type === 3) {
obj.answer = $(".div_answer").text().match(/[a-zA-Z]/).map(i => obj.options[i.charCodeAt(0) - 65]);
} else if (obj.type === 2) {
obj.answer = $(".div_answer").text().replace("参考答案:", "").split(",");
}
},
fill: (type, answer, $option) => {
if (type === 2 || type === 4) {
$option.val(answer);
$(".DIV_TYPE_BLANK .button_short").click();
}
},
fillFinish: () => {
if ($(".opt+div+div input:eq(1)").val() === "下一题") {
$(".opt+div+div input:eq(1)").click();
} else {
$(".button_short:eq(2)").click();
}
}
});
site({
name: "168网校(测验)",
match: location.host.includes("168wangxiao.com") && location.pathname.includes("/web/learningCenter/details/"),
intv: () => $(".ret-answer").length === 0 && $(".info-container").length,
root: ".question-item-container",
elements: {
question: ".title-content",
options: ".options .opt-content",
$options: ".options label",
type: ".top .type"
}
});
site({
name: "168网校(考试)",
match: location.host.includes("168wangxiao.com") && location.pathname.includes("/web/examination/answer"),
intv: () => $(".Answer-area").length,
root: ".Answer-area",
elements: {
question: ".listTit",
options: ".el-radio__label span:last-child,.el-checkbox__label span:last-child",
$options: ".el-radio__input,.el-checkbox__input input,.ql-editor p"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
if (obj.options.length === 0) {
obj.type = 2;
}
},
fill: (type, answer, $option) => {
if (type === 2 || type === 4) {
document.querySelector(".ql-editor p").textContent = answer;
}
},
finished: () => {
if ($(".ctrl .el-button:contains(下一题)").length != 0) {
$(".ctrl .el-button:contains(下一题)").click();
return true;
} else if ($(".ctrl .el-button:contains(上一题)").length && $(".ctrl button").length === 1) {
return false;
}
}
});
site({
name: "法宣在线",
match: location.host.includes("faxuanyun.com") && location.pathname.includes("/bps/examination"),
intv: () => $("#timucontent").length,
root: "#timucontent",
elements: {
question: "h2",
options: "ul li",
$options: "ul input"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
obj.question = obj.question.replace(/[((].+?[))]/g, "");
if ($(".layui-layer-content").length) {
ui.tip("答题暂停,请自行通过验证", "warn");
$("#lastButton").click();
GM_setValue("xc_paused", true);
return false;
}
},
finished: need_jump => {
if ($("#nextButton").length) {
$("#nextButton").click();
return true;
} else {
return false;
}
}
});
site({
name: "山财培训网 (补考)",
match: location.host.includes("training.sdufe.edu.cn") && location.pathname.includes("/Exam/OnlineExam/"),
intv: () => $(".exam_r_m").length,
root: ".exam_r_m",
elements: {
question: ".bt",
options: ".btm",
$options: ".btm input"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
obj.question = obj.question.replace(/[((].+?[))]/g, "");
obj.options = $("br").parent().text().split(/[A-Z]\./).slice(1).map(item => item.trim());
if (obj.type === 3) {
obj.answer = $("#answerDiv").text().replace("正确答案:", "").split();
} else {
obj.answer = $("#answerDiv").text().match(/[A-Z]/g).map(item => obj.options[item.charCodeAt(0) - 65]);
}
},
finished: () => {
document.querySelector("#next").click();
if (document.querySelector("#noAskCount").textContent == "0") {
return false;
}
return true;
}
});
site({
name: "和学在线",
match: location.host.includes("studentjxjyzx") || location.host.includes("student.hexuezx") || location.host.includes("student.jxjyzx"),
intv: () => $(".el-card__body").length,
root: ".el-card__body",
elements: {
question: ".stem",
options: ".el-radio__label,.el-checkbox__label span",
$options: ".el-radio__input,.el-checkbox__input input"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
obj.question = obj.question.replace(/[((].+?[))]/g, "");
}
});
site({
name: "高教在线",
match: location.host === "www.cqooc.com" && (location.href.includes("/learn/mooc/exam/do") || location.href.includes("/learn/mooc/testing/do")),
intv: () => $("#test-form").length,
root: "#test-form .cat",
elements: {
question: ".stem",
options: ".option label",
$options: ".option input"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
obj.question = obj.question.replace(/\(\d+分\)\d+\.\d+/, "");
}
});
site({
name: "考试平台",
match: location.pathname.includes("/kaoshi_qnzzxy/kaoshi.html"),
intv: () => $(".form-group").length,
root: ".form-group",
elements: {
question: ".row-fluid",
options: ".option",
$options: ".option input"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
obj.type = qtype(obj.$item.parent().find("div:first").text());
obj.options = obj.options.map(i => fmt(i.replaceAll(/[a-zA-z]:\s+/g, "").replaceAll(/^[a-z]\s+/g, "").replaceAll(/^[a-z]、\s+/g, "").trim()));
}
});
site({
name: "柠檬文才(考试)",
match: () => {
const pathMatch = location.pathname.includes("/separation/exam/");
const matchHostArr = [ "learning.wuxuejiaoyu.cn", "learning.wencaischool.net", "learning.zk211.com", "study.wencaischool.net", "www.wencaischool.net" ];
return pathMatch && matchHostArr.includes(location.host);
},
intv: () => $("#paperExam").css("display") != "none",
root: ".paperWrapper .tmList",
elements: {
question: ".tmTitleTxt",
options: ".ansbox .opCont",
$options: ".ansbox input"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
if (obj.options.length === 0) {
obj.type = 2;
}
},
fill: (type, answer, $option) => {
if (type === 4 || type === 2) {
$option.val(answer);
}
}
});
site({
name: "柠檬文才独立考试",
match: () => {
const pathMatch = location.hash.includes("/exam?studentId");
const matchHostArr = [ "exam.wencaischool.net" ];
return pathMatch && matchHostArr.includes(location.host);
},
intv: () => $("#paperExam").css("display") != "none" && $(".timenum").length,
root: ".paperWrapper .tmList .tmc",
elements: {
question: ".tmTitleTxt",
options: ".ansbox .opCont",
$options: ".ansbox input"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
if (obj.options.length === 0) {
obj.type = 2;
}
},
fill: (type, answer, $option) => {
if (type === 4 || type === 2) {
$option.val(answer);
}
}
});
site({
name: "柠檬文才(作业)",
match: () => {
const matchHostArr = [ "learning.wuxuejiaoyu.cn", "learning.wencaischool.net", "learning.zk211.com", "study.wencaischool.net" ];
return (location.pathname.includes("/hblearning/exam/") || location.pathname.includes("/xbsflearning/exam/") || location.pathname.includes("/openlearning/exam/") || location.pathname.includes("/jxlearning/exam/") || location.pathname.includes("/shandonglearning/exam")) && matchHostArr.includes(location.host);
},
intv: () => $("#paperExam").css("display") !== "none",
root: "#_block_content_exam #tblDataList>tbody>tr",
elements: {
question: "tbody:first>tr>td:last table",
options: ".ansbox .opCont",
$options: ".ansbox input"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
obj.question = $("#_block_content_exam #tblDataList>tbody>tr>td").find(" tbody:first>tr>td:last table:first").eq(X.index - 1).find("tr:first").text();
obj.options = [];
$("#_block_content_exam #tblDataList>tbody>tr>td").find(" tbody:first>tr>td:last table:first").eq(X.index - 1).find("tr:first").next().find("label").map((i, y) => {
obj.options.push($(y).text());
});
obj.$options = $("#_block_content_exam #tblDataList>tbody>tr>td").find(" tbody:first>tr>td:last table:first").eq(X.index - 1).find("tr:first").next().find("input").map((i, y) => y);
obj.type = 0;
if (obj.options.length == 2) {
obj.type = 3;
} else if (obj.$options.eq(0).attr("type") != "radio") {
obj.type = 1;
}
}
});
site({
name: "福建师范",
match: location.host === "neo.fjnu.cn" && location.pathname.includes("/resource/index"),
intv: () => $(".content").length && !$(".answer-content").length,
root: ".content",
elements: {
question: ".title",
options: "label .el-radio__label,.el-checkbox__label",
$options: "label input"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
}
});
site({
name: "优课学堂",
match: location.host.includes("youkexuetang.cn") && location.pathname.includes("/student/"),
intv: () => $(".paperItemBox").length,
root: ".paperItemBox",
elements: {
question: ".stem",
options: ".el-radio__label,.el-checkbox__label",
$options: ".el-radio__input,.el-checkbox__input input"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
obj.question = obj.question.replace(/[((].+?[))]/g, "");
}
});
site({
name: "亿学宝云考试",
match: location.host.includes("yxbyun.com") && location.href.includes("/exam"),
intv: () => $(".datiqu").length,
hook: () => {
hookJSON(o => {
if (o?.data?.sjSjRespDto?.sjDtSaveReqVOS) {
X.json = parseYxbyunExam(o?.data?.sjSjRespDto?.sjDtSaveReqVOS).reduce((acc, cur) => acc.concat(cur), []);
}
});
},
root: ".danxuan",
elements: {
question: ".tm",
options: ".xuanxiang .xxnr",
$options: ".xuanxiang .xxbh",
type: ".tx"
},
wrap: obj => {
Object.assign(obj, X.json[X.index - 1]);
},
ignore_click: $item => $item.prop("checked")
});
site({
name: "亿学宝云",
match: location.host.includes("yxbyun.com") && location.hash.includes("/testPaper"),
intv: () => $(".time_header").length || $(".pager_wrap").length,
hook: () => {
hookJSON(o => {
if (o.data && o.data.bigContent) {
X.json = parseYxbyunTest(o.data.bigContent).reduce((acc, cur) => acc.concat(cur), []);
}
});
},
root: ".test",
elements: {
question: ".type",
options: ".el-radio-group,.el-checkbox-group label",
$options: ".el-radio__input,.el-checkbox__input input",
type: ".el-tag"
},
wrap: obj => {
Object.assign(obj, X.json[X.index - 1]);
},
ignore_click: $item => $item.prop("checked")
});
site({
name: "考试星(单题)",
match: Boolean(location.host === "exam.kaoshixing.com" && location.pathname.includes("/exam/exam_start")),
intv: () => $("#nextQuestions").length,
root: ".questions .questions-content",
elements: {
question: ".question-name",
options: ".answers label .words",
$options: ".answers label"
},
ignore_click: $item => $item.parent().find("input").prop("checked"),
wrap: obj => {
obj.question = obj.question.replace(/[((].+?[))]/g, "");
},
finished: () => {
if ($("#nextQuestions:contains(下一题)").length && $("#nextQuestions").css("display") !== "none") {
$("#nextQuestions:contains(下一题)").click();
return true;
} else {
return false;
}
}
});
site({
name: "易考云",
match: location.host === "exam.beeouc.com" && location.pathname.includes("/client"),
intv: () => $(".question-body").length,
root: ".question-body",
elements: {
question: ".question-stem",
options: ".question-option label",
$options: ".question-option input",
type: ".question-type"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
},
finished: () => {
if ($(".question-footer button:contains(下一题)").length) {
$(".question-footer button:contains(下一题)").click();
return true;
} else {
return false;
}
}
});
site({
name: "伊犁师范成人教育",
match: location.pathname.includes("/learn/NewExam") || location.pathname.includes("//GeneralTestPaper/Testing/") || location.pathname.includes("//GeneralTestPaper/SNTesting"),
intv: () => $(".topic").length,
root: ".topic",
elements: {
question: ".qsctt",
options: ".xuan li",
$options: ".choice input"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
obj.options = obj.options.map(i => i.replace(/^[A-Z] \. /, ""));
if (obj.$options.length == 2) {
obj.options = [ "正确", "错误" ];
obj.type = 3;
}
}
});
site({
name: "绎通云课堂 (作业)",
match: location.host.includes("ytccr.com") && (location.hash.includes("#/learning-work") || location.hash.includes("#/learning-details")),
intv: () => $(".left-question").length,
root: ".border-item",
elements: {
question: ".qa-title",
options: "label .opt-title-cnt",
$options: "label input"
},
ignore_click: $item => $item.prop("checked")
});
site({
name: "重庆大学网络教育学院 (作业)",
match: location.host === "exercise.5any.com" && location.pathname.includes("/Exercise/WebUI/Test/Answer"),
intv: () => $(".examtime-content").length,
root: ".subject .font-16",
elements: {
question: ".stem .richtextcontent",
options: ".option .richtextcontent",
$options: ".option label input"
},
ignore_click: $item => $item.prop("checked")
});
site({
name: "毕节幼儿师范",
match: location.host === "px.gzbjyzjxjy.cn" || location.host === "px.ggcjxjy.cn" && location.pathname.includes("/exam/shiti/dopapers"),
intv: () => $(".panel-body").length,
root: ".panel-body>div",
elements: {
question: ".testpaper-question-stem",
options: ".testpaper-question-choices li",
$options: ".testpaper-question-footer input"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
}
});
site({
name: "贵州继续教育",
match: location.host === "www.gzjxjy.gzsrs.cn" && location.pathname.includes("/personback/"),
intv: () => $(".question-title").length,
root: ".question-title",
elements: {
question: ".show-text",
options: "label",
$options: "label input"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
}
});
site({
name: "和学自考",
match: location.host === "zkpt.qdu.edu.cn" && location.pathname.includes("/examStu/exam/examPaper"),
intv: () => $(".ant-spin-container").length,
root: ".ant-row",
elements: {
options: "label",
$options: "label input"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
obj.question = obj.$item.parent().parent().prev().text();
}
});
site({
name: "专技天下",
match: location.host.includes("zgzjzj.com") && location.pathname.includes("/examination/perpar.html"),
intv: () => $(".question_index").length,
root: ".question_index",
elements: {
question: "p",
options: ".options li p,li>span:last-child",
$options: ".options li",
type: "p span"
},
ignore_click: $item => $item.hasClass("active")
});
site({
name: "睿学补考",
match: location.href.includes("exam-app-exam-paper") && location.host.includes("ks.hustsnde.com"),
intv: () => $("#paper").length,
root: "#paper .content-box",
elements: {
question: "ul li:eq(0) .desc",
options: "ul li:eq(1)",
$options: "ul label input",
type: ".title"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
const options = obj.options[0].trim().split(/\[[A-Z]:?\]/).splice(1).map(i => i.trim()).filter(i => i);
if (options.length === 0) {
obj.options = obj.options[0].trim().split(/\(?[A-Z\.?]\)?/).splice(1).map(i => i.trim()).filter(i => i);
} else {
obj.options = options;
}
if (obj.type === 3) {
obj.options = [ "正确", "错误" ];
}
}
});
site({
name: "云上河开",
match: location.host === "jx.open.ha.cn" && location.pathname.includes("/jxpt-web/student/homework/showHomeworkByStatus"),
intv: () => $("#shiti-content").length,
root: ".insert",
elements: {
question: ".window-title",
options: "ul li div:last-child",
$options: "ul li .numberCover"
},
ignore_click: $item => $item.parent().hasClass("answer-title"),
wrap: obj => {
obj.type = qtype(obj.$item.parents(".layui-colla-item").find(".titleType").text());
}
});
site({
name: "ycjy.lut.edu.cn",
match: location.host === "ycjy.lut.edu.cn" && location.pathname.includes("/learnspace/course/test/coursewareTest_intoTestPage.action"),
intv: () => $(".bank_cont").length,
root: ".test_item",
elements: {
options: "label",
$options: "label input"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
obj.type = qtype(obj.$item.parent().find(".test_item_type").text());
obj.question = obj.$item.find(".test_item_tit").contents()[0].nodeValue.trim();
}
});
site({
name: "exam.euibe.com",
match: location.host === "exam.euibe.com" && location.pathname.includes("/KaoShi/ShiTiYe.aspx"),
intv: () => $(".question_list").length,
root: ".question",
elements: {
question: ".wenti .stem",
options: "label span",
$options: "label input"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
obj.type = qtype(obj.$item.parents(".question_list").find(".question_head").text());
},
finished: need_jump => {
if ($(".paginationjs-next").hasClass("disabled")) {
return false;
}
$(".paginationjs-next").click();
return true;
}
});
site({
name: "学晖教育",
match: location.host === "xhjy.ldzxjy.com" && location.pathname.includes("tikuUserBatch/keepTopic"),
intv: () => $(".radio").length,
root: ".radio",
elements: {
question: ".issueTitle",
options: "ul li span",
$options: "ul li",
type: ".issueTypes"
},
ignore_click: $item => $item.prop("checked"),
finished: need_jump => {
if ($(".next").text().includes("交卷")) {
return false;
}
$(".next").click();
return true;
}
});
site({
name: "东财在线",
match: location.host === "classroom.edufe.com.cn" && (location.pathname.includes("/PracticePaper") || location.pathname.includes("/HomeWorkPaper")),
intv: () => $(".TK-main").length,
root: ".CBTPaperMain-trunk",
elements: {
question: ".CBTPaperMain-divInline",
options: "ul li label",
$options: "ul li label"
},
ignore_click: $item => $item.hasClass("_CheckBox_checked")
});
site({
name: "北华大学在线教育",
match: () => {
const pathnameArr = [ "cj1026-kfkc.webtrn.cn", "beihua.peishenjy.com" ];
return pathnameArr.includes(location.pathname) && location.pathname.includes("/Learning/CourseOnlineExamination") || location.pathname.includes("/learnspace/course/test");
},
intv: () => $(".s_mi").length,
root: ".test_item",
elements: {
question: ".test_item_tit",
options: " label",
$options: "label input"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
}
});
site({
name: "上海立达学院",
match: location.host === "kkzxsx.lidapoly.edu.cn" && location.pathname.includes("/exam/"),
intv: () => $(".exam-question").length,
root: ".main .item",
elements: {
question: ".text",
options: ".options label .el-radio__label,.el-checkbox__label",
$options: ".options label"
},
ignore_click: $item => $item.hasClass("is-checked"),
wrap: obj => {
obj.type = qtype(obj.$item.parent().find(".text").text());
}
});
site({
name: "石家庄科技继续教育",
match: location.host.includes("kc.jxjypt.cn") && location.pathname.includes("/paper/start"),
intv: () => $(".sub-content").length,
root: ".sub-content",
elements: {
question: ".sub-dotitle",
options: ".sub-answer dd",
$options: ".sub-answer dd,.mater-respond textarea",
type: ".sub-dotitle i"
},
ignore_click: $item => $item.hasClass("cho-this"),
wrap: obj => {
},
fill: (type, answer, $option) => {
if (type === 4) {
$option.val(answer);
}
}
});
site({
name: "石家庄理工职业学院",
match: location.host.includes("edu.tianzerencai.com") && location.pathname.includes("/examinationDetail"),
intv: () => $(".topic").length,
root: ".topic",
elements: {
question: ".title",
options: ".main",
$options: ".main",
type: ".title"
},
ignore_click: $item => $item.hasClass("cho-this"),
wrap: obj => {
if (obj.type === 3) {
obj.options = [ "正确", "错误" ];
obj.$options = obj.$item.find(".judge button");
} else if (obj.type === 1) {
obj.options = obj.$item.find(".checkbox .option_text").map((i, y) => $(y).text()).toArray();
obj.$options = obj.$item.find(".checkbox button");
} else if (obj.type === 0) {
obj.options = obj.$item.find(".radio .option_text").map((i, y) => $(y).text()).toArray();
obj.$options = obj.$item.find(".radio button");
}
}
});
site({
name: "国开军盾",
match: location.host.includes("s.jundunxueyuan.com") && location.hash.includes("#/exam/"),
intv: () => $(".the-paper .section-item-question-item").length,
root: ".section-item-question-item",
elements: {
plat: 43,
question: ".question-tit",
options: ".el-radio-group label,.el-checkbox-group label",
$options: ".el-radio-group input,.el-checkbox-group input",
type: ".sub-dotitle i"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
obj.type = qtype(obj.$item.parents(".section-item").find(".section-item-tit").text());
}
});
site({
name: "博学bx",
match: location.host.includes("bx.bossyun.com") && location.pathname.includes("/bx/study/examine"),
intv: () => $(".question-list").length,
root: ".question-list",
elements: {
question: ".title",
options: ".ant-radio-group label,.ant-checkbox-group label",
$options: ".ant-radio-group input,.ant-checkbox-group input",
type: ".tag"
},
ignore_click: $item => $item.prop("checked")
});
site({
name: "博学bx",
match: location.host.includes("bx.bossyun.com") && location.pathname.includes("/bx/study/examine"),
intv: () => $(".question-list").length,
root: ".question-list",
elements: {
question: ".title",
options: ".ant-radio-group label,.ant-checkbox-group label",
$options: ".ant-radio-group input,.ant-checkbox-group input",
type: ".tag"
},
ignore_click: $item => $item.prop("checked")
});
site({
name: "电中在线",
match: location.host.includes("old-zzx.ouchn.edu.cn") && location.pathname.includes("/edu/public/student/"),
intv: () => $(".subject").length,
root: ".subject",
elements: {
question: ".question",
options: ".answer .option-name",
$options: ".answer"
},
wrap: obj => {
obj.type = 0;
}
});
site({
name: "爱学",
match: () => {
const pathMatch = location.pathname.includes("/Web/Test/doing");
const matchHostArr = [ "ai.ztbu.edu.cn", "www.51ixuejiao.com" ];
return pathMatch && matchHostArr.includes(location.host);
},
intv: () => $("card-title").length,
root: ".exam dd",
elements: {
question: "card-title",
options: ".ans_area div",
$options: ".ans_area div",
type: "info"
},
ignore_click: $item => $item.attr("selected") === "selected",
wrap: obj => {
},
fillFinish: data => {
if (data.ans.includes("span") || data.type === 1) {
$(".move_btn span:last").click();
}
}
});
site({
name: "人卫智网",
match: location.host.includes("exam.ipmph.com") && location.pathname.includes("/front/myschool/index.html"),
intv: () => $(".body").length,
root: ".body",
elements: {
question: ".fch2 font",
options: ".selet .el-radio__label",
$options: ".selet input"
},
wrap: obj => {
obj.type = 0;
},
finished: () => {
if (document.querySelector(".el-message-box__btns")) return false;
document.querySelector("#next_btn").click();
return true;
}
});
site({
name: "卫生人力资源系统",
match: location.host.includes("vgos.zbwsrc.cn") && location.pathname.includes("/TESExamClient/"),
intv: () => $(".testitem").length,
root: ".testitem",
elements: {
question: ".stem",
options: ".inputitem li",
$options: ".inputitem input"
},
wrap: obj => {
obj.type = 0;
}
});
site({
name: "继教在线(考试)",
match: location.pathname.includes("/Student/ExamManage/CourseOnlineExamination"),
intv: () => $(".test_item").length,
root: ".test_item",
elements: {
question: ".test_item_tit",
options: ".test_item_theme label",
$options: ".test_item_theme input"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
const $item = obj.$item;
obj.type = qtype($item.prevAll(".test_item_type").text());
if (obj.type === 3) {
obj.options = [ "正确", "错误" ];
}
}
});
site({
name: "培训系统(考试)",
match: location.pathname.includes("ShowItemView"),
intv: () => $(".choice-interaction").length,
root: ".choice-interaction",
elements: {
question: ".select-clickstyle span",
options: ".text-simple-choice .text",
$options: ".text-simple-choice input",
type: ".item-content"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
const $item = obj.$item;
obj.type = qtype($item.parent().prevAll(".item-content").text());
},
finished: () => {
window.parent.document.querySelector(".nextBtn").click();
}
});
site({
name: "传媒(考试)",
match: location.pathname.includes("/Exam/onlineTest/ShiTiYe.aspx"),
intv: () => $("#Content").length,
root: ".ShiTi",
elements: {
question: ".Paper_ParentQuestionDesc",
options: ".Paper_Answer li",
$options: ".Paper_Answer input"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
const $item = obj.$item;
obj.type = qtype($item.parents("#ContentText").find("#ExamFrameQuesDesc").text());
},
finished: () => {
window.parent.document.querySelector("#btnNext").click();
}
});
site({
name: "慧考试",
match: location.pathname.includes("/examSystemPCInner/"),
intv: () => $(".question-list-box").length,
root: ".question-list-box > div",
elements: {
question: ".topic-title",
options: ".option_list",
$options: ".option_list ",
type: ".question-type-name"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
}
});
site({
name: "河北开放",
match: location.pathname.includes("/exam/") && location.host === "lms.cjzx.hblll.com",
intv: () => $(".loading-gif").hasClass("ng-hide") && $(".hd .examinee .submit-label").eq(0).text() === "",
root: ".card ol .single_selection,.multiple_selection,.true_or_false,.short_answer",
elements: {
question: ".summary-title .subject-description",
options: ".subject-options li .option-content",
$options: ".subject-options label .left",
type: ".summary-sub-title span:eq(0)"
},
ignore_click: ($item, type) => type === 1 && $item.find("input").hasClass("ng-not-empty")
});
site({
name: "自考365",
match: location.host === "member.zikao365.com" && location.pathname.includes("generaltest/exam.shtm"),
intv: () => $(".timu").length,
root: ".timu",
elements: {
question: ".timu-tit",
options: ".timu-list .list",
$options: ".timu-list input"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
}
});
site({
name: "幕享",
match: location.host === "web.moycp.com" && location.pathname.includes("/study"),
intv: () => $(".question-list").length,
root: ".question-list",
elements: {
question: ".question-title",
options: ".answer-option label",
$options: ".answer-option input",
type: ".singleflag"
},
ignore_click: ($item, type) => {
if (type === 1) {
return $item.prop("checked");
}
},
wrap: obj => {
},
fillFinish: data => {
if (data.style === "warning-row" || data.type === 1) {
$(".next-submit .next").click();
}
},
finished: () => {
if ($(".next-submit .next").hasClass("noClick")) {
return false;
}
return true;
}
});
site({
name: "麦能",
match: location.pathname.includes("/lms/web/onlineexam/exambegin"),
intv: () => $(".sdiv").length,
root: ".sdiv",
elements: {
question: ".eptimu_name",
options: ".ansdiv div",
$options: ".ansdiv input",
type: ".eptimu_title"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
},
fillFinish: () => {
if ($(".layui-layer").length) {
return false;
}
$(".eptimu_btn_next:eq(0)").click();
return true;
}
});
site({
name: "天使在线",
match: location.pathname.includes("/pages_jsp/mobile/courseSimulate.html") || location.pathname.includes("/pages_jsp/mobile/coursExamView.html") || location.pathname.includes("/pages_jsp/mobile/courseAnswer.html"),
intv: () => $("#qusData").length,
root: ".neixunExamQuestionHead",
elements: {
question: "#title",
options: ".option",
$options: ".option",
type: ".tag"
},
wrap: obj => {
},
fillFinish: () => {
if ($(".next").attr("style") && $(".next").attr("style").includes("display")) {
return false;
}
$(".next").click();
return true;
}
});
site({
name: "江西应用",
match: location.pathname.includes("examinationAnswer"),
intv: () => $(".answer-subject-details").length,
root: ".answer-subject-details",
elements: {
question: ".answer-subject",
options: "ul li p",
$options: "ul li",
type: ".answer-subject-top"
},
wrap: obj => {
}
});
site({
name: "在线学习平台",
match: location.host === "edu.netdig.cn" && location.pathname.includes("/paper.html"),
intv: () => $(".test-list").length,
root: ".position-relative",
elements: {
question: ".tmtitle-p",
options: "label .span-inline",
$options: "label input",
type: ".customtktype"
},
wrap: obj => {
}
});
site({
name: "含弘",
match: location.host === "zuoye.eduwest.com" && location.pathname.includes("/examinationrecord"),
intv: () => $("#float_right").length,
root: "tr td table:has(a)",
elements: {
question: "td:first",
options: "a",
$options: "input"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
},
finished: () => {
if ($("#button #next").length != 0) {
$("#button #next").click();
return true;
} else {
return false;
}
}
});
site({
name: "华莘学堂",
match: location.host.includes("huashenxt.com") && location.pathname.includes("/mgr.html"),
intv: () => $(".terms .question-item").length,
root: ".question-item",
elements: {
question: ".question_title .text",
options: ".choice_item .text,.judge_item label",
$options: ".choice_item .choice_option,.judge_item input",
type: ".question_type"
},
ignore_click: $item => $item.hasClass("selected"),
wrap: obj => {
}
});
site({
name: "春风雨",
match: location.host.includes(".cfyedu.com"),
intv: () => $(".answer").length,
root: ".el-col-16 div[id]",
elements: {
question: ".title",
options: ".radio-option",
$options: ".radio-option"
},
wrap: obj => {
obj.type = qtype(obj.$item.parent().find(".content-title").text());
}
});
site({
name: "心理健康",
match: location.host.includes("zgxlwsxh.oxcoder.com.cn"),
intv: () => $(".question-box").length,
root: ".question-container",
elements: {
question: ".question-box .ques-desc-content",
options: ".question-box label",
$options: ".question-box label input",
type: ".directory-title"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
obj.question = obj.question.replace(/\(\d+分\)/, "");
},
finished: need_jump => {
if ($(".ant-btn-circle:last").hasClass("disabled")) {
return false;
}
$(".ant-btn-circle:last").click();
return true;
}
});
site({
name: "西安交通大学",
match: location.host.includes("kj.xjtudlc.com"),
intv: () => $(".swiper-wrapper").length,
root: ".swiper-slide",
elements: {
question: ".layui-space-item .question",
options: ".layui-checkcard-desc",
$options: ".layui-checkcard-desc",
type: ".layui-space-item:first"
},
ignore_click: $item => $item.parents(".layui-checkcard").hasClass("layui-checkcard-checked"),
wrap: obj => {
obj.question = obj.question.replace(/\(\d+分\)/, "");
}
});
site({
name: "文鼎省考练习",
match: location.host.includes("www.iwdjy.com") && location.href.includes("guochengxing-tongkao-shuati"),
intv: () => $(".is-justify-center").length,
root: ".is-justify-center",
elements: {
question: ".clearfix div div:last",
options: ".el-card__body label",
$options: ".el-card__body input",
type: ".clearfix div div:first"
},
ignore_click: $item => $item.parents(".layui-checkcard").hasClass("layui-checkcard-checked"),
wrap: obj => {
obj.question = obj.question.replace(/\(\d+分\)/, "");
},
fillFinish: () => {
if ($(".right_answer").length) {
return false;
}
$(".nextExam").click();
return true;
},
finished: need_jump => {
if ($('.nextExam:contains("下一题")').length === 0) return false;
$('.nextExam:contains("下一题")').click();
return true;
}
});
site({
name: "国开",
match: location.host === "lms.ouchn.cn" && location.pathname.includes("/exam/"),
intv: () => $(".loading-gif").hasClass("ng-hide") && $(".hd .examinee .submit-label").eq(0).text() === "",
root: ".card ol .single_selection,.multiple_selection,.true_or_false,.short_answer",
elements: {
question: ".summary-title .subject-description",
options: ".subject-options li .option-content",
$options: ".subject-options label .left",
type: ".summary-sub-title span:eq(0)"
},
ignore_click: ($item, type) => type === 1 && $item.find("input").hasClass("ng-not-empty")
});
site({
name: "广开",
match: () => {
const pathMatch = location.pathname.includes("/mod/quiz/attempt.php");
const matchHostArr = [ "moodle.syxy.ouchn.cn", "xczxzdbf.moodle.qwbx.ouchn.cn", "elearning.bjou.edu.cn", "whkpc.hnqtyq.cn:5678", "course.ougd.cn", "study.ouchn.cn" ];
return pathMatch && matchHostArr.includes(location.host);
},
root: ".que",
elements: {
question: ".qtext",
options: ".answer div label,.flex-fill",
$options: ".answer div input:visible"
},
wrap: data => {
if (data.type === undefined) {
try {
data.type = 4;
data.$item.find(".qtext .accesshide").remove();
data.question = fmt(data.$item.find(".qtext").html());
data.$options = data.$item.find("input[id$=_answer]");
} catch (e) {}
}
},
ignore_click: $item => Boolean($item.parent().find("input").eq(-1).prop("checked")),
finished: () => {
$(".submitbtns .btn-primary").click();
},
fill: (type, answer, $option) => {
if (type === 4) {
$option.val(answer);
}
}
});
site({
name: "保定继续教育",
match: location.pathname.includes("/exam/answer.html"),
root: ".stem-container",
elements: {
question: ".stem span",
options: ".option div .optStem",
$options: ".option div input"
},
intv: () => $("#question").length,
wrap: obj => {
obj.type = qtype(obj.$item.parent().parent().find(".description").text());
}
});
site({
name: "noNiExam.js",
match: location.pathname === "/app-afstudy/self_test.html",
root: ".lineClass .b-papp-root",
elements: {
question: ".b-exam-top .b-exam-tit",
options: ".b-exam-box li label",
$options: ".b-exam-box li input",
type: ".b-exam-top .b-exam-type"
},
ignore_click($item) {
return $item.prop("checked");
},
wrap(obj) {
obj.options = obj.options.map(i => i.replace(/[A-Za-z][:]/, "").replace(/[A-Za-z][:,\:]/, "").replace(/;/, "").trim());
}
});
site({
name: "www_pbaqks_com_text",
match: location.host === "www.pbaqks.com" && location.pathname.includes("/P_ExamDetail/OnlineStuday"),
root: ".main-container .single-box",
elements: {
question: ".single-main:first",
options: ".choose-box label",
$options: ".choose-box label",
type: ".single-container .font-title",
answer: "input:eq(1)"
},
ignore_click: $i => $i.find("input").is(":checked"),
wrap: obj => {
obj.question = obj.question.replace("标准答案", "").replace(/^\d+\./, "").replace(/\[.+?\]/g, "").trim();
},
fillFinish: () => {
if ($(".main-container .single-box").find("input:eq(1)").eq(X.index - 1).attr("value").split("").length > 1) {
jQuery(".main-container .confirm a:last-child").click();
}
}
});
site({
name: "安徽继续教育",
match: location.pathname.includes("/study/html/content/studying/") || (location.pathname === "/study/html/content/tkOnline/" || location.pathname === "/study/html/content/sxsk/" || location.pathname === "/study/html/content/bkExam/"),
intv: () => ($(".e-save-b").length || $(".e-b-g").length) && $(".totalscore").length === 0,
root: ".e-q",
elements: {
question: ".e-q-q .ErichText",
options: ".e-a-g li",
$options: ".e-a-g li"
},
ignore_click: $item => $item.attr("class").includes("checked"),
wrap: obj => {
obj.type = qtype(obj.$item.parent().prev().find(".e-text").text());
obj.options = obj.options.map(i => fmt(i.replaceAll(/^[ab]\)\s+/g, "").replaceAll(/^[a-z]\s+/g, "").replaceAll(/^[a-z]、\s+/g, "").trim()));
}
});
site({
name: "安徽继续教育新版",
match: location.pathname.includes("/app/noFrame/jxjy-student-space-web"),
intv: () => $(".yu_title").length,
root: ".container",
elements: {
question: ".content-title",
options: ".option-item",
$options: "li",
type: ".topic_type"
},
finished: () => {
$(".operate_bottom").click();
return $(".operate_bottom").attr("class").includes("enable_tip");
}
});
site({
name: "大连/九江",
match: location.href.includes("/onlineclass/exam/"),
intv: () => $(".excer_list_view___2Ahg9") || $(".excer_list_view___YOSCa"),
root: ".single_excer_item___lFMCm,.single_excer_item___2lGB8",
elements: {
plat: 40,
question: ".title_content___1Qagx .title_content_text___27NIL, .title_content___24J6D .title_content_text___8ruL4",
options: ".options_content___nXSwG label .option_text___udjiE, .options_content___2YgyG label .option_text___1mfcu",
$options: ".options_content___nXSwG label input,.options_content___2YgyG label input",
type: ".title_content___1Qagx span:eq(1),.title_content___24J6D span:eq(1)"
},
ignore_click: $item => $($item).parent().hasClass("ant-checkbox-checked"),
wrap: obj => {
},
fill: (type, answer, $option) => {
if (type === 4 || type === 2) {
$option.val(answer);
}
}
});
site({
name: "新疆继续教育",
hook: () => {
function parseXinJiangAgain(questions) {
return questions.map(item => {
const answer = [];
const options = item.answers.map(opt => {
if (opt.isAnswer === "0") answer.push(fmt(opt.name));
return fmt(opt.name);
});
const type = item.types === "2" ? 3 : parseInt(item.types);
return {
question: item.name,
options: options,
answer: answer,
type: type
};
});
}
hookJSON(o => {
if (o.success && o.data.exam) {
const arr = o.data.exam.assessList.map(i => i.questionList).flat();
X.json = parseXinJiangAgain(arr);
}
});
},
match: location.host === "www.ttcdw.cn" && location.pathname.includes("/p/uExam/goExam/"),
root: ".question-item",
elements: {
question: ".question-item-title span",
options: ".question-item-option label .el-checkbox__label,.el-radio__label",
$options: ".question-item-option label"
},
wrap: obj => {
Object.assign(obj, X.json[X.index - 1]);
},
intv: () => !$("div").hasClass("entrying-wrap"),
ignore_click: $item => $item.hasClass("is-checked"),
fill: (type, answer, $option) => {
if (type === 4 || type === 2) {
$option.val(answer);
}
}
});
site({
name: "华侨继续教育",
match: location.pathname.includes("/exam/student/exam/resource/paper_card2"),
intv: () => $(".ui-question-answer-right").length === 0,
root: ".ui-question-group .ui-question",
elements: {
question: ".ui-question-title div",
options: ".ui-question-options div",
$options: ".ui-question-options .ui-question-options-order,.ke-container"
},
wrap: obj => {
obj.type = qtype(obj.$item.parent().find("h2").text());
},
ignore_click: $item => $item.parent().hasClass("ui-option-selected"),
fill: (type, answer) => {
if (type === 4 || type === 2 || type === 6) {
const x = X.index - $(".ui-question-options ").length - 1;
W.KindEditor.instances[x].html(answer);
}
}
});
site({
name: "上海开放大学",
match: location.pathname.includes("/study/assignment/preview.aspx") || location.pathname.includes("/study/assignment/continuation.aspx"),
hook: () => {
if (X.finish || $("a:contains(已完成批阅)").length === 1) {
ui.tip("本页面已做完,无需自动答题", "warn");
return true;
}
},
root: ".e-q",
elements: {
question: ".e-q-q .ErichText",
options: ".e-a-g li",
$options: ".e-a-g li"
},
wrap: obj => {
obj.type = qtype(obj.$item.parent().parent().parent().find(".e-text").eq(0).text());
obj.options = obj.options.map(i => fmt(i.replaceAll(/[a-zA-z]\)\s+/g, "").replaceAll(/^[a-z]\s+/g, "").replaceAll(/^[a-z]、\s+/g, "").trim()));
},
ignore_click: $item => $item.attr("class").includes("checked")
});
site({
name: "浙江考试",
match: location.pathname === "/web-qz/moni/exam/exam_toExam.action",
root: ".dt_tmcon",
elements: {
question: "div:eq(0) span:eq(1)",
options: "div:eq(1) p",
$options: "div:eq(1) p input"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
obj.type = qtype(obj.$item.parents().find(".dt_rtitle1").eq(0).text());
obj.options = obj.options.map(i => fmt(i.replaceAll(/[a-zA-z]\)\s+/g, "").replaceAll(/^[a-z]\s+/g, "").replaceAll(/^[a-z]、\s+/g, "").trim()));
if (obj.type === 0) {
obj.answer = [ JSON.parse($("#quesSSForm #userAnssStr_0").val()).rightAnswer ];
}
},
finished: () => $(".page li input:eq(2)").attr("disabled") !== "disabled",
fillFinish: () => {
$(".page li input:eq(2)").click();
}
});
site({
name: "在浙学考试",
match: location.host === "www.zjooc.cn" && (location.pathname.includes("/homework/") || location.pathname.includes("/test/") || location.pathname.includes("/exam/")),
hook: () => {
function parseZaiZheXue(problems) {
return problems.map(item => {
if (!item.rightAnswer) return undefined;
const subjectType = item.subjectType;
let type = -1;
const question = fmt(item.subjectName);
const answer = [];
const options = [];
if (subjectType === 1 || subjectType === 2) {
type = subjectType - 1;
for (let subjectOption of item.subjectOptions) {
const opt = fmt(subjectOption.optionContent);
options.push(opt);
if (item.rightAnswer.includes(subjectOption.optionHead)) {
answer.push(opt);
}
}
} else if (subjectType === 3) {
type = 3;
answer.push(item.rightAnswer === "yes" ? "正确" : "错误");
} else {
return undefined;
}
return {
question: question,
options: options,
type: type,
answer: answer
};
}).filter(i => i && i.answer.length > 0);
}
if (!(location.pathname.includes("/homework/do") || location.pathname.includes("/test/do") || location.pathname.includes("/exam/do"))) {
hookJSON(o => {
if (o.data && o.data.paperName && o.data.clazzIds && o.data.paperSubjectList) {
const data = parseZaiZheXue(o.data.paperSubjectList);
}
});
return true;
}
},
root: ".questiono-item",
elements: {
question: "h6 .processing_img",
options: ".questiono-main label .el-radio__label,.el-checkbox__label",
$options: ".questiono-main label"
},
wrap: obj => {
obj.type = qtype(obj.$item.parent().prev().text());
obj.options = obj.options.map(i => fmt(i.replaceAll(/[a-zA-z]\)\s+/g, "").replaceAll(/^[a-z]\s+/g, "").replaceAll(/^[a-z]、\s+/g, "").trim()));
},
ignore_click: $item => $item.hasClass("is-checked")
});
site({
name: "在浙学(测验/考试)",
match: location.host === "www.zjooc.cn" && location.pathname.includes("/singleQuestion/do/"),
intv: () => $(".settingsel-dialog").css("display") === "none",
root: ".question_content:first",
elements: {
question: ".question_title",
options: ".question_content .radio_content div",
$options: ".question_content label"
},
wrap: obj => {
obj.type = qtype(obj.$item.parent().find(".question_title p").eq(0).text());
obj.options = obj.options.map(i => fmt(i.replaceAll(/[a-zA-z]\)\s+/g, "").replaceAll(/^[a-z]\s+/g, "").replaceAll(/^[a-z]、\s+/g, "").replace(".", "").trim()));
},
ignore_click: $item => $item.hasClass("is-checked"),
finished: () => {
if ($(".question_btn .el-button:contains(下一题)").hasClass("is-disabled")) return false;
$(".el-button:contains(下一题)").click();
return true;
}
});
site({
name: "福建继续教育测验|作业",
match: location.pathname === "/Web_Study/Student/Center/MyWorkOnView" || location.pathname === "/Web_Study/Student/Center/MyExamOnView",
intv: () => $(".samllTopicNav").length,
root: ".topic-cont",
elements: {
question: "p",
options: ".options li span",
$options: ".options li"
},
wrap: obj => {
obj.options = obj.options.map(i => i.replace(/选项[A-Za-z]/, "").trim());
obj.type = {
1: 0,
2: 1,
3: 3,
6: 4
}[obj.$item.attr("itemtype")];
if (obj.type === undefined) obj.type = 4;
},
ignore_click: $item => $item.hasClass("correct"),
fill: (type, answer, $option) => {}
});
site({
name: "湖南继续教育",
match: () => {
const pathMatch = location.pathname.includes("/User/Student/myhomework.aspx") || location.pathname.includes("/examing.aspx");
const matchHostArr = [ "www.jwstudy.cn", "hdjt.wuxuekeji.com", "csjs.ynlhxy.com" ];
return pathMatch && (matchHostArr.includes(location.host) || location.host.includes("ls365.net") || location.host.includes("ls365.com"));
},
root: ".exam_question",
elements: {
question: ".exam_question_title div",
options: ".question_select .select_detail",
$options: ".question_select li",
type: ".exam_question_title div strong"
},
ignore_click: $item => $item.hasClass("cur")
});
site({
name: "德阳继续教育",
match: location.href.includes("/dypx/OnlineExam/Exam.aspx"),
root: "#divProblemArea",
elements: {
question: "#ulProblems li:first",
options: "#ulProblems .answer",
$options: "#ulProblems .answer input"
},
ignore_click: $item => $item.prop("checked"),
wrap: obj => {
if ($("#ulProblems .answer input").length < 3 && $("#ulProblems .answer input").eq(0).attr("type") === "radio") {
obj.type = 3;
obj.options = [ "正确", "错误" ];
} else if ($("#ulProblems .answer input").length > 2 && $("#ulProblems .answer input").eq(0).attr("type") === "radio") {
obj.type = 0;
} else if ($("#ulProblems .answer input").length > 2 && $("#ulProblems .answer input").eq(0).attr("type") === "checkbox") {
obj.type = 1;
}
},
finished: () => {
if ($(".dlg").length) return false;
$("#divBtns input:eq(1)").click();
return true;
}
});
site({
name: "淄博继续教育",
match: location.pathname.includes("/practice/start"),
root: ".header-left .trueorfalse .sub",
elements: {
question: ".mb10",
options: ".options li",
$options: ".options li"
},
ignore_click: $item => $item.hasClass("active"),
wrap: obj => {
obj.type = qtype(obj.$item.parent().prev().text());
obj.options = obj.options.map(i => fmt(i.replaceAll(/[a-zA-z]\)\s+/g, "").replaceAll(/^[a-z]\s+/g, "").replaceAll(/^[a-z]、\s+/g, "").trim()));
}
});
site({
name: "河北继续教育",
match: location.pathname.includes("paperid"),
intv: () => $(".examControl").length,
root: ".examItem",
elements: {
question: ".examItemRight .question",
options: ".examItemRight ul li span",
$options: ".examItemRight ul li"
},
ignore_click: $item => $item.hasClass("cur"),
wrap: obj => {
obj.type = qtype(obj.$item.parent().find(".questTitle b").text());
}
});
site({
name: "保定继续教育",
match: () => {
const pathnameArr = [ "/cuggw/rs/olex_exam", "/hebic/rs/olex_exam", "/sjzkjxy/rs/olex_exam", "/hbfsh/rs/olex_exam", "/jxycu/rs/olex_exam", "/jlufe/rs/olex_exam", "/hbun/rs/olex_exam" ];
return pathnameArr.includes(location.pathname);
},
intv: () => $(".paper_body").length,
root: ".item_li",
elements: {
question: ".item_title",
options: "ul li label",
$options: "ul li input"
},
ignore_click($item) {
return $item.prop("checked");
},
wrap: obj => {
if (obj.$options.length === 2) {
obj.type = 3;
} else if (obj.$options.length > 2 && obj.$options.eq(0).attr("type") === "radio") {
obj.type = 0;
} else if (obj.$options.length > 2 && obj.$options.eq(0).attr("type") !== "radio") {
obj.type = 1;
} else {
obj.type = 4;
}
}
});
site({
name: "唐山继续教育",
match: location.pathname.includes("/exam/student/exam/"),
intv: () => $(".ui-question-group").length,
root: ".ui-question-group .ui-question",
elements: {
question: ".ui-question-title .ui-question-content-wrapper",
options: ".ui-question-options .ui-question-content-wrapper",
$options: ".ui-question-options .ui-question-options-order"
},
wrap: obj => {
obj.type = qtype(obj.$item.parent().find("h2").text());
}
});
site({
name: "zzcjxy.hnzkw.org.cn",
match: location.host.includes("hnzkw.org.cn"),
intv: () => $(".answer").length,
hook: () => {
hookJSON(o => {
if (o.data && o.data.bookdatas) {
X.json = parsehnzkwText(o.data.bookdatas);
}
});
},
root: ".examList",
elements: {
question: ".text",
options: ".el-radio-group label,.el-checkbox-group label",
$options: ".el-radio-group input,.el-checkbox-group input",
type: ".status"
},
wrap: obj => {
Object.assign(obj, X.json[X.index - 1]);
},
fill: (type, answer, $option) => {}
});
site({
name: "问卷星考试",
match: location.pathname.includes("/exam/ExamRd/Answer"),
root: ".g-mn",
elements: {
question: ".m-question .tigan",
options: ".question-block .xuanxiang",
$options: ".question-block .xuanxiang",
type: ".tixing"
},
ignore_click: ($item, type) => {
if (type === 1) {
return $item.parent().find(".icheckbox_square-green").hasClass("checked");
} else {
const isIgnore = $item.parent().find(".iradio_square-green").hasClass("checked");
return isIgnore;
}
},
wrap: obj => {
if ($(".layui-layer-content").length) {
ui.tip("答题暂停,请自行通过验证", "warn");
GM_setValue("xc_paused", true);
return true;
}
},
fillFinish: data => {
if (data.style === "warning-row" || $(".g-mn").parent().find(".iradio_square-green").hasClass("checked") || data.type === 1) {
$('.u-btn-next:contains("下一题")').click();
}
},
finished: () => parseInt($(".num-dangqian:last").attr("qindex")) !== $(".num-item").length
});
site({
name: "中国石化网络学院",
match: location.host.includes("sia.sinopec.com") && location.hash.includes("/exam"),
intv: () => $(".queston-item").length && $("[topisshow='0']").length,
hook: () => {
hookJSON(o => {
if (o.responseData && o.responseData.partitions) {
X.json = parseShihuaExam(JSON.parse(o.responseData.partitions)).reduce((acc, cur) => acc.concat(cur), []);
}
});
},
root: ".queston-item>div:has([topisshow='0'])",
elements: {
question: "h6",
options: ".el-radio,.el-checkbox label",
$options: ".el-radio,.el-checkbox input"
},
wrap: obj => {
const idx = parseInt(obj.$item.attr("a"));
Object.assign(obj, X.json[isNaN(idx) ? X.index - 1 : idx]);
},
ignore_click: $item => $item.prop("checked"),
fillFinish: () => {
$(".nextQuestion").click();
},
finished: () => $(".nextQuestion").length > 0
});
/* ---------- 启动 ---------- */
try { boot(); } catch (e) { console.warn("[小柴答题] 启动失败", e); }
})();