// ==UserScript== // @name 超星学习通+自定义AI答题脚本 (SiliconFlow完美融合版) // @namespace http://tampermonkey.net/ // @version 1.2 // @description V1.2: 新增“答案模式”选择器,包括专为简答/论述题优化的“拓展论述”模式,解决答案过短问题!集成更强大的UEditor粘贴解锁方案,解决部分作业无法粘贴的问题。感谢用户反馈! // @author Weinan (Modified by Gemini) // @license GPL-3.0-or-later // @match *://*.chaoxing.com/exam-ans/mooc2/exam/preview* // @match *://*.chaoxing.com/mooc2/work/dowork* // @match *://*.chaoxing.com/mycourse/studentstudy* // @match *://*.chaoxing.com/mooc-ans/mooc2/work/dowork* // @icon https://i.miji.bid/2025/06/13/cdf1843af3a8dab9804bd8a53e11f092.png // @grant unsafeWindow // @grant GM_addStyle // @grant GM_setValue // @grant GM_getValue // @grant GM_xmlhttpRequest // @connect api.siliconflow.cn // @run-at document-end // @downloadURL https://update.greasyfork.icu/scripts/539293/%E8%B6%85%E6%98%9F%E5%AD%A6%E4%B9%A0%E9%80%9A%2B%E8%87%AA%E5%AE%9A%E4%B9%89AI%E7%AD%94%E9%A2%98%E8%84%9A%E6%9C%AC%20%28SiliconFlow%E5%AE%8C%E7%BE%8E%E8%9E%8D%E5%90%88%E7%89%88%29.user.js // @updateURL https://update.greasyfork.icu/scripts/539293/%E8%B6%85%E6%98%9F%E5%AD%A6%E4%B9%A0%E9%80%9A%2B%E8%87%AA%E5%AE%9A%E4%B9%89AI%E7%AD%94%E9%A2%98%E8%84%9A%E6%9C%AC%20%28SiliconFlow%E5%AE%8C%E7%BE%8E%E8%9E%8D%E5%90%88%E7%89%88%29.meta.js // ==/UserScript== (function() { 'use strict'; // --- CSS样式 (适配新控件) --- GM_addStyle(` #ai-helper-window { position: fixed; top: 20px; left: 20px; width: 520px; height: 550px; /* 增加高度 */ background-color: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); z-index: 99999; overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; resize: both; min-width: 320px; min-height: 350px; display: flex; flex-direction: column; } #ai-helper-window .header { background-color: #2d3748; color: white; padding: 8px 12px; font-size: 14px; font-weight: 600; cursor: move; display: flex; justify-content: space-between; align-items: center; } #ai-helper-window .header #ai-helper-hide-btn { background: transparent; color: white; font-size: 24px; font-weight: bold; border: none; padding: 0 8px; cursor: pointer; line-height: 1; } #ai-helper-window .header #ai-helper-hide-btn:hover { color: #cbd5e1; } #ai-helper-window .content-wrapper { padding: 12px; display: flex; flex-direction: column; overflow: hidden; flex-grow: 1; } #ai-helper-window .question-section, #ai-helper-window .answer-section { border: 1px solid #e2e8f0; padding: 12px; border-radius: 4px; margin-bottom: 8px; overflow-y: auto; word-break: break-word; } #ai-helper-window .answer-section { flex: 1; } #ai-helper-window .controls-area { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; } #ai-helper-window .button-row, .api-key-row, .model-select-row, .settings-row { display: flex; gap: 8px; align-items: center; } #ai-helper-window button { padding: 6px 12px; border-radius: 4px; font-size: 12px; cursor: pointer; border: none; background: #e2e8f0; transition: background-color 0.2s; display: flex; align-items: center; justify-content: center; } #ai-helper-window button:hover:not(:disabled) { background: #cbd5e1; } #ai-helper-window button:disabled { cursor: not-allowed; background-color: #f1f5f9; color: #94a3b8; } #ai-helper-window button#ai-helper-refresh-btn { background: #3b82f6; color: white; flex-grow: 1; } #ai-helper-window button#ai-helper-refresh-btn:hover:not(:disabled) { background: #2563eb; } #ai-helper-window button#ai-helper-get-all-btn { background: #8b5cf6; color: white; flex-grow: 1; } #ai-helper-window button#ai-helper-get-all-btn:hover:not(:disabled) { background: #7c3aed; } #ai-helper-window button#ai-helper-copy-btn { background: #10b981; color: white; } #ai-helper-window button#ai-helper-copy-btn:hover { background: #059669; } #ai-helper-window .api-key-row input, #ai-helper-model-select, #ai-helper-answer-mode-select { flex: 1; padding: 6px 8px; border-radius: 4px; font-size: 12px; border: 1px solid #e2e8f0; } #ai-helper-window .api-key-row button { white-space: nowrap; } #ai-helper-window button svg { margin-right: 4px; } #ai-helper-window .features-section { display: flex; align-items: center; gap: 15px; padding: 8px 4px; font-size: 12px; } .features-section .feature-toggle { display: flex; align-items: center; gap: 4px; } .features-section .feature-toggle input { margin-right: 4px; } #ai-helper-window .status-info-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 4px 0px; border-top: 1px solid #e2e8f0; margin-top: 5px; font-size: 12px; color: #64748b; } #ai-helper-floating-button { position: fixed; top: 20px; left: -48px; width: 55px; height: 50px; background-color: #2d3748; color: white; border-radius: 0 25px 25px 0; text-align: right; padding-right: 12px; line-height: 50px; cursor: pointer; transition: all 0.3s ease; z-index: 99998; font-size: 14px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); } #ai-helper-floating-button:hover { left: 0; } .label { color: #64748b; font-size: 12px; margin-bottom: 4px; } `); // --- HTML结构 (更新为“答案模式”选择器) --- const windowHTML = `