// ==UserScript== // @name 超星学习通主观题AI自动批卷 - 免费版[高级功能见付费版] // @namespace free // @version 1.0 // @description 当前是免费版本,支持一键将所有主观题打C评分(60%分值)。基于AI大模型10秒内可以完成一份主观题试卷的精准批阅,可自定义打分规则,如为50-60分期间的学生凑分让他及格等。如需全功能版本(AI智能批卷、自定义评分规则、智能凑分等)请安装付费版本购买授权后可使用。接各类脚本开发、代挂工作,微信:zhanyc_cn 个人网站:http://doc.zhanyc.cn // @include *://*chaoxing.com* // @include *://*.chaoxing.com/* // @grant GM_addStyle // @run-at document-end // @require http://libs.baidu.com/jquery/2.0.0/jquery.min.js // ==/UserScript== (function () { let $jq = $; unsafeWindow.$jq = $; let docUrl = "http://doc.zhanyc.cn/pages/cxyj/"; let wxInfo = "微信:zhanyc_cn"; // ====== 样式 ====== GM_addStyle(` #zfkFreePanel { position: fixed; left: 10px; top: 10px; z-index: 2147483647; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.3); color: #fff; font-size: 13px; max-width: 280px; min-width: 200px; font-family: "Microsoft YaHei",sans-serif; } #zfkFreePanel-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; cursor: move; user-select: none; border-bottom: 1px solid rgba(255,255,255,0.2); font-weight: bold; font-size: 14px; } #zfkFreePanel-close { cursor: pointer; font-size: 18px; line-height: 1; opacity: 0.8; background: none; border: none; color: #fff; padding: 0 4px; } #zfkFreePanel-close:hover { opacity: 1; } #zfkFreePanel-body { padding: 10px 12px; line-height: 1.6; } #zfkFreePanel-body p { margin: 6px 0; } #zfkFreePanel-body .highlight { color: #ffd700; font-weight: bold; } #zfkFreePanel-body .btn-buy { display: block; width: 100%; padding: 8px 0; margin: 10px 0 6px; background: #ff6b6b; color: #fff; text-align: center; border-radius: 4px; text-decoration: none; font-weight: bold; font-size: 14px; cursor: pointer; border: none; } #zfkFreePanel-body .btn-buy:hover { background: #ee5a5a; } #zfkFreePanel-body .wx-tip { font-size: 12px; opacity: 0.85; } #zfkFreePanel-min { cursor: pointer; font-size: 16px; opacity: 0.8; background: none; border: none; color: #fff; padding: 0 4px; } #zfkFreePanel-min:hover { opacity: 1; } /* 未授权弹窗(模拟layer效果,不使用layer组件) */ .zfk-modal-overlay { position: fixed; left: 0; top: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 2147483646; display: flex; align-items: center; justify-content: center; } .zfk-modal-box { background: #fff; border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,0.3); max-width: 480px; width: 90%; overflow: hidden; animation: zfkFadeIn 0.25s ease; } @keyframes zfkFadeIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } } .zfk-modal-title { background: #e74c3c; color: #fff; padding: 12px 16px; font-size: 16px; font-weight: bold; } .zfk-modal-body { padding: 18px 16px; font-size: 14px; color: #333; line-height: 1.7; } .zfk-modal-body .feature-list { background: #f8f9fa; border-left: 3px solid #667eea; padding: 10px 12px; margin: 10px 0; border-radius: 0 4px 4px 0; } .zfk-modal-body .feature-list li { margin: 4px 0; list-style: none; } .zfk-modal-body .feature-list li::before { content: "✔ "; color: #27ae60; } .zfk-modal-footer { display: flex; border-top: 1px solid #eee; } .zfk-modal-footer button { flex: 1; padding: 12px; border: none; cursor: pointer; font-size: 14px; transition: background 0.2s; } .zfk-modal-footer .btn-primary { background: #3498db; color: #fff; } .zfk-modal-footer .btn-primary:hover { background: #2980b9; } .zfk-modal-footer .btn-secondary { background: #ecf0f1; color: #333; } .zfk-modal-footer .btn-secondary:hover { background: #d5dbdb; } /* 一键打分按钮 */ #zfkQuickMarkC { position: fixed; right: 20px; bottom: 100px; z-index: 2147483645; background: #27ae60; color: #fff; border: none; border-radius: 8px; padding: 12px 22px; font-size: 16px; font-weight: bold; cursor: pointer; box-shadow: 0 4px 15px rgba(39,174,96,0.4); transition: transform 0.2s, box-shadow 0.2s; } #zfkQuickMarkC:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(39,174,96,0.6); } #zfkQuickMarkC:disabled { background: #95a5a6; cursor: not-allowed; transform: none; } /* 日志面板 */ #zfkFreeLogPanel { position: fixed; left: 10px; bottom: 80px; z-index: 2147483644; background: #fff; border: 1px solid #ddd; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.3); width: 380px; max-height: 280px; display: none; flex-direction: column; font-size: 13px; } #zfkFreeLogPanel.show { display: flex; } #zfkFreeLogHeader { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; background: #27ae60; color: #fff; border-radius: 4px 4px 0 0; cursor: pointer; user-select: none; } #zfkFreeLogContent { overflow-y: auto; padding: 6px; flex: 1; max-height: 220px; background: #f8f8f8; } #zfkFreeLogContent .log-entry { padding: 2px 0; border-bottom: 1px solid #eee; font-size: 13px; color: #333; } `); // ====== 引流悬浮窗(左上角,可关闭/折叠) ====== function addPromoPanel() { if ($("#zfkFreePanel").length > 0) return; let html = `
⚡ 超星批卷脚本

