// ==UserScript== // @name SDU本科生院教务系统助手 // @namespace http://tampermonkey.net/ // @version 0.2 // @description try to take over the world! // @author You // @match http://bkjws.sdu.edu.cn/f/common/main // @icon https://www.google.com/s2/favicons?domain=. // @grant GM_getValue // @grant GM_setValue // ==/UserScript== (function() { 'use strict'; // Your code here... if(GM_getValue("zdpj") != false){ GM_setValue("zdpj", true) } var wfzjd = {"2017-1": 0, "2017-2": 0, "2018-1": 0, "2018-2": 0, "2019-1": 0, "2019-2": 0, "2020-1": 0,"2020-2": 0, "2021-1": 0,"2021-2": 0, "2022-1": 0,"2022-2": 0,} var xf = {"2017-1": 0, "2017-2": 0, "2018-1": 0, "2018-2": 0, "2019-1": 0, "2019-2": 0, "2020-1": 0,"2020-2": 0, "2021-1": 0,"2021-2": 0, "2022-1": 0,"2022-2": 0,} var AutoView = true var total_xf = 0 var total_wfzjd = 0 if(GM_getValue("pjjy") == null){ console.log("没有找到自定义评价建议,将使用默认评价建议") } var appendScriptUnitVar = setInterval(function(){appendScriptUnit()}, 10) setInterval(function(){ if(GM_getValue("zdpj") == true){ viewAll() rapidSubmit() } }, 10) function appendScriptUnit(){ if(document.querySelector('body > div.page-container > div.page-sidebar.nav-collapse.collapse > ul > li:nth-child(5)') != null){ var cloneUnit = document.querySelector('body > div.page-container > div.page-sidebar.nav-collapse.collapse > ul > li:nth-child(5)') var Unit = cloneUnit.cloneNode(true) var ul = document.querySelector("body > div.page-container > div.page-sidebar.nav-collapse.collapse > ul") ul.appendChild(Unit) document.querySelector('body > div.page-container > div.page-sidebar.nav-collapse.collapse > ul > li:nth-child(10) > a > span.title').innerHTML = "脚本设置" var AutoViewSetting = document.querySelector('body > div.page-container > div.page-sidebar.nav-collapse.collapse > ul > li:nth-child(10) > ul > li:nth-child(1) > a') if(GM_getValue("zdpj") == false){ AutoViewSetting.innerHTML = "自动评教设置:关" } else{ AutoViewSetting.innerHTML = "自动评教设置:开" } AutoViewSetting.removeAttribute("href") AutoViewSetting.removeAttribute("class") AutoViewSetting.addEventListener("click", AutoViewSettingPage) var enquireGPA = document.querySelector('body > div.page-container > div.page-sidebar.nav-collapse.collapse > ul > li:nth-child(10) > ul > li:nth-child(2) > a') enquireGPA.innerHTML = "绩点查询" enquireGPA.removeAttribute("href") enquireGPA.removeAttribute("class") enquireGPA.addEventListener("click", function(){enquireGPAPage1(); enquireGPAPage2()}) document.querySelector('body > div.page-container > div.page-content > div').innerHTML = '
1.进入评教界面后自动填充
2.点击[脚本设置]-[自动评教设置]可以开启或关闭自动评教
' var cloneLi = document.querySelector('body > div.page-container > div.page-sidebar.nav-collapse.collapse > ul > li:nth-child(10) > ul > li:nth-child(2)') var Li_input_pjjy = cloneLi.cloneNode(true) var ul2 = document.querySelector('body > div.page-container > div.page-sidebar.nav-collapse.collapse > ul > li:nth-child(10) > ul') ul2.appendChild(Li_input_pjjy) document.querySelector('body > div.page-container > div.page-sidebar.nav-collapse.collapse > ul > li:nth-child(10) > ul > li:nth-child(3) > a').innerText = "自定义评教建议" Li_input_pjjy.addEventListener("click", function(){input_pjjy()}) clearInterval(appendScriptUnitVar) } } function AutoViewSettingPage(){ var AA = document.querySelector('body > div.page-container > div.page-sidebar.nav-collapse.collapse > ul > li.open > ul > li:nth-child(1) > a') if(GM_getValue("zdpj") == false){ AA.innerText = "自动评教设置:开" GM_setValue("zdpj", true) } else{ AA.innerText = "自动评教设置:关" GM_setValue("zdpj", false) } } function enquireGPAPage1(){ console.log(xf) var http = new XMLHttpRequest() var url = 'http://bkjws.sdu.edu.cn/b/cj/cjcx/xs/lscx' var params = 'aoData=[{"name":"sEcho","value":2},{"name":"iColumns","value":10},{"name":"sColumns","value":""},{"name":"iDisplayStart","value":0},{"name":"iDisplayLength","value":-1},{"name":"mDataProp_0","value":"xnxq"},{"name":"mDataProp_1","value":"kch"},{"name":"mDataProp_2","value":"kcm"},{"name":"mDataProp_3","value":"kxh"},{"name":"mDataProp_4","value":"xf"},{"name":"mDataProp_5","value":"kssj"},{"name":"mDataProp_6","value":"kscjView"},{"name":"mDataProp_7","value":"wfzjd"},{"name":"mDataProp_8","value":"wfzdj"},{"name":"mDataProp_9","value":"kcsx"},{"name":"iSortCol_0","value":5},{"name":"sSortDir_0","value":"desc"},{"name":"iSortingCols","value":1},{"name":"bSortable_0","value":false},{"name":"bSortable_1","value":false},{"name":"bSortable_2","value":false},{"name":"bSortable_3","value":false},{"name":"bSortable_4","value":false},{"name":"bSortable_5","value":true},{"name":"bSortable_6","value":false},{"name":"bSortable_7","value":false},{"name":"bSortable_8","value":false},{"name":"bSortable_9","value":false}]' http.open('POST', url, true) http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8') http.onreadystatechange = function() { if(http.readyState == 4 && http.status == 200) { var resp1 = http.responseText var obj = JSON.parse(resp1) //console.log(obj.object.aaData['0'].wfzjd) for(var i = 0; i