Giter Site home page Giter Site logo

Comments (2)

GuFFy12 avatar GuFFy12 commented on May 30, 2024

Also if i refresh the page with quiz, hook not work. To solve this problem, need to disable cache in browser dev tools.

from writeup-on-scorm-cheat.

Totsukawaii avatar Totsukawaii commented on May 30, 2024

Heya

I'm unsure what the issue is. But if you do not care about the correct answer and just want to get full marks I can suggest just modifying the function that allocates your score:

// ==UserScript==
...
// ==/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 = /k=h==f.selected\(\)\;f.selected\(\)\&\&\(a\+=g.score\(\)\)\;/
        temp = temp.replace(reg, 'k=true;(a+=g.score());');
        let newfunction = new Function(temp.substring(temp.indexOf('{')+1,temp.lastIndexOf('}')));
        newfunction();
        return;
    }
    return oldsplit.apply(this, arguments); // Use .apply to continue as normal
}

What I did was basically always add the full marks to your score. You can find the function using the regex k=h==f.selected\(\)\;f.selected\(\)\&\&\(a\+=g.score\(\)\)\; on your the unformatted quizplayer.js if you want to have a closer look at the function.

Let me know if it works.

Cheers! ~\(โ‰งโ–ฝโ‰ฆ)/~

from writeup-on-scorm-cheat.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.