Chief B
Chief B

Reputation: 31

Moodle API - get all completions per course

I have an external app that needs to know which users have completed a course in Moodle via the API. That is to say, it will want to know who completed course 123, and be given back a list. So far, the only way I've found to do this is "core_enrol_get_enrolled_users" to get the enrolled users, then iterating over that and hitting "core_completion_get_course_completion_status" for each enrolled user. Performance is obviously terrible as you end up with a round trip per user.

Is there any way I can get Moodle to give me all the completions for a course in just one request?

Upvotes: 3

Views: 2235

Answers (1)

Evgeniy Voevodin
Evgeniy Voevodin

Reputation: 241

Currently the only way is to implement said web service by yourself, since the five completion-related functions currently implemented do not suffice your request.

enter image description here

Upvotes: 1

Related Questions