Quantcast
Channel: Web services
Viewing all articles
Browse latest Browse all 2364

SOAP "enrol_manual_enrol_users" finished before users are enroled

$
0
0

by Andreas Österreicher.  

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


Viewing all articles
Browse latest Browse all 2364

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>