Greasy Fork

Greasy Fork is available in English.

AMU安徽医科大学教务系统助手

安徽医科大学登录页面自动输入密码,教师评价界面按回车键自动评价

当前为 2022-01-05 提交的版本,查看 最新版本

// ==UserScript==
// @name         AMU安徽医科大学教务系统助手
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  安徽医科大学登录页面自动输入密码,教师评价界面按回车键自动评价
// @author       Yuhang Shang
// @match        *://jwgl.ahmu.edu.cn/eams/*
// @icon         https://www.shangyuhang.icu/favicon/64_64.ico
// @grant        none
// @supportURL   [email protected]
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    //=======================================
    //    请在此填写您的账号和密码
    //=======================================
    var your_username='你的账号';
    var your_password='你的密码';

    //全局变量
    var StudentEvalutionURL="jwgl.ahmu.edu.cn/eams/homeExt.action";
    var StudentLoginURL="jwgl.ahmu.edu.cn/eams/loginExt.action";

    //学生登录系统
    var windowURL = window.location.href;
    if (windowURL.indexOf(StudentLoginURL) != -1) {
        document.querySelector('#loginForm span').textContent='账号密码已经帮你填好啦O(∩_∩)O'
        document.querySelector('#username').value=your_username;
        document.querySelector('#password').value=your_password;
    }

    //评教系统

    //键盘监听事件(因为脚本需要在网页完全加载完毕注入,所以需要设为全局事件)
    document.addEventListener('keydown', my);
    function my(e){
        if(e.keyCode==13){//回车键的keyCode是13
            write();
            document.querySelector('#sub').click();
        //window.alert("press");
        }
    }

    //自动评价功能
    function write(){
       let radios=document.getElementsByClassName("option-radio");
       for (let i = 0; i < radios.length; i=i+5) {
        radios[i].checked=true;
       }
    }

})();