// ==UserScript== // @name 批量改作业 // @namespace moe.canfire.flf // @version 1.0.0 // @description 学习通批量改作业 // @author mengzonefire // @license MIT // @compatible firefox Tampermonkey // @compatible firefox Violentmonkey // @compatible chrome Violentmonkey // @compatible chrome Tampermonkey // @contributionURL https://afdian.net/@mengzonefire // @match *://mooc1-1.chaoxing.com/work/getAllWork* // @resource jquery https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js // @resource sweetalert2Css https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css // @require https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.js // @require https://cdn.jsdelivr.net/npm/js-base64 // @require https://cdn.staticfile.org/spark-md5/3.0.0/spark-md5.min.js // @require https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js // @grant GM_setValue // @grant GM_getValue // @grant GM_deleteValue // @grant GM_setClipboard // @grant GM_xmlhttpRequest // @grant GM_info // @grant GM_getResourceText // @grant GM_addStyle // @grant unsafeWindow // @run-at document-start // @connect * // @downloadURL none // ==/UserScript== "use strict"; var url=window.location.href; function setAllScore(){ //加编号 $("tr").find("input[type='checkbox']").each(function(idx){ $(this).before((idx+1)+'、');}); //进入批量打分,自动选中所有已交且待批的人员,并随机打分85+1~3 var jobs=$("tr:contains('待批')"); $(jobs).find("input[type='checkbox']").attr("checked",'true'); $(jobs).find("input[type='text']").each(function(){ $(this).attr("value",85+Math.ceil(Math.random()*3)); }); toBatchUpdateScore();//保存得分 }// function tryshowAlljobs(){ if(url.match(/batchMarkingScore/g) ){ $("#pageCount").html(""); $("#pageCount").val("1000"); searchWorkAnswerListBy(); setTimeout("setAllScore()","3000"); } }//// window.tryaddLinks=function(){ if(url.match(/getAllWork/g) ){ alert(22); alert($("a:contains('查看')").length); $("a:contains('查看')").each(function(){ alert(231); var href=$(this).attr("href"); alert(232); href=href.replace("reviewTheList","batchMarkingScore"); alert(233); $(this).after('打分'); }); } } ////////////////////////////////////////// alert(1111); setTimeout("tryaddLinks();","2000"); tryshowAlljobs();