Skip to content

Instantly share code, notes, and snippets.

@nomomon
Last active September 3, 2021 05:15
Show Gist options
  • Save nomomon/cb27f521ea45c352bb74eae0780f00d4 to your computer and use it in GitHub Desktop.
Save nomomon/cb27f521ea45c352bb74eae0780f00d4 to your computer and use it in GitHub Desktop.
Bookmarklet to get answers to Khan Academy math problems
(function(ns, fetch){
if(typeof fetch !== 'function') return;
console.log("🌱%c Khan Academy%c Hack is%c ON %c \nBy: https://github.com/nomomon", "text-shadow: 0.5px 0.5px 0 black, -0.5px -0.5px 0 black; color: white;", "color:black;", "color:green;", "color:black;");
ns.fetch = function(){
var out = fetch.apply(this, arguments);
out.then(res =>{
if(res.url.indexOf("getAssessmentItem")+1){
res.clone().json().then(data => {
console.log(JSON.parse(data.data.assessmentItem.item.itemData).question)
})
}
});
return out;
}
}(window, window.fetch))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment