Skip to content

Instantly share code, notes, and snippets.

@mexitek
Created September 11, 2011 01:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mexitek/1209039 to your computer and use it in GitHub Desktop.
Save mexitek/1209039 to your computer and use it in GitHub Desktop.
Khan Academy Bookmarklet that is meant to automatically answer your current question correctly. Simply copy and paste this code into a new bookmark.
javascript:
/* Build URI endpoint for Khan API */
var url="/api/v1/user/exercises/"+userExercise.exercise+"/problems/"+(userExercise.total_done+1)+"/attempt";
/* Slowly, but surely, collecting the data for a successfull API call */
var data={
complete:1,
count_hints:0,
time_taken:Math.floor(Math.random()*10),
attempt_number:userExercise.total_done+1,
attempt_content:777, /* <-- Need to find the correct answer */
sha1:userExercise.exercise_model.sha1,
seed:KhanUtil.getPrime(), /* <-- Need to find correct seed for current problem */
problem_type:0
};
/* Ping the Mothership */
$.post(url,data);
@mexitek
Copy link
Author

mexitek commented Sep 11, 2011

There is a good explanation about how/why the "seed" attribute is used here: http://ejohn.org/blog/random-khan-exercises/

@Mustafa2Ozak
Copy link

BRO IT DONT EVEN WORK :(

@mexitek
Copy link
Author

mexitek commented May 9, 2023

It's 12 years old. Haven't tried this in a long time. 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment