I use Khan Academy a lot in my math teaching, and each of my students have a Google spreadsheet keeping track of their progress in the course. Every week I go through my students’ achievements on Khan Academy, and mark some spreadsheet cells green. I’ve managed to automate this pretty far, but it still takes some 20 minutes of repetitive work per class – with the included risk of manual errors.
A few weeks ago I learned that Khan Academy exposes information through an API, and I’ve been trying to make write a script in Google Drive that can talk to Khan Academy and make updates automatically.
I would really like to have such a script, for three reasons:
- Students would get quicker results from their work. This is good for motivation, and thus for learning.
- It would save me a lot of time – probably a bit more than an hour every week, plus the extra work I have to spend every now and then when I make mistakes in the manual procedures and have to revert and start over.
- I would feel that Khan Academy is so easy to work with that I would start looking into how I can contribute math exercises I’m missing.
I need help
If you could give me a hand on this, you have my sincere thanks.
What I have so far
- To get student data out of Khan Academy, you need a pair of keys. This is two-click procedure over at https://www.khanacademy.org/api-apps/register. (You also need an account at Khan Academy, to have some data to pull out.)
- Khan Academy uses OAuth 1.0. Required parameters are described here: https://github.com/Khan/khan-api/wiki/Khan-Academy-API-Authentication
- From some Google Drive document (such as a spreadsheet), you can use the class OAuthConfig to try to connect to Khan Academy. The actual request is handled by the class UrlFetchApp. (All of this is handled from tools > script editor.)
When I’ve tried this, I only get ”OAuth Error”. Possible problems, which I’ve been unable to solve/investigate properly.
- As far as I can tell, Google Drive scripts use OAuth 1.0A. I think this is compatible with 1.0 (required by Khan Acdemy), but this might be the source of the problems.
- I haven’t found a way to explicitly set the parameters required by Khan Academy. Maybe this is done automatically by the OAuthConfig object, maybe not.
I’ve looked a bit at the project KhanReporter, written in Python, that talks with both Khan Academy and Google Drive. Perhaps you can make more sense of it than I can.
If you’re interested in helping out, feel free to write a comment to this post. Thanks in any case.