免费版功能:一键全部打C评分

付费版功能:

✦ AI智能批卷(10秒完成一个学生)

✦ 自定义评分规则

✦ 智能凑分(50-60分段 自动批卷让学生及格)

✦ 自动提交打分结果

✦ 自动切换下一份试卷打分

👉 购买付费版本授权

接各类脚本开发、代挂、网站小程序开发工作,${wxInfo}

`; $("body").append(html); $("#zfkFreePanel-close").on("click", function () { $("#zfkFreePanel").remove(); }); $("#zfkFreePanel-min").on("click", function () { let $body = $("#zfkFreePanel-body"); let $btn = $(this); if ($body.is(":visible")) { $body.hide(); $btn.text("□"); } else { $body.show(); $btn.text("─"); } }); // 简单拖拽 let dragging = false, startX, startY, offsetX, offsetY; $("#zfkFreePanel-header").on("mousedown", function (e) { dragging = true; let panel = $("#zfkFreePanel"); offsetX = e.clientX - panel.offset().left; offsetY = e.clientY - panel.offset().top; }); $(document).on("mousemove", function (e) { if (!dragging) return; $("#zfkFreePanel").css({ left: Math.max(0, e.clientX - offsetX) + "px", top: Math.max(0, e.clientY - offsetY) + "px", }); }).on("mouseup", function () { dragging = false; }); } // ====== 未授权提示弹窗 ====== function showUnauthorizedMsg() { if ($(".zfk-modal-overlay").length > 0) return; let overlay = $(`
⚠️ 脚本未授权

当前使用的是免费版本,仅支持一键全部打C功能,且该页面未开放使用。

