menu badmonkey's blog
more_vert
chevron_right 首页 » 杂谈 » 正文
JLU一键评教
2020-06-11 | 杂谈 | 暂无评论 | 221 次阅读 | 159字

JLU 一键评教

更新时间 2020.6.11

根据双草酸酯大佬的脚本改了一改,凑合能用。

使用方式

使用vpns.jlu.edu.cn登陆教务系统,在新的标签页打开任意一个评教任务,浏览器F12(或者右键检查),切换到console 选项,直接贴上代码,然后回车会自动选择所有选项,不过需要手动提交。

源码

压缩版

function fuck(){ntms.widget._AutoLabel.prototype._static.setInterval(0);var lastTime=new Date().getTime()-60000;var newTime=lastTime+Math.floor((Math.random()*1.5+1.5)*1000);var clicks={"_boot_":lastTime};var name="";for(var i=1;i<=12;i++){newTime=lastTime+Math.floor((Math.random()*1.5+1.5)*1000);if(i<10){name="p0"+i}else{if(i===11){name="sat"+i}else{name="p"+i}}console.log(name);document.getElementsByName(name)[0].click();clicks[name]=newTime;lastTime=newTime}ntms.widget._AutoLabel.prototype._static.clicks=clicks;console.log(ntms.widget._AutoLabel.prototype._static.clicks);document.getElementsByName("advice01")[0].value="态度认真";document.getElementsByName("advice02")[0].value="无"}function xhrWrapper(payload,cb){dojo.xhrPost({url:"/ntms/service/res.do",handleAs:"json-comment-optional",headers:[],contentType:"application/json",load:function(data){cb(data)},sync:true,postData:dojo.toJson(payload),})}function setUID(result){uid=result.userId;var payload={"tag":"student_sch_dept","branch":"default","params":{"schId":result.defRes.school,"deptId":result.defRes.department,"egrade":null,"adcId":result.defRes.adcId}};xhrWrapper(payload,searchName)}function searchName(result){result.value.forEach(function(i){nameList.push(i.name)});console.log(nameList);var pattern1=$("#puzzle_1").innerHTML;var pattern2=$("#puzzle_2").innerHTML;var pattern="^"+pattern1+"(.)"+pattern2+"$";var regex=new RegExp(pattern);nameList.forEach(function(i){var res=regex.exec(i);if(res!=null){console.log(res);document.getElementById("dijit_form_TextBox_0").value=res[1]}})}var nameList=[];var uid;fuck();dojo.xhrPost({url:"/ntms/action/getCurrentUserInfo.do",handleAs:"json-comment-optional",load:function(data){setUID(data)},sync:true});

未压缩版

// 参考文章 https://0x.mk/?p=166

function fuck() {
    // 取消点击间隔
    ntms.widget._AutoLabel.prototype._static.setInterval(0);
    // 初始化时间
    var lastTime = new Date().getTime() - 60000;
    var newTime = lastTime + Math.floor((Math.random() * 1.5 + 1.5) * 1000);
    // 构造时间数据
    var clicks = {"_boot_": lastTime};
    // 点击答案
    var name = "";
    for(var i=1;i<=12;i++){
        newTime = lastTime + Math.floor((Math.random() * 1.5 + 1.5) * 1000);
        if(i<10){
            name = "p0"+i;
        }else if (i===11){
            name = "sat"+i;
        }else{
            name = "p"+i;
        }
        // 输出名称
        console.log(name);
        // 点击
        document.getElementsByName(name)[0].click();
        // 伪造时间
        clicks[name] = newTime;
        // 更新时间
        lastTime = newTime;
    }
    // 替换
    ntms.widget._AutoLabel.prototype._static.clicks = clicks;
    console.log(ntms.widget._AutoLabel.prototype._static.clicks);
    document.getElementsByName("advice01")[0].value = "态度认真";
    document.getElementsByName("advice02")[0].value = "无";
};



//找同学
function xhrWrapper(payload, cb){
    dojo.xhrPost({
        url: "/ntms/service/res.do",
        handleAs: "json-comment-optional",
        headers: [],
        contentType: "application/json",
        load: function(data){cb(data)},
        sync: true,
        postData: dojo.toJson(payload),
    });
}
function setUID(result){
    uid = result.userId;
    var payload = {
        "tag":"student_sch_dept",
        "branch":"default",
        "params":{
            "schId": result.defRes.school,
            "deptId": result.defRes.department,
            "egrade": null,
            "adcId": result.defRes.adcId
        }
    };
    //console.log(payload);
    xhrWrapper(payload, searchName);
}
function searchName(result){
    result.value.forEach(function (i){
        nameList.push(i.name)
    });
    console.log(nameList);
    var pattern1 = $("#puzzle_1").innerHTML;
    var pattern2 = $("#puzzle_2").innerHTML;
    var pattern = "^" + pattern1 + "(.)" + pattern2 + "$";
    var regex = new RegExp(pattern);
    nameList.forEach(function (i){
        var res = regex.exec(i);
        if(res != null){
            console.log(res);
            document.getElementById("dijit_form_TextBox_0").value = res[1];
        }
    })
}
var nameList = [];
var uid;
fuck();
dojo.xhrPost({
    url: "/ntms/action/getCurrentUserInfo.do",
    handleAs: "json-comment-optional",
    load: function(data){setUID(data)},
    sync: true
});
发表评论
暂无评论
textsms
account_circle
email
link
arrow_back 上一篇
arrow_forward 下一篇