SOAP "enrol_manual_enrol_users" finished before users are enroled

SOAP "enrol_manual_enrol_users" finished before users are enroled

by Andreas Österreicher -
Number of replies: 0
Hi!

I'm using the SOAP Webservice to enrol user to courses, create groups and assign the user to the groups.
All the functions are working correctly by its own, but if i use them together the assignment of the users to groups doesnt work. It fails with the message that the users are not enrolled in the course.

The code looks like this:

$client = new SoapClient($url);
$client->enrol_manual_enrol_users($userstoenroll);
...
$client->core_group_create_groups($group);
...
$client->core_group_add_group_members($groupmembertoadd);


enrol_manual_enrol_users has no return value and it seems that it takes some time (after the soap call is still finished) until the users are correctly enrolled to the course. (some seconds/minutes, depending on the number of users)

Is there a way to get informed when the enrolment is finished?
(... without checking every x seconds if the users are enrolled with core_enrol_get_enrolled_users)

Cheers

Andi

Average of ratings: -