SCORM CHEATER

Reveal all the answers!

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==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
    }