自动评教

try to take over the world!

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         自动评教
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  try to take over the world!
// @author       mountainguan
// @match        http://jwc.dgut.edu.cn/jyk/student.asp*
// @grant        none
// ==/UserScript==

var dododo = function(){
    var selectlist = ['a1_0','a2_2','a3_2','a4_0','a5_2','a6_2','a7_0','a8_2','a9_0','a10_2','a11_0','a12_0','a13_1','a14_1','a15_0']; //选项
    for(var i=0;i < selectlist.length;i++){
        document.getElementById(selectlist[i]).checked=true;
    }
    document.getElementsByName("aSug1")[0].innerHTML="没有";
    document.getElementsByName("aSug2")[0].innerHTML="没有";

    $("input[name='submit']").trigger("click");
};
var getUrlParam = function (name)//获取参数
{
    var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
    var r = window.location.search.substr(1).match(reg);  //匹配目标参数
    if (r!==null) return unescape(r[2]); return null; //返回参数值
};

if(window.location.pathname=="/jyk/student.asp"){
    if(window.location.href=="http://jwc.dgut.edu.cn/jyk/student.asp"){
        window.location = "http://jwc.dgut.edu.cn/jyk/student.asp?s=4";
    } //进入第一个界面
    else if(window.location.search=="?s=4"){
        ////进入第二个界面
        if($("center span[class='fnotic']")[0].innerHTML=="所有课程评价已完成!"){
            alert("恭喜,你已经完成所有评教!!");
        }else{
            for(var i=0;i < $("form[name='kclist'] a").length;i++){
                var str1 = $("form[name='kclist'] a")[i].innerHTML;
                if(str1=="进行评价") window.location =$("form[name='kclist'] a")[i].href;
            }
        }
    }else if(getUrlParam("a")=="tj"){ //提交后立即转跳
            window.location = "http://jwc.dgut.edu.cn/jyk/student.asp?s=4";
    }else{
        /***开始评教***/
        dododo();
    }
}