ScoreTeacher

Score teacher automically

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         ScoreTeacher
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Score teacher automically
// @author       EugeneLiu
// @match        https://zhjw.neu.edu.cn/*
// @grant        none
// @run-at       document-idle
// ==/UserScript==

(function() {
function sleep(ms){
  return new Promise((resolve)=>setTimeout(resolve,ms));
}
async function score(){
  localStorage.clear();
  var temple=await sleep(6000);
  var iframe2 = document.getElementsByTagName('iframe');
    console.log(iframe2);
if(iframe2 == null || iframe2 == '' || iframe2 == undefined || iframe2 == 'undefined'){
    return;
} else {
var obj = iframe2[0].contentWindow.document.getElementsByTagName("input");
var count = 0;
    for(var i=0; i<obj.length; i ++){
        if(obj[i].type == 'radio'){
			if(count == 1){
				if(obj[i].value == 75){obj[i].checked = "checked";  }
				count ++;
				continue;
			}
            if(obj[i].value == 85){
			count++;
			obj[i].checked = "checked";  }
        }
    };
    obj = iframe2[0].contentWindow.document.getElementsByTagName("input");
    count = 0;
    for( i=0; i<obj.length; i ++){
        if(obj[i].name == 'btSaveScore'){
			obj[i].click();
        }
    };
}
  return temple
}

score();


})();