UCAS的SEP系统自动教评,此脚本能够帮助您自动评价,支持课程评价与教师评价
当前为
// ==UserScript==
// @name UCAS SEP 系统自动教评
// @namespace http://tampermonkey.net/
// @version 0.2.2
// @description UCAS的SEP系统自动教评,此脚本能够帮助您自动评价,支持课程评价与教师评价
// @author You
// @match http://jwxk.ucas.ac.cn/evaluate/course*
// @match http://jwxk.ucas.ac.cn/evaluate/teacher*
// @match http://jwxk.ucas.ac.cn/evaluate/evaluateTeacher/*
// @match http://jwxk.ucas.ac.cn/evaluate/evaluateCourse/*
// @require http://libs.baidu.com/jquery/1.8.3/jquery.min.js
// @grant none
// @license MIT
// ==/UserScript==
/*
介绍:
纯JS打卡脚本,能够自动化完成教评全五星好评
V0.1 2020年12月04日
手动点击需要评价的课程或老师,即可自动评价并且跳转到未评价系统界面。
V0.2 2020年12月04日
在教评界面, 点击帅气小哥头像, 即可实现全自动打卡
V0.2.1 2020年12月04日
bug修复
*/
(function() {
'use strict';
// 以下为代码
function handleClick() {
window.localStorage.setItem('zm-key', JSON.stringify({goon: 1}));
goonWithLocalStorage();
}
function goonWithLocalStorage() {
const dict = JSON.parse(window.localStorage.getItem('zm-key'));
if (!dict) {
return;
}
const code = dict.goon;
if (code) {
// 处理页面点击逻辑
const buttons = document.querySelectorAll('td a[class^="btn"]');
// buttons[1].innerText = '1111';
const n_btn = Array.from(buttons)
.filter((x) => {return x.innerText.indexOf('修改评估')});
if (n_btn && n_btn[0]) {
n_btn[0].click();
} else {
window.localStorage.setItem('zm-key', JSON.stringify({goon: 0}));
}
setTimeout(() => {
alert('整活完毕');
}, 3000);
return;
}
}
window.handleClick = handleClick;
// 前期教评, 均5分
$(document).ready(() => {
if ( window.location.href.indexOf('evaluate/course') + 1 ||
window.location.href.indexOf('evaluate/teacher') + 1 ) {
let title = document.getElementsByClassName('span12');
if (!title) {
window.alert('出错了');
return;
}
// 添加❤按钮
title = title[0];
title.style = 'height: 75px; line-height: 75px;';
title.firstElementChild.style = "float:left; line-height: 75px;";
const btn = document.createElement('div');
btn.style = 'float: right; top -10px; padding-right: 30px;';
btn.innerHTML = '<button style="border: 0;" onclick="handleClick()"><img width=75px src="http://qiniu.chiyumao.com/upic/2020/12-04-20-20-45-1607084445905.jpg" /></button>';
title.appendChild(btn);
// 加载完毕后开启循环
goonWithLocalStorage();
} else {
console.log('开始教评.....');
const lst1 = document.querySelectorAll('[name^="item_"][value="5"]');
console.log(lst1);
for(let i=0; i<lst1.length; i++) {
lst1[i].checked = true;
}
// 五个意见栏
const ta = document.querySelectorAll('textarea[name^="item_"]');
for(let i=0; i<ta.length; i++) {
const text = window.location.href.indexOf('evaluateTeacher')+1 ?
"治学严谨、备课充分、讲课认真、因材施教" :
"课程与作业(包括作业、报告、测验测试、论文等)有助于我的能力的提高";
ta[i].innerText=text;
}
if (window.location.href.indexOf('evaluateCourse')+1) {
// 教室情况和舒适度
document.querySelectorAll('input[name^="radio_"]')[0].checked=true;
// 修读原因
document.querySelectorAll('input[name^="item_"][type="checkbox"]')[0].checked=true;
}
// 点击提交按钮
// document.getElementById('sb1').click();
}
})
})();