-
Notifications
You must be signed in to change notification settings - Fork 44
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
Answer Revealer userscript deprecated #15
Labels
bug
Something isn't working
Comments
Looks like khan academy may have patched it, as I converted the bookmarklet into a console command and ran it, and Khan Academy just reloaded. This is what I used - if (typeof originalParse === "undefined") {
window.originalParse = JSON.parse;
}
JSON.parse = function (t, e) {
let n = originalParse(t, e);
try {
const itemData = JSON.parse(n.data.assessmentItem.item.itemData);
const isPT = location.hostname.split(".")[0] === "pt";
if (itemData.question && itemData.question.content &&
itemData.question.content[1] === itemData.question.content[1].toUpperCase()) {
console.log(itemData);
itemData.question.content += "\n [[☃ explanation 3]] [[☃ explanation 4]]";
itemData.question.widgets["explanation 3"] = {
alignment: "default",
graded: true,
options: {
explanation: itemData.hints[itemData.hints.length - 1].content,
hidePrompt: isPT ? "Ocultar" : "Hide",
showPrompt: isPT ? "Resposta" : "Answer",
static: false,
widgets: itemData.hints[itemData.hints.length - 1]
}
};
itemData.question.widgets["explanation 4"] = {
options: {
explanation: "discord.gg/khanacademy",
hidePrompt: "",
showPrompt: "Discord"
}
};
n.data.assessmentItem.item.itemData = JSON.stringify(itemData);
}
} catch (error) {
console.error("Error parsing lesson data:", error);
}
return n;
};
location.softReload = () => {
const htmlContent = document.getElementsByTagName("html")[0].outerHTML;
document.open();
document.write(htmlContent);
document.close();
};
location.softReload();
console.error = function () {}; |
I found the userscript i was using, I was using @DoxrGitHub 's // ==UserScript==
// @name Khan answer revealer
// @version 1.0
// @description Khan hack
// @author IlyTobias (github@ilytobias)
// @match https://www.khanacademy.org/*
// @grant none
// ==/UserScript==
let n = JSON.parse;
JSON.parse = function (t) {
let e = n(t);
try {
let t = JSON.parse(e.data.assessmentItem.item.itemData);
t.question.content = t.question.content + "[[☃ explanation 2]]";
console.log(t);
t.question.widgets["explanation 2"] = {
alignment: "default"
, graded: true
, options: {
explanation: t.hints[t.hints.length - 1].content
, hidePrompt: "Hide"
, showPrompt: "Answer"
, static: false
, widgets: t.hints[t.hints.length - 1].widgets
}
, static: false
, type: "explanation"
, version: {
major: 0
, minor: 0
}
};
e.data.assessmentItem.item.itemData = JSON.stringify(t)
} catch (t) {}
return e
} This returns a crash screen now On math it returns a full white crash [uh-oh] screen |
Upup!! He's right. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Khan Academy gives a crash message when the user script is on, I then tried to update the user script to the latest version but tamper monkey simply says it's not a valid user script. I see you updated the bookmarklet a few hours ago, but I am on the arc browser, rendering bookmarklets useless. Please update the userscript
Steps to reproduce
Are you stupid
yeah probably
Operating System
Windows
Browser
Arc Browser
Before submitting a bug report
This bug wasn't already reported (I have searched bug reports on GitHub).
This is a valid bug (I am able to reproduce this on the latest build).
The text was updated successfully, but these errors were encountered: