Open edX API: gradebook score per problem

We need to get data about the user’s score per problem. I checked for endpoints that exist today and have not found a way to do this.

I want to discuss:

  • The /api/grades/v1/gradebook/course-v1%3AHIT%2BProgAllVis%2B2019_1/ endpoint returns it per section?
  • How it’s possible to get a user’s score per problem?

Hi @Vladimir_Susloparov !

I dug through the available APIs (on your devstack, that’s http://localhost:18000/api-doc), and found one that will return the score for a specific problem: instructor_v1_reports_generate_problem_responses_create.

However, it’s not very convenient… it queues an instructor task to generate a CSV file that contains scores (and other problem data) for all the users in your course, and for a given set of problems. But depending on your use case, this might be helpful?

It can be invoked from the LMS Instructor dashboard for a course, under Data Downloads > Reports > “Create a report of problem responses”, or by using the following API:

Request URL: http://localhost:18000/api/instructor/v1/reports/course-v1%3AedX%2BDemoX%2BDemo_Course/generate/problem_responses
Example usage:

curl -X POST "http://localhost:18000/api/instructor/v1/reports/course-v1%3AedX%2BDemoX%2BDemo_Course/generate/problem_responses" -H  "accept: application/json" -H  "Content-Type: application/json" -H  "X-CSRFToken: QIk6ytJq8VdXgxsyaV6vKe4YgnZZdqA9cHa0yf4nI8YJ4qBcYdXAleRUIav4yrIs" -d "{  \"problem_locations\": [    \"block-v1:edX+DemoX+Demo_Course+type@problem+block@9cee77a606ea4c1aa5440e0ea5d0f618\"  ],  \"problem_types_filter\": []}"
1 Like