Greasy Fork is available in English.
2022/3/27 21:09:54
当前为
// ==UserScript==
// @name MOOC,自动互评 - icourse163.org
// @match https://www.icourse163.org/learn/*
// @match https://www.icourse163.org/spoc/learn/*
// @namespace zhufn.fun
// @grant none
// @version 1.3.1
// @author cover(@zhuufn)
// @description 2022/3/27 21:09:54
// @license gpl-3.0
// ==/UserScript==
(function() {
'use strict';
window.pingfen = function() {
let praise = ['好', '完美', 'good', 'beautiful', '满分', '你字写的也太好看了吧!']
var a = document.getElementsByClassName('s')
for (let i = 0; i < a.length; ++i)
{
a[i].children[a[i].children.length-1].children[0].checked = true
}
var b = document.getElementsByTagName("textarea")
for (let i = 0; i < b.length; ++i) {
b[i].value = praise[Math.floor(Math.random()*6)]
}
}
function fuck() {
let save_btn = document.getElementsByClassName('j-submitbtn')[0]
let a_tag = document.createElement('a')
a_tag.innerText='👻互评'
a_tag.className="u-btn u-btn-default f-fl"
a_tag.onclick=window.pingfen
save_btn.parentElement.insertBefore(a_tag, save_btn)
}
function runWhenReady(readySelector, callback) {
var numAttempts = 0;
var tryNow = function() {
var elem = document.querySelector(readySelector);
if (elem) {
callback(elem);
} else {
numAttempts++;
if (numAttempts >= 34) {
console.warn('Giving up after 34 attempts. Could not find: ' + readySelector);
} else {
setTimeout(tryNow, 250 * Math.pow(1.1, numAttempts));
}
}
};
tryNow();
}
runWhenReady(".j-evaluate", fuck)
// Your code here...
})();