南信大自动同学互评

南京信息工程大学奥兰学生管理信息系统同学互评自动填充满分

目前為 2019-07-03 提交的版本,檢視 最新版本

// ==UserScript==
// @name         南信大自动同学互评
// @namespace    myetyet
// @version      0.1
// @description  南京信息工程大学奥兰学生管理信息系统同学互评自动填充满分
// @author       myetyet
// @match        http://stu.nuist.edu.cn/txxm/sthp.aspx?xq=*
// @run-at       document-end
// @grant        none
// ==/UserScript==

const mark1 = 6.0;
const mark2 = 5.0;
(function() {
    'use strict';
    var x = 1;
    var fail = 0;
    while (true){
        ++x;
        var iname = "MyDataGrid__ctl" + String(x) + "_cp";
        var ipt = document.getElementById(iname + "1_2");
        if (ipt){
            ipt.value = mark1;
            document.getElementById(iname + "2_2").value = mark1;
            document.getElementById(iname + "3_2").value = mark1;
            document.getElementById(iname + "4_2").value = mark1;
            document.getElementById(iname + "5_2").value = mark1;
            document.getElementById(iname + "6_2").value = mark2;
        } else {
            ++fail;
            if (fail == 2){
                break;
            }
        }
    }
})();