// ==UserScript== // @name 知到智慧树掌握度答题-AI自动答题脚本(Zhihuishu AI Auto-Answering) // @namespace http://tampermonkey.net/ // @version 1.3.1-beta // @description 半自动完成智慧树掌握度练习。新增支持免费模式(GLM-4.5-Flash)及自定义多种AI服务商(DeepSeek/Zhipu/OpenAI/Gemini/Coren)。 // @author Coren // @match https://studywisdomh5.zhihuishu.com/study* // @match https://studywisdomh5.zhihuishu.com/exam* // @match https://studywisdomh5.zhihuishu.com/pointOfMastery* // @connect api.coren.xin // @connect open.bigmodel.cn // @connect api.deepseek.com // @connect api.openai.com // @connect generativelanguage.googleapis.com // @grant GM_addStyle // @grant GM_xmlhttpRequest // @grant GM_setValue // @grant GM_getValue // @grant unsafeWindow // @license CC BY-NC-SA 4.0 // @license https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh // ==/UserScript== (function() { 'use strict'; // --- 1. UI 和样式 --- GM_addStyle(` #ai-panel { position: fixed; top: 100px; right: 20px; width: 300px; background-color: #ffffff; border: 1px solid #e0e0e0; border-radius: 8px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); z-index: 9999; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; transition: transform 0.3s ease-in-out; transform: translateX(110%); } #ai-panel.show { transform: translateX(0); } #panel-toggle { position: fixed; top: 100px; right: 20px; width: 40px; height: 40px; background-color: #0d6efd; color: white; border: none; border-radius: 50%; cursor: pointer; z-index: 10000; display: flex; justify-content: center; align-items: center; font-size: 20px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); } #panel-header { padding: 15px; background-color: #0d6efd; color: white; border-top-left-radius: 8px; border-top-right-radius: 8px; font-size: 18px; font-weight: 500; } #panel-content { padding: 20px; display: flex; flex-direction: column; gap: 15px; } .input-group { display: flex; flex-direction: column; } .input-group label { margin-bottom: 5px; color: #333; font-weight: 500; } .input-group input, .input-group select { padding: 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; } #start-button { padding: 10px 15px; background-color: #198754; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 16px; transition: background-color 0.3s; } #start-button:hover { background-color: #157347; } #status-log { margin-top: 15px; padding: 10px; background-color: #f8f9fa; border-radius: 4px; height: 100px; overflow-y: auto; font-size: 12px; color: #555; border: 1px solid #e0e0e0; } .custom-settings.hidden, .model-name-group.hidden, .api-url-group.hidden { display: none; } `); const panelHTML = `