// ==UserScript== // @name hebeu教学评估 // @namespace https://github.com/slightin // @description 自动教学评估,自动点击“非常符合”或“符合”,基于hebeu教务系统 // @author 盛夏 // @version 1.3.3 // @match *://27.188.65.169:*/student/teachingEvaluation/* // @match */student/teachingEvaluation/* // @icon http://27.188.65.169:9111/img/icon/favicon.ico // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; //主观评价 var eva="老师重视教学,严慈相济,关爱学生,讲授详略得当,重点突出,难点讲透" // code here... var tpath = "#page-content-template > div > div > div.widget-content > form > div > table > tbody > "; var min=6E4; var flag=true; function index(){ var times =document.querySelector("#jxpgtbody").getElementsByTagName("tr").length; for(var i=1;i<=times;i++) { if(/评估/.test(document.querySelector("#jxpgtbody > tr:nth-child("+i+") > td:nth-child(1) > button").innerText)) { flag=false document.querySelector("#jxpgtbody > tr:nth-child("+i+") > td:nth-child(1) > button").click(); break; } } if(flag) { var div= document.createElement('div') var ins=document.querySelector("#page-content-template").firstElementChild document.querySelector("#page-content-template").insertBefore(div,ins) div.innerText="评估未开始或已完成" div.style="color: #128520;font-size: x-large;" } } if(/evaluation\/index/.test(window.location.href)) { setTimeout(index,1000); } if(/evaluationPage/.test(window.location.href)) { for(var i=3;i<22;i+=2) { for(var j=1;j<6;j++) { if(/(? td > div:nth-child("+j+") > label > span:nth-child(3)").innerText)) { document.querySelector(tpath+"tr:nth-child("+i+") > td > div:nth-child("+j+") > label > span:nth-child(3)").click(); } } } document.querySelector("#page-content-template > div > div > div.widget-content > form > div > table > tbody > tr:nth-child(23) > td > div > textarea").value=eva; function tijiao(){ setInterval(function(){document.querySelector("#buttonSubmit").click();},1000); } setTimeout(tijiao,2*min); } })();