// ==UserScript== // @name FAFU教务系统一键教评 // @namespace http://tampermonkey.net/ // @version 2025-12-27 // @description try to take over the world! // @author You // @match http://jsxyjwgl.fafu.edu.cn/* // @match http://210.34.84.81/* // @icon https://www.google.com/s2/favicons?sz=64&domain=fafu.edu.cn // @grant none // ==/UserScript== (function() { 'use strict'; function evaluate(iframe) { var selec = iframe.contentDocument.getElementsByTagName('select'); var length = selec.length; for (var i = 1; i < length; i++) { var ran = Math.floor(Math.random() * 2) + 1; selec[i].selectedIndex = ran; } iframe.contentDocument.getElementById('Button1').click(); } function startPj() { var iframe = document.getElementById('iframeautoheight'); var pjkc = iframe.contentWindow.document.getElementById('pjkc'); var courseCount = pjkc.length; var courseNames = []; for (var i = 0; i < pjkc.childNodes.length; i++) { var option = pjkc.childNodes[i]; if (option.nodeName == '#text') { continue; } courseNames.push(option.innerText); } evaluate(iframe); var cc = 0; console.log('已评价: ' + courseNames[cc]); iframe.onload = function () { if (cc < courseCount - 1) { evaluate(iframe); cc++; console.log('已评价: ' + courseNames[cc]); } else { console.log('所有' + courseCount + '门课程已评价完成'); } }; } const btn = document.createElement("button"); btn.style.cssText = `position: fixed;bottom: 30px;left: 50%;transform: translateX(-50%);z-index: 9999999;padding:14px 30px;border:none;border-radius:10px;background:#1677ff;color:#FFFFFF;font-size:17px;font-weight:bold;cursor:pointer;box-shadow:0 3px 10px rgba(0,0,0,0.3);`; btn.onmouseover = () => btn.style.background = "#0d66d0"; btn.onmouseout = () => btn.style.background = "#1677ff"; btn.innerText = "🔘 开始教评"; document.body.appendChild(btn); btn.addEventListener('click', function(){ this.disabled = true; this.innerText = "⏳ 教评执行中..."; this.style.background = "#2596be"; setTimeout(startPj, 300); }); })();