Majmaah University evaluation

Majmaah University evaluation script

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Majmaah University evaluation
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Majmaah University evaluation script
// @author       OSA
// @match        https://edugate.mu.edu.sa/mu/ui/student/student_evaluation/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=www.mu.edu.sa
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    const successSpan = document.getElementById("frm:errorMsg2");
    if (successSpan && successSpan.textContent.includes("تم التقييم بنجاح")) {
        console.log("Button clicked and success message found. Redirecting...");
        window.location.href = "https://edugate.mu.edu.sa/mu/ui/student/homeIndex.faces";
        window.location.href = "https://edugate.mu.edu.sa/mu/ui/student/student_evaluation/index/evaluationTypesIndex.faces";
    } else {
        console.log("Button clicked but success message not found. Skipping redirect.");
    }
    function getAllOptInputs() {
        return document.querySelectorAll('input[name^="opt"]');
    }
    const matchingElements = getAllOptInputs();
    for (const element of matchingElements) {
        if (element.name == "opt116" && element.value == "21733" ){
            element.checked = true;
            continue
        }
    else if (/32$/.test(element.value)) {
        console.log(element.value);
        element.checked = true;
    }}
   window.location.href = "javascript:submitForm('/mu')";
}
)();