5 * @author Patrick Pollet :<patrick.pollet@insa-lyon.fr>
6 * @copyright (c) P.Pollet 2007 under GPL
11 if (DEBUG) ini_set('soap.wsdl_cache_enabled', '0'); // no caching by php in debug mode
16 require_once 'userRecord.php';
20 require_once 'groupRecord.php';
24 require_once 'courseRecord.php';
28 require_once 'userDatum.php';
32 require_once 'courseDatum.php';
36 require_once 'gradeRecord.php';
38 * gradeStatsRecord class
40 require_once 'gradeStatsRecord.php';
44 require_once 'studentRecord.php';
46 * userLightRecord class
48 require_once 'userLightRecord.php';
52 require_once 'eventRecord.php';
56 require_once 'changeRecord.php';
60 require_once 'roleRecord.php';
62 * categoryRecord class
64 require_once 'categoryRecord.php';
66 * resourceRecord class
68 require_once 'resourceRecord.php';
70 * studentGradeRecord class
72 require_once 'studentGradeRecord.php';
76 require_once 'loginReturn.php';
78 * editUsersInput class
80 require_once 'editUsersInput.php';
82 * editUsersOutput class
84 require_once 'editUsersOutput.php';
86 * getUsersReturn class
88 require_once 'getUsersReturn.php';
90 * editCoursesInput class
92 require_once 'editCoursesInput.php';
94 * editCoursesOutput class
96 require_once 'editCoursesOutput.php';
98 * getCoursesReturn class
100 require_once 'getCoursesReturn.php';
102 * getGradesReturn class
104 require_once 'getGradesReturn.php';
106 * assignUsersReturn class
108 require_once 'assignUsersReturn.php';
110 * unassignUsersReturn class
112 require_once 'unassignUsersReturn.php';
114 * enrolStudentsReturn class
116 require_once 'enrolStudentsReturn.php';
118 * getRolesReturn class
120 require_once 'getRolesReturn.php';
122 * getGroupsReturn class
124 require_once 'getGroupsReturn.php';
126 * getEventsReturn class
128 require_once 'getEventsReturn.php';
130 * getLastChangesReturn class
132 require_once 'getLastChangesReturn.php';
134 * getCategoriesReturn class
136 require_once 'getCategoriesReturn.php';
138 * getResourcesReturn class
140 require_once 'getResourcesReturn.php';
142 * activityRecord class
144 require_once 'activityRecord.php';
146 * getActivitiesReturn class
148 require_once 'getActivitiesReturn.php';
155 * @author Patrick Pollet :<patrick.pollet@insa-lyon.fr>
156 * @copyright (c) P.Pollet 2007 under GPL
163 private $uri = 'http://localhost:8890/moodle19/wspp/wsdl';
165 public function MoodleWS($wsdl = "http://localhost:8890/moodle19/wspp/wsdl_pp.php", $uri=null, $options = array()) {
169 $this->client = new SoapClient($wsdl, $options);
172 function castTo($className,$res){
173 if (class_exists($className)) {
174 $aux= new $className();
175 foreach ($res as $key=>$value)
183 * MoodleWS Client Login
185 * @param string $username
186 * @param string $password
187 * @return loginReturn
189 public function login($username, $password) {
190 $res= $this->client->__call('login', array(
191 new SoapParam($username, 'username'),
192 new SoapParam($password, 'password')
195 'uri' => $this->uri ,
199 return $this->castTo ('loginReturn',$res);
203 * MoodleWS: Client Logout
205 * @param integer $client
206 * @param string $sesskey
209 public function logout($client, $sesskey) {
210 $res= $this->client->__call('logout', array(
211 new SoapParam($client, 'client'),
212 new SoapParam($sesskey, 'sesskey')
215 'uri' => $this->uri ,
223 * MoodleWS: Edit Users Information
225 * @param integer $client
226 * @param string $sesskey
227 * @param editUsersInput $users
228 * @return editUsersOutput
230 public function edit_users($client, $sesskey, editUsersInput $users) {
231 $res= $this->client->__call('edit_users', array(
232 new SoapParam($client, 'client'),
233 new SoapParam($sesskey, 'sesskey'),
234 new SoapParam($users, 'users')
237 'uri' => $this->uri ,
241 return $this->castTo ('editUsersOutput',$res);
245 * MoodleWS: Get Users Information
247 * @param integer $client
248 * @param string $sesskey
249 * @param (getUsersInput) array of string $userids
250 * @param string $idfield
251 * @return getUsersReturn
253 public function get_users($client, $sesskey, $userids, $idfield) {
254 $res= $this->client->__call('get_users', array(
255 new SoapParam($client, 'client'),
256 new SoapParam($sesskey, 'sesskey'),
257 new SoapParam($userids, 'userids'),
258 new SoapParam($idfield, 'idfield')
261 'uri' => $this->uri ,
265 return $this->castTo ('getUsersReturn',$res);
269 * MoodleWS: Edit Courses Information
271 * @param integer $client
272 * @param string $sesskey
273 * @param editCoursesInput $courses
274 * @return editCoursesOutput
276 public function edit_courses($client, $sesskey, editCoursesInput $courses) {
277 $res= $this->client->__call('edit_courses', array(
278 new SoapParam($client, 'client'),
279 new SoapParam($sesskey, 'sesskey'),
280 new SoapParam($courses, 'courses')
283 'uri' => $this->uri ,
287 return $this->castTo ('editCoursesOutput',$res);
291 * MoodleWS: Get Courses Information
293 * @param integer $client
294 * @param string $sesskey
295 * @param (getCoursesInput) array of string $courseids
296 * @param string $idfield
297 * @return getCoursesReturn
299 public function get_courses($client, $sesskey, $courseids, $idfield) {
300 $res= $this->client->__call('get_courses', array(
301 new SoapParam($client, 'client'),
302 new SoapParam($sesskey, 'sesskey'),
303 new SoapParam($courseids, 'courseids'),
304 new SoapParam($idfield, 'idfield')
307 'uri' => $this->uri ,
311 return $this->castTo ('getCoursesReturn',$res);
315 * MoodleWS: Get resources in courses
317 * @param integer $client
318 * @param string $sesskey
319 * @param (getCoursesInput) array of string $courseids
320 * @param string $idfield
321 * @return getResourcesReturn
323 public function get_resources($client, $sesskey, $courseids, $idfield) {
324 $res= $this->client->__call('get_resources', array(
325 new SoapParam($client, 'client'),
326 new SoapParam($sesskey, 'sesskey'),
327 new SoapParam($courseids, 'courseids'),
328 new SoapParam($idfield, 'idfield')
331 'uri' => $this->uri ,
335 return $this->castTo ('getResourcesReturn',$res);
339 * MoodleWS: Get resources in courses
341 * @param integer $client
342 * @param string $sesskey
343 * @param (getCoursesInput) array of string $courseids
344 * @param string $idfield
345 * @param string $type
346 * @return getResourcesReturn
348 public function get_instances_bytype($client, $sesskey, $courseids, $idfield, $type) {
349 $res= $this->client->__call('get_instances_bytype', array(
350 new SoapParam($client, 'client'),
351 new SoapParam($sesskey, 'sesskey'),
352 new SoapParam($courseids, 'courseids'),
353 new SoapParam($idfield, 'idfield'),
354 new SoapParam($type, 'type')
357 'uri' => $this->uri ,
361 return $this->castTo ('getResourcesReturn',$res);
365 * MoodleWS: Get User Grades
367 * @param integer $client
368 * @param string $sesskey
369 * @param string $userid
370 * @param (getGradesInput) array of string $courseids
371 * @param string $idfield
372 * @return getGradesReturn
374 public function get_grades($client, $sesskey, $userid, $courseids, $idfield) {
375 $res= $this->client->__call('get_grades', array(
376 new SoapParam($client, 'client'),
377 new SoapParam($sesskey, 'sesskey'),
378 new SoapParam($userid, 'userid'),
379 new SoapParam($courseids, 'courseids'),
380 new SoapParam($idfield, 'idfield')
383 'uri' => $this->uri ,
387 return $this->castTo ('getGradesReturn',$res);
391 * MoodleWS: Enrol students in a course
393 * @param integer $client
394 * @param string $sesskey
395 * @param string $courseid
396 * @param (enrolStudentsInput) array of string $userids
397 * @param string $idfield
398 * @return enrolStudentsReturn
400 public function enrol_students($client, $sesskey, $courseid, $userids, $idfield) {
401 $res= $this->client->__call('enrol_students', array(
402 new SoapParam($client, 'client'),
403 new SoapParam($sesskey, 'sesskey'),
404 new SoapParam($courseid, 'courseid'),
405 new SoapParam($userids, 'userids'),
406 new SoapParam($idfield, 'idfield')
409 'uri' => $this->uri ,
413 return $this->castTo ('enrolStudentsReturn',$res);
417 * MoodleWS: Assign a role to a user in a course
420 * @param integer $client
421 * @param string $sesskey
422 * @param string $courseid
423 * @param (assignUsersInput) array of string $userids
424 * @param string $idfield
425 * @param string $idrole
426 * @return assignUsersReturn
428 public function assignUsers($client, $sesskey, $courseid, $userids, $idfield, $idrole) {
429 $res= $this->client->__call('assignUsers', array(
430 new SoapParam($client, 'client'),
431 new SoapParam($sesskey, 'sesskey'),
432 new SoapParam($courseid, 'courseid'),
433 new SoapParam($userids, 'userids'),
434 new SoapParam($idfield, 'idfield'),
435 new SoapParam($idrole, 'idrole')
438 'uri' => $this->uri ,
442 return $this->castTo ('assignUsersReturn',$res);
446 * MoodleWS: unAssign a role to a user in a course
449 * @param integer $client
450 * @param string $sesskey
451 * @param string $courseid
452 * @param (unassignUsersInput) array of string $userids
453 * @param string $idfield
454 * @param string $idrole
455 * @return unassignUsersReturn
457 public function unassignUsers($client, $sesskey, $courseid, $userids, $idfield, $idrole) {
458 $res= $this->client->__call('unassignUsers', array(
459 new SoapParam($client, 'client'),
460 new SoapParam($sesskey, 'sesskey'),
461 new SoapParam($courseid, 'courseid'),
462 new SoapParam($userids, 'userids'),
463 new SoapParam($idfield, 'idfield'),
464 new SoapParam($idrole, 'idrole')
467 'uri' => $this->uri ,
471 return $this->castTo ('unassignUsersReturn',$res);
475 * MoodleWS: Get last changes to a Moodle s course
478 * @param integer $client
479 * @param string $sesskey
480 * @param string $courseid
481 * @param string $idfield
482 * @param integer $limit
483 * @return getLastChangesReturn
485 public function get_last_changes($client, $sesskey, $courseid, $idfield, $limit) {
486 $res= $this->client->__call('get_last_changes', array(
487 new SoapParam($client, 'client'),
488 new SoapParam($sesskey, 'sesskey'),
489 new SoapParam($courseid, 'courseid'),
490 new SoapParam($idfield, 'idfield'),
491 new SoapParam($limit, 'limit')
494 'uri' => $this->uri ,
498 return $this->castTo ('getLastChangesReturn',$res);
502 * MoodleWS: Get Moodle s events
504 * @param integer $client
505 * @param string $sesskey
506 * @param integer $eventtype
507 * @param integer $ownerid
508 * @return getEventsReturn
510 public function get_events($client, $sesskey, $eventtype, $ownerid) {
511 $res= $this->client->__call('get_events', array(
512 new SoapParam($client, 'client'),
513 new SoapParam($sesskey, 'sesskey'),
514 new SoapParam($eventtype, 'eventtype'),
515 new SoapParam($ownerid, 'ownerid')
518 'uri' => $this->uri ,
522 return $this->castTo ('getEventsReturn',$res);
526 * MoodleWS: Get Course Information
528 * @param integer $client
529 * @param string $sesskey
530 * @param string $courseid
531 * @param string $idfield
532 * @return getCoursesReturn
534 public function get_course($client, $sesskey, $courseid, $idfield) {
535 $res= $this->client->__call('get_course', array(
536 new SoapParam($client, 'client'),
537 new SoapParam($sesskey, 'sesskey'),
538 new SoapParam($courseid, 'courseid'),
539 new SoapParam($idfield, 'idfield')
542 'uri' => $this->uri ,
546 return $this->castTo ('getCoursesReturn',$res);
550 * MoodleWS: Get Course Information
552 * @param integer $client
553 * @param string $sesskey
554 * @param string $info
555 * @return getCoursesReturn
557 public function get_course_byid($client, $sesskey, $info) {
558 $res= $this->client->__call('get_course_byid', array(
559 new SoapParam($client, 'client'),
560 new SoapParam($sesskey, 'sesskey'),
561 new SoapParam($info, 'info')
564 'uri' => $this->uri ,
568 return $this->castTo ('getCoursesReturn',$res);
572 * MoodleWS: Get Course Information
574 * @param integer $client
575 * @param string $sesskey
576 * @param string $info
577 * @return getCoursesReturn
579 public function get_course_byidnumber($client, $sesskey, $info) {
580 $res= $this->client->__call('get_course_byidnumber', array(
581 new SoapParam($client, 'client'),
582 new SoapParam($sesskey, 'sesskey'),
583 new SoapParam($info, 'info')
586 'uri' => $this->uri ,
590 return $this->castTo ('getCoursesReturn',$res);
594 * MoodleWS: Get one User Information
596 * @param integer $client
597 * @param string $sesskey
598 * @param string $userid
599 * @param string $idfield
600 * @return getUsersReturn
602 public function get_user($client, $sesskey, $userid, $idfield) {
603 $res= $this->client->__call('get_user', array(
604 new SoapParam($client, 'client'),
605 new SoapParam($sesskey, 'sesskey'),
606 new SoapParam($userid, 'userid'),
607 new SoapParam($idfield, 'idfield')
610 'uri' => $this->uri ,
614 return $this->castTo ('getUsersReturn',$res);
618 * MoodleWS: Get All roles defined in Moodle
620 * @param integer $client
621 * @param string $sesskey
622 * @return getRolesReturn
624 public function get_roles($client, $sesskey) {
625 $res= $this->client->__call('get_roles', array(
626 new SoapParam($client, 'client'),
627 new SoapParam($sesskey, 'sesskey')
630 'uri' => $this->uri ,
634 return $this->castTo ('getRolesReturn',$res);
638 * MoodleWS: Get one role defined in Moodle
640 * @param integer $client
641 * @param string $sesskey
642 * @param string $value
643 * @return getRolesReturn
645 public function get_role_byid($client, $sesskey, $value) {
646 $res= $this->client->__call('get_role_byid', array(
647 new SoapParam($client, 'client'),
648 new SoapParam($sesskey, 'sesskey'),
649 new SoapParam($value, 'value')
652 'uri' => $this->uri ,
656 return $this->castTo ('getRolesReturn',$res);
660 * MoodleWS: Get one role defined in Moodle
662 * @param integer $client
663 * @param string $sesskey
664 * @param string $value
665 * @return getRolesReturn
667 public function get_role_byname($client, $sesskey, $value) {
668 $res= $this->client->__call('get_role_byname', array(
669 new SoapParam($client, 'client'),
670 new SoapParam($sesskey, 'sesskey'),
671 new SoapParam($value, 'value')
674 'uri' => $this->uri ,
678 return $this->castTo ('getRolesReturn',$res);
682 * MoodleWS: Get Moodle course categories
684 * @param integer $client
685 * @param string $sesskey
686 * @return getCategoriesReturn
688 public function get_categories($client, $sesskey) {
689 $res= $this->client->__call('get_categories', array(
690 new SoapParam($client, 'client'),
691 new SoapParam($sesskey, 'sesskey')
694 'uri' => $this->uri ,
698 return $this->castTo ('getCategoriesReturn',$res);
702 * MoodleWS: Get one category defined in Moodle
704 * @param integer $client
705 * @param string $sesskey
706 * @param string $value
707 * @return getCategoriesReturn
709 public function get_category_byid($client, $sesskey, $value) {
710 $res= $this->client->__call('get_category_byid', array(
711 new SoapParam($client, 'client'),
712 new SoapParam($sesskey, 'sesskey'),
713 new SoapParam($value, 'value')
716 'uri' => $this->uri ,
720 return $this->castTo ('getCategoriesReturn',$res);
724 * MoodleWS: Get one category defined in Moodle
726 * @param integer $client
727 * @param string $sesskey
728 * @param string $value
729 * @return getCategoriesReturn
731 public function get_category_byname($client, $sesskey, $value) {
732 $res= $this->client->__call('get_category_byname', array(
733 new SoapParam($client, 'client'),
734 new SoapParam($sesskey, 'sesskey'),
735 new SoapParam($value, 'value')
738 'uri' => $this->uri ,
742 return $this->castTo ('getCategoriesReturn',$res);
746 * MoodleWS: Get Courses user identified by id is
749 * @param integer $client
750 * @param string $sesskey
751 * @param integer $uid
752 * @param string $sort
753 * @return getCoursesReturn
755 public function get_my_courses($client, $sesskey, $uid, $sort) {
756 $res= $this->client->__call('get_my_courses', array(
757 new SoapParam($client, 'client'),
758 new SoapParam($sesskey, 'sesskey'),
759 new SoapParam($uid, 'uid'),
760 new SoapParam($sort, 'sort')
763 'uri' => $this->uri ,
767 return $this->castTo ('getCoursesReturn',$res);
771 * MoodleWS: Get Courses current user identified
772 * by username is member of
774 * @param integer $client
775 * @param string $sesskey
776 * @param string $uinfo
777 * @param string $sort
778 * @return getCoursesReturn
780 public function get_my_courses_byusername($client, $sesskey, $uinfo, $sort) {
781 $res= $this->client->__call('get_my_courses_byusername', array(
782 new SoapParam($client, 'client'),
783 new SoapParam($sesskey, 'sesskey'),
784 new SoapParam($uinfo, 'uinfo'),
785 new SoapParam($sort, 'sort')
788 'uri' => $this->uri ,
792 return $this->castTo ('getCoursesReturn',$res);
796 * MoodleWS: Get Courses current user identified
797 * by idnumber is member of
799 * @param integer $client
800 * @param string $sesskey
801 * @param string $uinfo
802 * @param string $sort
803 * @return getCoursesReturn
805 public function get_my_courses_byidnumber($client, $sesskey, $uinfo, $sort) {
806 $res= $this->client->__call('get_my_courses_byidnumber', array(
807 new SoapParam($client, 'client'),
808 new SoapParam($sesskey, 'sesskey'),
809 new SoapParam($uinfo, 'uinfo'),
810 new SoapParam($sort, 'sort')
813 'uri' => $this->uri ,
817 return $this->castTo ('getCoursesReturn',$res);
821 * MoodleWS: Get user info from Moodle user login
824 * @param integer $client
825 * @param string $sesskey
826 * @param string $userinfo
827 * @return getUsersReturn
829 public function get_user_byusername($client, $sesskey, $userinfo) {
830 $res= $this->client->__call('get_user_byusername', array(
831 new SoapParam($client, 'client'),
832 new SoapParam($sesskey, 'sesskey'),
833 new SoapParam($userinfo, 'userinfo')
836 'uri' => $this->uri ,
840 return $this->castTo ('getUsersReturn',$res);
844 * MoodleWS: Get user info from Moodle user id number
847 * @param integer $client
848 * @param string $sesskey
849 * @param string $userinfo
850 * @return getUsersReturn
852 public function get_user_byidnumber($client, $sesskey, $userinfo) {
853 $res= $this->client->__call('get_user_byidnumber', array(
854 new SoapParam($client, 'client'),
855 new SoapParam($sesskey, 'sesskey'),
856 new SoapParam($userinfo, 'userinfo')
859 'uri' => $this->uri ,
863 return $this->castTo ('getUsersReturn',$res);
867 * MoodleWS: Get user info from Moodle user id
869 * @param integer $client
870 * @param string $sesskey
871 * @param string $userinfo
872 * @return getUsersReturn
874 public function get_user_byid($client, $sesskey, $userinfo) {
875 $res= $this->client->__call('get_user_byid', array(
876 new SoapParam($client, 'client'),
877 new SoapParam($sesskey, 'sesskey'),
878 new SoapParam($userinfo, 'userinfo')
881 'uri' => $this->uri ,
885 return $this->castTo ('getUsersReturn',$res);
889 * MoodleWS: Get users having a role in a course
892 * @param integer $client
893 * @param string $sesskey
894 * @param string $idcourse
895 * @param string $idfield
896 * @param integer $idrole
897 * @return getUsersReturn
899 public function get_users_bycourse($client, $sesskey, $idcourse, $idfield, $idrole) {
900 $res= $this->client->__call('get_users_bycourse', array(
901 new SoapParam($client, 'client'),
902 new SoapParam($sesskey, 'sesskey'),
903 new SoapParam($idcourse, 'idcourse'),
904 new SoapParam($idfield, 'idfield'),
905 new SoapParam($idrole, 'idrole')
908 'uri' => $this->uri ,
912 return $this->castTo ('getUsersReturn',$res);
916 * MoodleWS: count users having a role in a course
919 * @param integer $client
920 * @param string $sesskey
921 * @param string $idcourse
922 * @param string $idfield
923 * @param integer $idrole
926 public function count_users_bycourse($client, $sesskey, $idcourse, $idfield, $idrole) {
927 $res= $this->client->__call('count_users_bycourse', array(
928 new SoapParam($client, 'client'),
929 new SoapParam($sesskey, 'sesskey'),
930 new SoapParam($idcourse, 'idcourse'),
931 new SoapParam($idfield, 'idfield'),
932 new SoapParam($idrole, 'idrole')
935 'uri' => $this->uri ,
943 * MoodleWS: Get Courses belonging to category
945 * @param integer $client
946 * @param string $sesskey
947 * @param integer $categoryid
948 * @return getCoursesReturn
950 public function get_courses_bycategory($client, $sesskey, $categoryid) {
951 $res= $this->client->__call('get_courses_bycategory', array(
952 new SoapParam($client, 'client'),
953 new SoapParam($sesskey, 'sesskey'),
954 new SoapParam($categoryid, 'categoryid')
957 'uri' => $this->uri ,
961 return $this->castTo ('getCoursesReturn',$res);
965 * MoodleWS: Get Course groups
967 * @param integer $client
968 * @param string $sesskey
969 * @param string $courseid
970 * @param string $idfield
971 * @return getGroupsReturn
973 public function get_groups_bycourse($client, $sesskey, $courseid, $idfield) {
974 $res= $this->client->__call('get_groups_bycourse', array(
975 new SoapParam($client, 'client'),
976 new SoapParam($sesskey, 'sesskey'),
977 new SoapParam($courseid, 'courseid'),
978 new SoapParam($idfield, 'idfield')
981 'uri' => $this->uri ,
985 return $this->castTo ('getGroupsReturn',$res);
989 * MoodleWS: Get Course Information
991 * @param integer $client
992 * @param string $sesskey
993 * @param string $info
994 * @param integer $courseid
995 * @return getGroupsReturn
997 public function get_group_byid($client, $sesskey, $info, $courseid) {
998 $res= $this->client->__call('get_group_byid', array(
999 new SoapParam($client, 'client'),
1000 new SoapParam($sesskey, 'sesskey'),
1001 new SoapParam($info, 'info'),
1002 new SoapParam($courseid, 'courseid')
1005 'uri' => $this->uri ,
1009 return $this->castTo ('getGroupsReturn',$res);
1013 * MoodleWS: Get Course Information
1015 * @param integer $client
1016 * @param string $sesskey
1017 * @param string $info
1018 * @param integer $courseid
1019 * @return getGroupsReturn
1021 public function get_groups_byname($client, $sesskey, $info, $courseid) {
1022 $res= $this->client->__call('get_groups_byname', array(
1023 new SoapParam($client, 'client'),
1024 new SoapParam($sesskey, 'sesskey'),
1025 new SoapParam($info, 'info'),
1026 new SoapParam($courseid, 'courseid')
1029 'uri' => $this->uri ,
1033 return $this->castTo ('getGroupsReturn',$res);
1037 * MoodleWS: Get users members of a group in course
1040 * @param integer $client
1041 * @param string $sesskey
1042 * @param integer $groupid
1043 * @return getUsersReturn
1045 public function get_group_members($client, $sesskey, $groupid) {
1046 $res= $this->client->__call('get_group_members', array(
1047 new SoapParam($client, 'client'),
1048 new SoapParam($sesskey, 'sesskey'),
1049 new SoapParam($groupid, 'groupid')
1052 'uri' => $this->uri ,
1056 return $this->castTo ('getUsersReturn',$res);
1060 * MoodleWS: get current user Moodle internal id
1063 * @param integer $client
1064 * @param string $sesskey
1067 public function get_my_id($client, $sesskey) {
1068 $res= $this->client->__call('get_my_id', array(
1069 new SoapParam($client, 'client'),
1070 new SoapParam($sesskey, 'sesskey')
1073 'uri' => $this->uri ,
1081 * MoodleWS: Get user group in course
1083 * @param integer $client
1084 * @param string $sesskey
1085 * @param integer $courseid
1086 * @param integer $uid
1087 * @return getGroupsReturn
1089 public function get_my_group($client, $sesskey, $courseid, $uid) {
1090 $res= $this->client->__call('get_my_group', array(
1091 new SoapParam($client, 'client'),
1092 new SoapParam($sesskey, 'sesskey'),
1093 new SoapParam($courseid, 'courseid'),
1094 new SoapParam($uid, 'uid')
1097 'uri' => $this->uri ,
1101 return $this->castTo ('getGroupsReturn',$res);
1105 * MoodleWS: Get user groups in all Moodle site
1107 * @param integer $client
1108 * @param string $sesskey
1109 * @param integer $uid
1110 * @return getGroupsReturn
1112 public function get_my_groups($client, $sesskey, $uid) {
1113 $res= $this->client->__call('get_my_groups', array(
1114 new SoapParam($client, 'client'),
1115 new SoapParam($sesskey, 'sesskey'),
1116 new SoapParam($uid, 'uid')
1119 'uri' => $this->uri ,
1123 return $this->castTo ('getGroupsReturn',$res);
1127 * MoodleWS: Get course teachers
1129 * @param integer $client
1130 * @param string $sesskey
1131 * @param string $value
1133 * @return getUsersReturn
1135 public function get_teachers($client, $sesskey, $value, $id) {
1136 $res= $this->client->__call('get_teachers', array(
1137 new SoapParam($client, 'client'),
1138 new SoapParam($sesskey, 'sesskey'),
1139 new SoapParam($value, 'value'),
1140 new SoapParam($id, 'id')
1143 'uri' => $this->uri ,
1147 return $this->castTo ('getUsersReturn',$res);
1151 * MoodleWS: Get course students
1153 * @param integer $client
1154 * @param string $sesskey
1155 * @param string $value
1157 * @return getUsersReturn
1159 public function get_students($client, $sesskey, $value, $id) {
1160 $res= $this->client->__call('get_students', array(
1161 new SoapParam($client, 'client'),
1162 new SoapParam($sesskey, 'sesskey'),
1163 new SoapParam($value, 'value'),
1164 new SoapParam($id, 'id')
1167 'uri' => $this->uri ,
1171 return $this->castTo ('getUsersReturn',$res);
1175 * MoodleWS: check if user has a given role in a
1178 * @param integer $client
1179 * @param string $sesskey
1180 * @param string $iduser
1181 * @param string $iduserfield
1182 * @param string $idcourse
1183 * @param string $idcoursefield
1184 * @param integer $idrole
1187 public function has_role_incourse($client, $sesskey, $iduser, $iduserfield, $idcourse, $idcoursefield, $idrole) {
1188 $res= $this->client->__call('has_role_incourse', array(
1189 new SoapParam($client, 'client'),
1190 new SoapParam($sesskey, 'sesskey'),
1191 new SoapParam($iduser, 'iduser'),
1192 new SoapParam($iduserfield, 'iduserfield'),
1193 new SoapParam($idcourse, 'idcourse'),
1194 new SoapParam($idcoursefield, 'idcoursefield'),
1195 new SoapParam($idrole, 'idrole')
1198 'uri' => $this->uri ,
1206 * MoodleWS: returns user s primary role in a given
1209 * @param integer $client
1210 * @param string $sesskey
1211 * @param string $iduser
1212 * @param string $iduserfield
1213 * @param string $idcourse
1214 * @param string $idcoursefield
1217 public function get_primaryrole_incourse($client, $sesskey, $iduser, $iduserfield, $idcourse, $idcoursefield) {
1218 $res= $this->client->__call('get_primaryrole_incourse', array(
1219 new SoapParam($client, 'client'),
1220 new SoapParam($sesskey, 'sesskey'),
1221 new SoapParam($iduser, 'iduser'),
1222 new SoapParam($iduserfield, 'iduserfield'),
1223 new SoapParam($idcourse, 'idcourse'),
1224 new SoapParam($idcoursefield, 'idcoursefield')
1227 'uri' => $this->uri ,
1235 * MoodleWS: Get user most recent activities in a
1238 * @param integer $client
1239 * @param string $sesskey
1240 * @param string $iduser
1241 * @param string $iduserfield
1242 * @param string $idcourse
1243 * @param string $idcoursefield
1244 * @param integer $idlimit
1245 * @return getActivitiesReturn
1247 public function get_activities($client, $sesskey, $iduser, $iduserfield, $idcourse, $idcoursefield, $idlimit) {
1248 $res= $this->client->__call('get_activities', array(
1249 new SoapParam($client, 'client'),
1250 new SoapParam($sesskey, 'sesskey'),
1251 new SoapParam($iduser, 'iduser'),
1252 new SoapParam($iduserfield, 'iduserfield'),
1253 new SoapParam($idcourse, 'idcourse'),
1254 new SoapParam($idcoursefield, 'idcoursefield'),
1255 new SoapParam($idlimit, 'idlimit')
1258 'uri' => $this->uri ,
1262 return $this->castTo ('getActivitiesReturn',$res);
1266 * MoodleWS: count user most recent activities in
1269 * @param integer $client
1270 * @param string $sesskey
1271 * @param string $value1
1272 * @param string $id1
1273 * @param string $value2
1274 * @param string $id2
1277 public function count_activities($client, $sesskey, $value1, $id1, $value2, $id2) {
1278 $res= $this->client->__call('count_activities', array(
1279 new SoapParam($client, 'client'),
1280 new SoapParam($sesskey, 'sesskey'),
1281 new SoapParam($value1, 'value1'),
1282 new SoapParam($id1, 'id1'),
1283 new SoapParam($value2, 'value2'),
1284 new SoapParam($id2, 'id2')
1287 'uri' => $this->uri ,