付费版本完整功能:

  • 基于AI大模型智能批卷,10秒完成一份主观题试卷批阅
  • 自定义打分规则(如优先打A/B/C等)
  • 智能凑分:自动为50-60分段学生凑分至及格
  • 自动提交打分结果,无需手动操作
  • 支持自定义API Key,灵活选择AI模型
  • 如需使用完整功能,请联系脚本客服授权。

    `); $("body").append(overlay); $("#zfkAuthBuy").on("click", function () { window.open(docUrl); }); $("#zfkAuthClose").on("click", function () { $(".zfk-modal-overlay").remove(); }); } // ====== 日志面板 ====== let logStartTime = null; function ensureLogPanel() { if ($("#zfkFreeLogPanel").length > 0) return; let html = `
    📋 运行日志
    `; $("body").append(html); logStartTime = Date.now(); $("#zfkFreeLogHeader").off("click").on("click", function (e) { if ($(e.target).closest("#zfkFreeLogToggle").length) { let $content = $("#zfkFreeLogContent"); let $toggle = $("#zfkFreeLogToggle"); if ($content.is(":visible")) { $content.hide(); $toggle.text("□"); } else { $content.show(); $toggle.text("─"); } } }); } function addLog(msg) { if ($("#zfkFreeLogContent").length === 0) return; let now = new Date(); let timeStr = dateFormat(now, "HH:mm:ss"); let elapsed = logStartTime ? ((now.getTime() - logStartTime) / 1000).toFixed(1) : "0.0"; let entry = '
    [' + timeStr + '] (+' + elapsed + 's) ' + $("").text(msg).html() + "
    "; $("#zfkFreeLogContent").append(entry); $("#zfkFreeLogContent").scrollTop($("#zfkFreeLogContent")[0].scrollHeight); } // ====== 工具函数 ====== function waitOf(fun, interval, timeout) { if (!interval) interval = 1000; if (!timeout) timeout = 30; return new Promise(function (resolve, reject) { var _timeOut = timeout * 1000; try { if (fun()) return resolve(); } catch (e) { } var index = setInterval(function () { try { if (timeout !== -1) { _timeOut -= interval; if (_timeOut < 0) { clearInterval(index); return reject(); } } if (fun()) { clearInterval(index); return resolve(); } } catch (e) { } }, interval); }); } function waitTimeout(timeout) { return new Promise(function (resolve) { setTimeout(resolve, timeout); }); } function dateFormat(date, fmt) { if (typeof date === "number") date = new Date(date); var opt = { "y+": date.getFullYear().toString(), "M+": (date.getMonth() + 1).toString(), "d+": date.getDate().toString(), "H+": date.getHours().toString(), "m+": date.getMinutes().toString(), "s+": date.getSeconds().toString(), }; for (var k in opt) { var ret = new RegExp("(" + k + ")").exec(fmt); if (ret) { fmt = fmt.replace(ret[1], ret[1].length === 1 ? opt[k] : opt[k].padStart(ret[1].length, "0")); } } return fmt; } // ====== 一键全部打C ====== async function pageMarkAllC() { addPromoPanel(); // 等待页面元素出现 await waitOf(function () { return $(".topicArea:visible").length > 0; }); await waitTimeout(800); ensureLogPanel(); $("#zfkFreeLogPanel").addClass("show"); addLog("检测到批卷页面"); addLog("因未接入AI大模型,无法识别答题情况"); addLog("准备一键打C"); // 添加一键打C按钮 if ($("#zfkQuickMarkC").length > 0) return; var btn = $(''); $("body").append(btn); // 显示提示说明 addLog("已加载「一键全部打C」按钮(右下角)"); addLog("提示:全部打C = 每题获得60%分值"); btn.on("click", async function () { $(this).prop("disabled", true).text("⏳ 正在打分..."); addLog("开始一键全部打C..."); var qaCount = $(".topicArea:visible").length; var markBtns = $(".fastDiv.quickMark[recordid]:visible"); if (markBtns.length !== qaCount) { addLog("错误:题目数量与快捷打分按钮数量不匹配,请刷新重试"); $(this).prop("disabled", false).text("⚡ 一键全部打C"); return; } for (var i = 0; i < qaCount; i++) { var cBtn = $(markBtns[i]).find(".fastScore a").filter(function () { return $(this).text().trim().toUpperCase() === "C"; }); if (cBtn.length > 0) { cBtn[0].click(); addLog("第" + (i + 1) + "题:已打C"); await waitTimeout(200); } else { addLog("第" + (i + 1) + "题:未找到C按钮"); } } addLog("✅ 全部题目已打C完成!"); $(this).text("✅ 已完成").css("background", "#95a5a6"); addLog("请在页面上确认打分结果后,手动点击提交按钮"); }); } // ====== 根据URL执行 ====== function runByUrl() { var url = location.href.toLowerCase(); if (url.indexOf("/exam/test/markpaper") !== -1) { // 批卷页面:提供一键打C功能 pageMarkAllC(); } else if (url.indexOf("/exam/") !== -1 || url.indexOf("/exam/test/marklist") !== -1) { // 其他考试页面:显示未授权提示 addPromoPanel(); showUnauthorizedMsg(); } else { // 其他页面:只显示引流悬浮窗 addPromoPanel(); } } // ====== 初始化 ====== $(function () { runByUrl(); }); })();