Khan / khan-api

Documentation for (and examples of) using the Khan Academy API
http://www.khanacademy.org
378 stars 74 forks source link

Get all users attempted exercises. #85

Closed dasqueel closed 9 years ago

dasqueel commented 9 years ago

The only way seems to call /api/v1/user/exercises, loop through EVERY exercise and if 'total_done' > 0, append that exercise to a list. However this method takes a minute or two to complete.

There surely has be a quicker way. I would assume calling /api/v1/user would return a list of users attempted exercises, but it doesn't. Would it be possible to add that information to the /api/v1/user call?

alangpierce commented 9 years ago

Sorry for taking so long to get to this.

I believe you should be able to get what you need using the (undocumented) progress_summary endpoint: /api/v1/user/progress_summary?kind=Exercise

This returns a "progress key" for each exercise the user has started or completed. It looks like you should be able to cross-reference with the "progress_key" field in /api/v1/exercises in order to map the progress_summary element back to the full exercise information.

Generally, we try to avoid putting progress information on /api/v1/user, since we want to keep it from getting too big.

I'll try to add documentation for progress_summary when I get a chance.