SCORM CHEATER

Reveal all the answers!

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         SCORM CHEATER
// @namespace    https://myleo.rp.edu.sg/SCORM/Home/
// @version      0.4
// @description  Reveal all the answers!
// @author       SUPA HAKKA
// @match        https://myleo.rp.edu.sg/SPStorage/ShareFolder/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
// @grant        none
// @run-at document-start
// @license GNU GPLv3
// ==/UserScript==


    let count = 0;
    const oldsplit = window.String.prototype.split; // Grab original function
    window.String.prototype.split = function(){ // Redefine the function
        if (typeof arguments.callee.caller.caller == 'function' && arguments.callee.caller.caller.toString().includes("reviewWithCorrectAnswers") && count == 0) {
            count = 1;
            let temp = arguments.callee.caller.caller.toString();
            const reg = /var c=[A-Za-z][A-Za-z]\(a\)\,d\=[A-Za-z][A-Za-z]\(c\.settings\(\)\)\;/
            temp = temp.replace(reg, 'return "reviewWithCorrectAnswers";');
            let newfunction = new Function(temp.substring(temp.indexOf('{')+1,temp.lastIndexOf('}')));
            newfunction();
            return;
        }
        return oldsplit.apply(this, arguments); // Use .apply to continue as normal
    }