A comment on A review on Bypass All Shortlinks by GABRIELZINHO__01 was reported 2024-11-05 for Spam
// ==UserScript==
// @name proxies moddified khan hack
// @version 3.9
// @description Here Is A Moddifed Version Of Khan Hack
// @author proxyleft
// @match https://www.khanacademy.org/*
// @grant none
// @namespace https://greasyfork.org/users/783447
// ==/UserScript==
// @license MIT
(function () {
let overlayHTML = `
ToggleReset Answer List KhanHack
-Answers-
M also toggles Menu
`
function get(x) { return document.getElementById(x); }
let overlay = document.createElement("div");
overlay.innerHTML = overlayHTML;
document.body.appendChild(overlay);
let acc = get("accordian"),
darkToggle = get("darkToggle"),
ansbutton = get("inputans"),
ansbutton2 = get("inputans2")
acc.onclick = function() {
let panel = get("box2");
let acc = get("accordian")
if (panel.style.display == "grid") panel.style.display = "none";
else { panel.style.display = "grid";}
}
document.addEventListener('keydown', (event) => {
if (event.key === 'm') {
let panel = get("box2");
if (panel.style.display == "grid") panel.style.display = "none";
else { panel.style.display = "grid"; }
}
});
'use strict';
window.loaded = false;
class Answer {
constructor(answer, type) {
this.body = answer;
this.type = type;
}
get isMultiChoice() {
return this.type == "multiple_choice";
}
get isFreeResponse() {
return this.type == "free_response";
}
get isExpression() {
return this.type == "expression";
}
get isDropdown() {
return this.type == "dropdown";
}
log() {
const answer = this.body;
answer.map(ans => {
if (typeof ans == "string") {
if (ans.includes("web+graphie")) {
this.body[this.body.indexOf(ans)] = "";
this.printImage(ans);
} else {
answer[answer.indexOf(ans)] = ans.replaceAll("$", "");
}
}
});
}
}
const originalFetch = window.fetch;
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;
item = json.data.assessmentItem.item.itemData;
question = JSON.parse(item).question;
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();
window.loaded = true;
}
return res;
})
}
let curAns = 1
function freeResponseAnswerFrom(question) {
const answer = Object.values(question.widgets).map((widget) => {
if (widget.options?.answers) {
return widget.options.answers.map(answer => {
if (answer.status == "correct") {
var parNumCurAns = "parNum" + curAns
var createPar = document.createElement('section')
createPar.innerHTML = answer.value
document.getElementById('ansBreak').append(createPar)
curAns++
}
});
}
}).flat().filter((val) => { return val !== undefined; });
return new Answer(answer, "free_response");
}
function multipleChoiceAnswerFrom(question) {
const answer = Object.values(question.widgets).map((widget) => {
if (widget.options?.choices) {
return widget.options.choices.map(choice => {
if (choice.correct) {
var parNumCurAns = "parNum" + curAns
var createPar = document.createElement('section')
createPar.innerHTML = choice.content
document.getElementById('ansBreak').append(createPar)
curAns++
}
});
}
}).flat().filter((val) => { return val !== undefined; });
return new Answer(answer, "multiple_choice");
}
function expressionAnswerFrom(question) {
const answer = Object.values(question.widgets).map((widget) => {
if (widget.options?.answerForms) {
return widget.options.answerForms.map(answer => {
if (Object.values(answer).includes("correct")) {
var parNumCurAns = "parNum" + curAns
var createPar = document.createElement('section')
createPar.innerHTML = answer.value
document.getElementById('ansBreak').append(createPar)
curAns++
}
});
}
}).flat();
return new Answer(answer, "expression");
}
function dropdownAnswerFrom(question) {
const answer = Object.values(question.widgets).map((widget) => {
if (widget.options?.choices) {
return widget.options.choices.map(choice => {
if (choice.correct) {
var parNumCurAns = "parNum" + curAns
var createPar = document.createElement('section')
createPar.innerHTML = choice.content
document.getElementById('ansBreak').append(createPar)
curAns++
}
});
}
}).flat();
return new Answer(answer, "dropdown");
}
})();
GABRIELZINHO__01Banned (the reported user) has made:
This report has been upheld by a moderator.