Greasy Fork is available in English.
学习通批量改作业
当前为
// ==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*
// @match *://mooc1-1.chaoxing.com/work/batchMarkingScore*
// @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 *
// ==/UserScript==
"use strict";
var url=window.location.href;
window.setAllScore=function(){
//加编号
$("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("<option value=\"600\">600</option><option value=\"500\">500</option><option value=\"1000\">1000</option>");
$("#pageCount").val("1000");
searchWorkAnswerListBy();
///setTimeout( $.setAllScore() ,"2000");
setTimeout( window.setAllScore() ,"2000");
}
}////
function tryaddLinks(){
if(url.match(/getAllWork/g) ){
$("a:contains('查看')").each(function(){
var href=$(this).attr("href");
href=href.replace("reviewTheList","batchMarkingScore");
$(this).after('<a href="'+href+'"><span style="border:1px solid red">打分</span></a>');
});
}
}
//////////////////////////////////////////
$(function(){
tryaddLinks();
tryshowAlljobs();
});