重庆工程学院一键评教

onekey

当前为 2023-02-28 提交的版本,查看 最新版本

// ==UserScript==
// @name         重庆工程学院一键评教
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  onekey
// @description:zh-cn 一键评教
// @author       seesaw
// @match        https://zlpj.cqie.edu.cn/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=cqie.edu.cn
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';
    var i = 0
    var btns = []
    var check
    window.onload = function () {
        console.log("开始执行")
        const url = window.location.href
        if (url !== 'https://zlpj.cqie.edu.cn/#/education/teachevaluation/teachevaluationlist') {
            return
        }
        setTimeout(() => {
            btns = document.querySelectorAll(".firstbutton > button")
            console.log(btns)
            if (btns.length > 0) {
                clickBtn()
            }
        }, 2000);

    }
    function score() {
        const arr = []
        check = document.querySelectorAll(".el-radio__original")
        if (check.length > 0) {
            for (let j = 0; j < 50; j = j + 5) {
                check[j].click()
                arr.push(check[i])
            }
            const result = arr.filter(item => {
                return !item.checked
            })
            if (result.length !== 0) {
                //如果没有代表都选中了
                setTimeout(() => { submit() }, 2000)
            }
        }

    }

    function clickBtn() {
        if(btns === null || btns === undefined){
            alert("评教已完成")
            return
        }
        if (i <= btns.length) {
            btns[i].click()
            setTimeout(() => { score() }, 2000)
            i++
        }
    }

    function submit() {
        document.querySelectorAll(".fen > button")[0].click()
        setTimeout(() => { submit2() }, 3000)
    }

    function submit2(){
        document.querySelectorAll(".saveti")[0].click()
        setTimeout(() => { submit3() }, 3000)
    }

    function submit3(){
        document.querySelectorAll(".contupin")[0].click()
        setTimeout(() => { clickBtn() }, 3000)
    }

}) ();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址