Hi,
I am using the wspp webservice module. When I try to use the enrol_students function an error is being thrown. When I study the source code in
http://cvs.moodle.org/contrib/patches/ws/wspp/server.class.php?view=markup under the function enrol_students it says "enrol_student is deprecated in moodle 1.7". I am running Moodle 1.9, is there an alternative function to use to enroll students via the web service call? Or is there a better web service framework I can use for my Moodle 1.9?
Thank you
Ole Thomassen
enrol_student is indeed deprecated but still present in 1.9 in file lib/deprecated.php. So the error is not a missing function but very likely bad parameters sent to enrol_students. What is exactly the error returned ?
As far as a better framework is concerned, work is in progress . See http://tracker.moodle.org/browse/MDL-12886
Cheers.
As far as a better framework is concerned, work is in progress . See http://tracker.moodle.org/browse/MDL-12886
Cheers.
The error returned is ""Could not enrol user Bill Hansen in course .\n"".
Could you show me the php used to setup the call ? Looks like some parameters are wrong or missing ...
Cheers.
Cheers.
Hi Patrick
I am using ASP.NET 3.5 (C#) using Web References.
I use the following code
org.ndcde.moodle01.MoodleWS moodle = new TestMoodleWeb.org.ndcde.moodle01.MoodleWS();// Login
org.ndcde.moodle01.
loginReturn loginObject = moodle.login("thomassen", "mypassword");// Create a string array with userids String[] studentArray = new String[1] { "155" };// Enroll Students}
When the object returns I see this message:
object enrollmentObject = moodle.enrol_students(loginObject.client, loginObject.sessionkey, "HCO2011W", studentArray, "id"); protected void Page_Load(object sender, EventArgs e) {// Create Moodle WS ObjectHi Patrick
I am using ASP.NET 3.5 (C#) using Web References.
I use the following code
// Moodle Objectorg.ndcde.moodle01.
MoodleWS moodle = new TestMoodleWeb.org.ndcde.moodle01.MoodleWS();// Loginorg.ndcde.moodle01.
loginReturn loginObject = moodle.login("thomassen", "aB91858324");// Create a string array with userids String[] studentArray = new String[1] { "155" };// Enroll Students object enrollmentObject = moodle.enrol_students(loginObject.client, loginObject.sessionkey, "HCO2011W", studentArray, "id");This is the error I see: