Wednesday, 8th February 2012
Experimenting with the Khan Academy API
In the last month or so, I've managed to more than triple the number of Earth badges I have on Khan Academy just by focussing on the exercises for which I could get the Sub-light Speed and 299,792,458 Meters per Second badges. I worked out which on exercises to focus by creating a spreadsheet of all the exercises and all the badges I had for associated with each exercise. I filled out the spreadsheet with a combination of screen-scraping and manual data-entry.
And after that, I wondered if there was an API for the Khan Academy, and of course there is. You can find out about it here. Using the API you can find out all sorts of useful information. Using the oauth example, you can get your personal information on Khan Academy, to find out, for example how many hours of video you've watched and how many questions you've attempted.
Playlist times
Using the API, you can get a list of all the videos in each playlist and how long each lasts using, so you can work out how long each playlist is. You can also add all these together to get the total length of videos on Khan Academy (which, at present, is 19 days and four and half hours), although that's a slight overestimate as it will count videos in multiple playlists multiple times.
I've been also been experimenting with Google App Engine, and so far I've managed to make a very ugly table of Khan Academy playlist times, which you can see at: http://whatbadgenext.appspot.com/. It's not a hugely useful table, but it's interesting to see that there are 16 playlists for which you can get the Ludicrous Listener badge (assuming you don't rewatch any videos). I'm quite pleased to see that Linear Algebra is the longest playlist and was the first I watched all the way through. It's slightly scary to think that it's nearly a day and a half of video though. [Update - a day later 46 more hours was added to Core Algebra, including some of linear algebra, so it is now top with over two and a half days of video.]
The page may take a while to load because it's quite inefficient and makes a new API call every time you visit the page. The reason for the URL is that I'm hoping to make an app that can tell you which badges you are closest to achieving, but first I need to sort out how to get OAuth to work on Google App Engine.
Using the OAuth example manually, I was able to find in which playlist I'm closest to getting a new Listener badge. I also discovered that, at the time of writing, I've watched nearly a week of videos on Khan Academy and done just over 28000 exercises. Which seems a lot.
Exercise Speeds
One question I've often wondered is how fast I need to answer exercises on Khan Academy to get one of the speed badges (Picking Up Steam etc.). The answer is within the API and I've attached a text file with the list of times (as they currently stand) to the bottom of this post. [Updated version at: http://whatbadgenext.appspot.com/exercise_times]. This information will be essential for working out which badges are easily achievable, and which require more work. The most time consuming questions are the rate and kinematic problems, and various solving systems of equations exercises.
It's also interesting to note that the shortest times are for the exercises Proportions 1 and Proportions 2, which, as I write, are the newest exercises. This confirms what I had suspected, which is that it's almost impossible to get the speed badges for new exercises. Presumably, they wait until a sufficient number of people have tried the exercises so they can work out a suitable time. So many times, I've tried in vain to get a speed badge on a new, easy exercise, but failed even if I answer as quick as I can type.
Something else I noticed after getting this information is that you don't necessarily get the speed badges even if you have completed the exercises within the time, sometimes you need to get them all in a single session. For example, even though I had previously done 60 exercises within the time limit, I still had to do another 75 before I got the 299,792,458 Meters per Second badge, even though these were done at the same time. I suspect this has something to do with when the program actually checks to see whether you've completed enough exercises, or maybe the streak is reset if the time limits are reset.
| Attachment | Size |
|---|---|
| exercise_speeds.txt | 8.28 KB |
Comments
There is another point earner which you have missed Peter. For watching a video, you receive 750 points. The points scored are the same for every video, regardless of length. So watching a 2 minute video scores you the same points as watching a 20 minute video. So in theory, if you were able to identify the play time of each individual video via the api, you could speed up your point earnings by watching the shortest videos first.
That's a good point. I could make a list of the shortest videos relatively easily. What I've done so far is more focused on badges than points.
Post new comment