// ==UserScript==
// @name Mutx163学习通自动评教
// @namespace http://tampermonkey.net/
// @version v1.2
// @description 学习通自动评价,默认满分
// @author Mutx163
// @match http://newes.chaoxing.com/pj/newesReception/*
// @icon
// @license MIT
// @grant none
// @downloadURL none
// ==/UserScript==
//默认开启了自动提交,把不喜欢的话自动提交下面的那行代码注释掉即可
window.onload = function() {
'use strict';
// 使用轮询方式等待元素加载
function waitForElement(selector, callback) {
const interval = setInterval(function() {
const elements = document.querySelectorAll(selector);
if (elements.length) {
clearInterval(interval);
callback(elements);
}
}, 100); // 每100毫秒检查一次
}
// 查找所有标记为5分的元素并模拟点击
waitForElement('input.inputvalue.reselect[score="5.0"]', function(options) {
options.forEach(option => {
const clickEvent = new MouseEvent('click', {
bubbles: true,
cancelable: true,
view: window
});
option.dispatchEvent(clickEvent);
});
// 在所有5分选项被点击之后,查找