// ==UserScript== // @name 超星学习通教师后台加强 // @namespace http://teachroot.com/ // @version 0.20 // @description 针对超星学习通教师后台一些功能进行了优化,方便判卷、分析、预览. // @require https://cdn.staticfile.org/jquery-cookie/1.4.1/jquery.cookie.min.js // @author 辽经职院 冯涛 // @match https://mooc1-1.chaoxing.com/exam/* // @match https://mooc1-1.chaoxing.com/work/* // @match https://mooc1-1.chaoxing.com/scoreAnalysis/toSetWeights* // @match https://mooc1-1.chaoxing.com/moocAnalysis/analysisScore* // @match https://mooc1.chaoxing.com/exam/test/toReVersionPublishAndExamSet* // @grant GM_setValue // @grant GM_getValue // @run-at document-end // @downloadURL none // ==/UserScript== (function() { 'use strict'; //补考名单批量选择(文本区域内输入多个学生学号,每行一人) if(window.location.pathname=="/exam/test/toReVersionPublishAndExamSet"){ let $stulab=$("请输入补考学生学号,每行一条 "); let $cleartext=$(""); let $stus=$(""); let $add=$(""); let $error=$(""); $("#classDiv").after($error); $("#classDiv").after($add); $("#classDiv").after($stus); $("#classDiv").after($stulab); $("#cleartext").click(function(){ $("#stus").val(""); var checkBoxList = $("#allstu").find("input[type='checkbox']"); checkBoxList.each(function (index, thisObject) { $(thisObject).attr("checked", false); }); }); $("#addstus").click(function(){ $("#error").empty(); let students=$("#stus").val(); //console.log(students); let arrstus=[]; arrstus=students.split(/[(\r\n)\r\n]+/); $.each(arrstus,function(i,e){ if($.trim(e)==""){ return true } let findResult=false; $("#allstu").children().each(function(idx,obj){ let td=$(obj).children("td")[1]; if($.trim( $(td).text() )==$.trim(e) ){ $(obj).find("input[type='checkbox']").attr("checked", "checked"); findResult=true; } }); if(!findResult){ $("#error").prepend(""); } }); }) } //快速预览试题(资料-》题库)20200711 if(window.location.pathname=='/exam/search'){ //获取各试题url window.currentQuestionIndex=-1; let tr= $("#tableId>tr:gt(0)"); var tagA= $(tr).find("td:eq(1)").children("a"); tagA.each( function(i, e){ let url=$(e).attr("href"); $(e).attr("id","question_" + i); $(e).attr("data-href",url); $(e).attr("href","javascript:void(0);"); $(e).removeAttr("target"); $(e).on("click",function(){ $('#reviewFrame').attr('src', url); $(e).css('font-weight','bold'); currentQuestionIndex=i; $('#myreviewWindow').show(); }); }); //定义弹出框 let reviewWindow='
\
\ \
\
\