Greasy Fork

Greasy Fork is available in English.

南阳师范学院自动评教

自动执行评教流程

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         南阳师范学院自动评教
// @namespace    http://tampermonkey.net/
// @version      2025-6-3
// @description  自动执行评教流程
// @author       xiaoning
// @match        http://nysyjw.nynu.edu.cn/nysfjw/frame/homes.actions?v=*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=nynu.edu.cn
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // 检测iframe是否出现并执行操作
    function monitorIframeAndOperate(iframeId, callback) {
        const iframe = document.getElementById(iframeId);
        if (iframe) {
            iframe.onload = function() {
                const iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
                callback(iframeDocument);
            };
            // 确保iframe加载完成
            if (iframe.contentWindow.document.readyState === 'complete') {
                iframe.onload();
            } else {
                iframe.addEventListener('load', iframe.onload);
            }
        } else {
            setTimeout(() => monitorIframeAndOperate(iframeId, callback), 500);
        }
    }


    // 自动执行评价流程
    function autoEvaluate() {
        // 监测iframe出现并执行操作
        monitorIframeAndOperate('dialog-frame', function(iframeDocument) {
            // 在iframe内执行操作
            iframeDocument.querySelector("#pjxx0 > label:nth-child(2)").click();
            iframeDocument.querySelector("#pjxx1 > label:nth-child(2)").click();
            iframeDocument.querySelector("#pjxx2 > label:nth-child(2)").click();
            iframeDocument.querySelector("#pjxx3").click();
            iframeDocument.querySelector("#wdt_3_0_1").click();
            iframeDocument.querySelector("#wdt_4_0_1").click();
            iframeDocument.querySelector("#wdt_5_0_1").click();
            iframeDocument.querySelector("#wdt_6_0_1").click();
            iframeDocument.querySelector("#wdt_7_0_1").click();
            iframeDocument.querySelector("#wdt_8_0_1").click();
            iframeDocument.querySelector("#wdt_9_0_1").click();

           // 延迟3秒后提交表单
            setTimeout(() => {
                iframeDocument.querySelector("#butSave").click();
            }, 2000);
        });

    }

    // 执行自动评价流程
    autoEvaluate();
})();