Skip to content

Instantly share code, notes, and snippets.

@qizhihere
Last active June 30, 2016 02:56
Show Gist options
  • Save qizhihere/3b6a3c90e85b6b115a24 to your computer and use it in GitHub Desktop.
Save qizhihere/3b6a3c90e85b6b115a24 to your computer and use it in GitHub Desktop.
关山口,懒人网上评教
function evalute() {
window.confirm = function(){ return true; };
var selects = document.querySelectorAll('#tdList td input[type="radio"][dj="01"]');
for (var i = 0; i < selects.length; i++) {
selects[i].click();
}
document.getElementById('yjjy').value = 'ok';
document.getElementById('SUB').click();
}
var readyStateCheckInterval = setInterval(function() {
if (document.readyState === "complete") {
// console.log('evalute action performed!');
evalute();
clearInterval(readyStateCheckInterval);
}
}, 100);
@qizhihere
Copy link
Author

qizhihere commented Jun 22, 2015

进入评教页面,点击评价,在弹出的新窗口中打开控制台( F12 - Console ),把上面的代码粘进去回车即可自动完成评教。默认全部选择 优秀,对应代码中的 dj="01",如果要修改为其他的,直接修改 dj="01" 为其他值即可。

加入到油猴子脚本中,就不用每次都复制到控制台运行了。

// ==UserScript==
// @name         懒人网上评教
// @namespace
// @version      0.1
// @description  easy online class evaluation
// @author       littleqz
// @match        http://curriculum.hust.edu.cn/wspj/awspj.jsp*
// @grant        none
// ==/UserScript==


function evalute() {
    window.confirm = function(){ return true; };

    var selects = document.querySelectorAll('#tdList td input[type="radio"][dj="01"]');
    for (var i = 0; i < selects.length; i++) {
        selects[i].click();
    }
    document.getElementById('yjjy').value = 'ok';
    document.getElementById('SUB').click();
}


var readyStateCheckInterval = setInterval(function() {
    if (document.readyState === "complete") {
        // console.log('evalute action performed!');
        evalute();
        clearInterval(readyStateCheckInterval);
    }
}, 100);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment