// ==UserScript== // @name 超星学习通+AI自动答题脚本(支持考试,作业,章节测试,支持新版学习通,一键最小化,多种AI) // @namespace http://tampermonkey.net/ // @version 1.11 // @description 超星学习通+ChatGPT自动答题脚本(支持考试和作业和章节测试,支持新版学习通)。直接获取到答案,可以复制答案到剪切板。 // @author Cwyu // @license MIT // @supportURL 1441577495@qq.com // @contributionURL https://ifdian.net/a/cwyuu // @match *://mooc1.chaoxing.com/exam-ans/mooc2/exam/preview?* // @match *://mooc1.chaoxing.com/mooc2/work/dowork?* // @match *://mooc1.chaoxing.com/mycourse/studentstudy?* // @match *://mooc1.chaoxing.com/mycourse/studentstudy* // @match *://mooc1.chaoxing.com/mooc-ans/mooc2/work/dowork* // @icon https://www.google.com/s2/favicons?sz=64&domain=chaoxing.com // @grant unsafeWindow // @grant GM_addStyle // @grant GM_setValue // @grant GM_getValue // @run-at document-end // @downloadURL none // ==/UserScript== (function() { 'use strict'; GM_addStyle(` #my-window { position: fixed; top: 10px; left: 10px; width: 500px; height: 400px; background-color: rgba(255, 255, 255, 0.95); border: 1px solid #e2e8f0; border-radius: 8px; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); z-index: 9999; overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; resize: both; min-width: 300px; min-height: 200px; } #my-window .header { background-color: #1a202c; color: white; padding: 8px 12px; font-size: 14px; font-weight: 600; border-radius: 8px 8px 0 0; cursor: move; display: flex; justify-content: space-between; align-items: center; } #my-window .xxt-content { padding: 12px; display: flex; flex-direction: column; overflow: hidden; width: auto; min-height: 0; } #my-window .question-section, #my-window .answer-section { background-color: #fff; border: 1px solid #e2e8f0; padding: 12px; border-radius: 4px; margin-bottom: 8px; word-break: break-word; overflow-wrap: break-word; } #my-window .answer-section { flex: 1; overflow-y: auto; } #my-window .controls { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; } #my-window .settings-row { display: flex; align-items: center; gap: 12px; } #my-window .button-row { display: flex; gap: 8px; } #my-window button { padding: 4px 8px; border-radius: 4px; font-size: 12px; cursor: pointer; border: none; background: #e2e8f0; transition: background-color 0.2s; } #my-window button:hover { background: #cbd5e1; } #my-window button#refresh-btn { background: #3b82f6; color: white; } #my-window button#refresh-btn:hover { background: #2563eb; } #my-window button#copy-btn { background: #10b981; color: white; } #my-window button#copy-btn:hover { background: #059669; } #my-window select { padding: 4px; border-radius: 4px; font-size: 12px; border: 1px solid #e2e8f0; flex: 1; } #my-window input[type="text"] { padding: 4px 8px; border-radius: 4px; font-size: 12px; border: 1px solid #e2e8f0; flex: 1; } #floating-button { position: fixed; top: 20px; left: -45px; width: 50px; height: 50px; background-color: #1a202c; color: white; border-radius: 25px; text-align: center; line-height: 50px; cursor: pointer; transition: all 0.3s ease; z-index: 9999; font-size: 12px; } #floating-button:hover { left: 0; } #my-window .label { color: #64748b; font-size: 12px; margin-bottom: 4px; } #my-window .subscription-row { display: flex; gap: 8px; width: 100%; } #my-window .subscription-row input { flex: 1; } #my-window .subscription-row button { white-space: nowrap; } #my-window button svg { display: inline-block; vertical-align: middle; margin-right: 4px; } #my-window #prev-btn svg, #my-window #next-btn svg { margin-right: 0; } #my-window .status-info-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px; border-top: 1px solid #e2e8f0; font-size: 12px; color: #64748b; } `); const windowHTML = `