Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The script is starting but the answers arent showing #17

Open
ludotavio opened this issue Mar 16, 2023 · 3 comments
Open

The script is starting but the answers arent showing #17

ludotavio opened this issue Mar 16, 2023 · 3 comments

Comments

@ludotavio
Copy link

Instead of showing the answers, it shows two error messages (corresponding to the answers):

Uncaught (in promise) DOMException: The user aborted a request.

can anyone help me?

@tykind
Copy link

tykind commented Mar 16, 2023

One of my friends wanted me to look at it; it seemed like a promise error. Pretty scuffed.

But here is a quick fix, just replace the window.fetch with the one below. (Tested in tamper monkey, chrome)

window.fetch = function() {
    return originalFetch.apply(this, arguments).then(async (res) => {
        if (res.url.includes("/getAssessmentItem")) {
            const clone = res.clone();
            const json = await clone.json()

            let item, question;

            try {
                item = json.data.assessmentItem.item.itemData;
                question = JSON.parse(item).question;
            } catch {
                let errorIteration = () => {
                    return localStorage.getItem("error_iter") || 0;
                }
                localStorage.setItem("error_iter", errorIteration() + 1);

                if (errorIteration() < 4) {
                    return location.reload();
                } else {
                    return console.log("%c An error occurred", "color: red; font-weight: bolder; font-size: 20px;");
                }
            }

            if (!question) return;

            Object.keys(question.widgets).map(widgetName => {
                switch (widgetName.split(" ")[0]) {
                    case "numeric-input":
                        return freeResponseAnswerFrom(question).log();
                    case "radio":
                        return multipleChoiceAnswerFrom(question).log();
                    case "expression":
                        return expressionAnswerFrom(question).log();
                    case "dropdown":
                        return dropdownAnswerFrom(question).log();
                }
            });
        }

        if (!window.loaded) {
            console.clear();
            console.log("%c Answer Revealer ", "color: mediumvioletred; -webkit-text-stroke: .5px black; font-size:40px; font-weight:bolder; padding: .2rem;");
            console.log("%cCreated by Alex Dubov (@adubov1)", "color: white; -webkit-text-stroke: .5px black; font-size:15px; font-weight:bold;");
            window.loaded = true;
        }

        return res;
    })
}

@Hedikamals360
Copy link

Hedikamals360 commented Mar 16, 2023

auzt1e

I tried this I replaced the window.fetch but it still doesnt work. Maybe its because I use tamper monkey but idk

@Kingsab15
Copy link

Doesn't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants