Closed capecodcid closed 9 years ago
Hi, sorry for the delay in responding to this. The problem here is that /api/v1/user/exercises
was written a long time ago when we didn't have nearly as many exercises as we have today. When you don't specify the exercises
parameter, it tries to load progress information for ALL exercises, even ones you've never attempted. Over time, we've added more and more exercises to the site, and now the response size is so large that it's hitting our server response size limits.
One workaround for now is that you can query for progress in a specific set of exercises by including the exercises
parameter multiple times, like this:
/api/v1/user/exercises?exercises=counting-objects&exercises=count-from-any-number
However, some OAuth libraries have trouble with repeated parameters, so you may run into problems with this approach.
I'm working on a server-side change to make it possible to load progress just for exercises you've attempted at least once, which should hopefully fix the problem (except maybe for the most active users).
Thanks! Can you keep me posted about when the server-side change is in place? Students at my school are required to work on their own playlist of Khan exercises for homework. I simply want to loop through exercises and my students to generate some quick reports for all math teachers.
yikes - we are hitting this too (and I didn't realize it until this thread)
what is the server side limit?
(mobile) On Sep 17, 2015 11:50 AM, "capecodcid" notifications@github.com wrote:
Thanks! Can you keep me posted about when the server-side change is in place? Students at my school are required to work on their own playlist of Khan exercises for homework. I simply want to loop through exercises and my students to generate some quick reports for all math teachers.
— Reply to this email directly or view it on GitHub https://github.com/Khan/khan-api/issues/94#issuecomment-141129388.
Ok, I just deployed a fix to this. The new behavior is that /api/v1/user/exercises
(without exercises
specified explicitly) will load only exercises that the user in question has attempted at least once. This should significantly reduce the running time and response size, so responses should now be well within the 32MB response size limit.
I also made it a little easier to load a specific set of exercises. You can now just separate the exercise names with commas instead of using repeated query parameters.
I've also updated the documentation at http://api-explorer.khanacademy.org/api/v1/user/exercises to reflect this.
Thanks for your patience, and let me know if you run into any problems.
I can authenticate and make api calls in node.js using the request package. All api calls are working fine and returning data except for the /user/exercises call.
I get the following error:
This limit does not seem to be imposed on the client side. Is it on the server side? Is there anyway for me to make this call?
Thanks, Andrew