// ==UserScript== // @name 自动批改超星作业 // @namespace http://tampermonkey.net/ // @version 0.12 // @description 自动批改超星作业,以自定义score数组中的概率打分,并提交下一份 // @author aYan // @match https://mooc1.chaoxing.com/* // @match https://mooc1-1.chaoxing.com/* // @grant none // @downloadURL none // ==/UserScript== // function here // 重载批改函数,取消页面的confirm对话框 function pigai(back){ $("#back").val(back); var a = "88286357,88286358,"; $("#answerwqbid").val(a); var dengji = $("#dengji").val(); var tmpScore = $("#tmpscore").val(); tmpScore = tmpScore.replace(/\s+/g, ""); $("#score").val(tmpScore); var score = $("#score").val(); var fullScore = $("#fullScore").val(); if(score.length == 0){ alert("请输入分数。"); return; } if(score < 0){ alert("分数不能小于0。"); return; } if(Number(score) > Number(fullScore)){ alert("分数不能超过满分" + fullScore); return; } if(isNaN(score)){ alert("分数只能是数字!"); return; } if(Number(score)==0){ if(window.confirm("总分为0,确认要提交批阅结果吗?")){ setCompoundSubjectQuesScore(); setCompoundSubjectQuesComment(); formSubmit(); }else{ return false; } }else{ if(1){ setCompoundSubjectQuesScore(); setCompoundSubjectQuesComment(); formSubmit(); } } } (function score() { // 定义分数轮盘 var score = [90,90,90,90,90,90,90,85,95,100] // 按ID获取分数框元素 var divA = document.getElementById("tmpscore"); // 按轮盘概率填充分数 divA.value=score[Math.floor(Math.random()*10)]; // 超星的批改函数,延时自定义(最大值↓ 最小值↓,单位:毫秒) setTimeout(pigai, Math.random() * (1000) + 100); })();