// ==UserScript==
// @name hebeu教学评估
// @namespace https://github.com/slightin
// @description 自动教学评估,自动点击“非常符合”,适用于河北工程大学URP教务系统
// @author 盛夏
// @version 2.0.0
// @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(/非常符合/.test(document.querySelector(tpath+"tr:nth-child("+i+") > 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();
}
}
}
var tip= document.createElement("h4")
var ins = document.getElementById("buttonSubmit")
var div=document.querySelector("#page-content-template > div > div > div:nth-child(3)")
div.insertBefore(tip,ins)
tip.innerHTML='时间结束会自动提交哦U•ェ•*U 请保持浏览器处于此窗口中
还未破解计时方法,你可以给个好评,就是我更新脚本的动力\n'
document.querySelector("#page-content-template > div > div > div.widget-content > form > div > table > tbody > tr:nth-child(23) > td > div > textarea").value=eva;
setInterval(function(){if(document.querySelector("#RemainM").innerText=='0' && document.querySelector("#RemainS").innerText=='0'){document.querySelector("#buttonSubmit").click()}},1000);
}
})();