Greasy Fork is available in English.
自动选择所有"很满意"
当前为
// ==UserScript==
// @name 方正教务系统自动评价
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 自动选择所有"很满意"
// @author wyg
// @match *://*edu.cn/jwglxt/*
// @grant none
// @license MIT
// ==/UserScript==
(function() {
'use strict';
function selectVerySatisfied() {
console.log('开始执行')
const radios = document.querySelectorAll('input.radio-pjf');
console.log(`找到 ${radios.length} 个单选按钮。`);
radios.forEach(radio => {
console.log(`单选按钮 data-dyf: ${radio.getAttribute('data-dyf')}`);
// 检查单选按钮的 data-dyf 属性是否为 '5'(表示“很满意”)
if (radio.getAttribute('data-dyf') === '5') {
radio.checked = true;
console.log("单选按钮已设置为“很满意”。");
}
});
}
const observer = new MutationObserver(() => {
selectVerySatisfied();
});
observer.observe(document.body, { childList: true, subtree: true });
selectVerySatisfied();
})();