Course completion progress as a percentage

I would like to see an API which returns a user’s progress in a course. This could be a nice addition to completion.

For example, a learner has completed 8/10 subsections in a course, if we GET /completion/api/v1/learner-progress/[username]/[course_key], we will get a response

{
  "result": "80.00"
}
1 Like

Hi @michaelroudnitski,

We have already built an API that does exactly that :slight_smile: It’s not included with Open edX but you can install and configure it, and then it should do what you’re looking for.

4 Likes

Hi @braden ,

We are trying the same API. After installation of openedx-completion-aggregator on existing edX instance it doesn’t get listed under https://<domain_name>/api-docs/ also invoking API just like
https://<domain_name>/api/completion/v1/course/
or
https://<domain_name>/api/completion/v1/course/?requested_fields=chapter,vertical
results into an page not found error.

we have run the run_aggregator_service and it has populated the data in table and we can see the data under Django admin view.

Is there any specific setting we need to do, to get the API listed under swagger docs or how can we invoke this API ? Any pointer is appreciated.

Thanks & Regards
Gaurav

@Gaurav_Vijayvergia I don’t think our plugin is annotated with Open API spec data, so it probably will not show up under /api-docs/ even if it’s installed correctly.

After some investigation, I suspect the docstrings show an old URL and at some point the API had to be moved to a different URL path.

Try https://<domain_name>/api/completion-aggregator/v1/course/ or https://<domain_name>/completion-aggregator/v1/course/ - one of those should work.

Very sorry about that, I don’t know why the docstrings weren’t updated. A PR to fix either of these issues (API docs and docstring URLs) would be welcome.

Thanks @braden. Will do. This works https://<domain_name>/completion-aggregator/v1/course/