Integrating open edx with another django app

I would like to start an e-learning project. I would like it to have React frontend, DRF on backend and integrate Open edX into all of it. In Customization I saw that there is an API for such cases but I didn’t find, for example, any endpoints for getting user’s progress in a course. I was expecting something like “/courses/{course_id}/me/progress” but couldn’t find that.

So my question is: how can I get the information from my instance of Open edX in another project?

First thing that comes to my mind is to fork the code and write necessary endpoints by myself but I think that’s maybe not the best idea because I will have to start, configure and maintain this huge project. And later on I will have to update it and so on.

Not sure how to tackle this problem. Mostly because I don’t know the capabilities of the system.
Do you have any suggestions?

1 Like

Hi @karol,

In the default platform, there is a REST API at /api/completion/v1/subsection-completion/{username}/{course_key}/{subsection_id} (ref) which can give you some completion status for each subsection in a course, but you must make a separate request for each subsection as far as I know.

That said, if you install the optional completion aggregator plugin, then it provides an API that gives you a breakdown of the user’s progress in a course, or across all their courses. However, configuring and running completion aggregator in production is a bit of work (you need to schedule a couple cron jobs to run to update the data), and can be resource intensive.

Also, since the plugin is open source (developed by OpenCraft), you’re welcome to make pull requests as needed, to enhance its functionality, without having to take on maintenance of the whole thing :slight_smile:

Nice! That’s what I was looking for :slight_smile: I guess I must have been blind, because now I can see it in the documentation. Thanks!

1 Like

Where can we get the subsection_id in a course?

You can use the course blocks API, or from the Outline page in the LMS, if you find a subsection in the outline and look at the URL of its link, you’ll see it looks like this:

https://courses.edx.org/courses/course-v1:Org+Course+Run/jump_to/block-v1:Org+Course+Run+type@sequential+block@1234567990b349e6887c48edd1b7d61d

In that case, block-v1:Org+Course+Run+type@sequential+block@1234567990b349e6887c48edd1b7d61d is the subsection (aka “sequential”) ID.

I am getting this error on api request. [500 statuscode]
It is even happening on Open edX API
KeyError: '(Pblock-v1'

It looks like you’re specifying an invalid block ID. Block/section IDs should start with block-v1, not (Pblock-v1