Enroll group of users to course from web services?

Enroll group of users to course from web services?

by marcel montel -
Number of replies: 2

Hi!


I am looking to create users, add them to a group and then add that group to a course, all via the web services.

I am already creating new users through the web services api. Looking at the documentation it seems like the following would do the trick:

core_group_create_groups() -- create my group
core_group_add_group_members() -- after i inject a user, i can add him/her to the group

Now, which web service (if available?) is used to enroll a group of users to a course?, or should i be looking at cohorts instead?


Please help



Average of ratings: -
In reply to marcel montel

Re: Enroll group of users to course from web services?

by David Monllaó -

Hi Marcel,

It depends on the enrolment plugin that you want to use (https://docs.moodle.org/29/en/Enrolments#Enrolment_plugins), for example, for manual enrolments (will probably be the case) you have enrol_manual_enrol_users.

In reply to David Monllaó

Re: Enroll group of users to course from web services?

by marcel montel -

Thanks, it seems like i should make use of cohorts instead of groups though, since groups are course unique while cohorts are sitewide groups as i understand it. Looking for a way to enroll a cohort in a course via webservices now..