Greasy Fork

Greasy Fork is available in English.

nwpu-pj

try to take over the world!

当前为 2020-07-17 提交的版本,查看 最新版本

// ==UserScript==
// @name         nwpu-pj
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  try to take over the world!
// @author       You
// @match        http://us.nwpu.edu.cn/eams/*
// @grant        none
// ==/UserScript==

(function() {
    autoPJ();

    function autoPJ() {
        var url = window.location.href;
        if (url == "http://us.nwpu.edu.cn/eams/evaluateStd!search.action" || url == "http://us.nwpu.edu.cn/eams/evaluateStd!save.action") {
            var table = document.getElementsByClassName('gridtable')[0].children[1];
            for (const element of table.children) {
                if (element.children[4].innerText == '未评教') {
                    var k = element.children[5];
                    k.children[0].click();
                    break;
                }
            }
        }
        else if (url == "http://us.nwpu.edu.cn/eams/evaluateStd!loadQuestionnaire.action") {
            var pre, post;
            pre = "op_";
            post = "_44";
            var checkbox;
            for (var i = 0; i <= 200; i++) {
                checkbox = document.getElementById(pre + i + post);
                if (checkbox != null) checkbox.checked = true;
            }
            document.getElementById("btnSave").click();
        }
        setTimeout(autoPJ, "2000");
    }
})();