Greasy Fork

Greasy Fork is available in English.

批量改作业

学习通批量改作业

当前为 2021-07-23 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==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('待批')");
   alert( jobs.length);
$(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);//关键之处,"xx()" 调用不到全局函数;使用非字符串,无括号;
  }
}////
 
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();
});