openedxedx

How to access exams from XBlocks using EDX API?


my team and I have been given the task of creating some sort of street light notifications for exams in Open EDX, that is, if exam's due date is 3 weeks away, the color should be green, if the date is only a week away yellow and if the due date have passed the light should be red. The thing is we have access to courses list through the API of EDX but we can't figure out how to get exams through it, any ideas?

We have already consulted API routes for EDX https://github.com/edx/edx-platform/blob/master/lms/urls.py and conducted some tests with postman to the routes of courses but nothing.

Any help is appreciated!


Solution

  • You can use the Course Blocks API to return due dates. You'll have to include requested_fields=due parameter.

    An example URL:

    https://your.edx.installation/api/courses/v1/blocks/?course_id=course-v1%3AedX%2BDemoX%2BDemo_Course&depth=all&all_blocks=true&requested_fields=due