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';
48 require_once 'eventRecord.php';
52 require_once 'changeRecord.php';
56 require_once 'roleRecord.php';
58 * categoryRecord class
60 require_once 'categoryRecord.php';
62 * resourceRecord class
64 require_once 'resourceRecord.php';
66 * studentGradeRecord class
68 require_once 'studentGradeRecord.php';
72 require_once 'loginReturn.php';
74 * editUsersInput class
76 require_once 'editUsersInput.php';
78 * editUsersOutput class
80 require_once 'editUsersOutput.php';
82 * getUsersReturn class
84 require_once 'getUsersReturn.php';
86 * editCoursesInput class
88 require_once 'editCoursesInput.php';
90 * editCoursesOutput class
92 require_once 'editCoursesOutput.php';
94 * getCoursesReturn class
96 require_once 'getCoursesReturn.php';
98 * getGradesReturn class
100 require_once 'getGradesReturn.php';
102 * enrolStudentsReturn class
104 require_once 'enrolStudentsReturn.php';
106 * getRolesReturn class
108 require_once 'getRolesReturn.php';
110 * getGroupsReturn class
112 require_once 'getGroupsReturn.php';
114 * getEventsReturn class
116 require_once 'getEventsReturn.php';
118 * getLastChangesReturn class
120 require_once 'getLastChangesReturn.php';
122 * getCategoriesReturn class
124 require_once 'getCategoriesReturn.php';
126 * getResourcesReturn class
128 require_once 'getResourcesReturn.php';
130 * activityRecord class
132 require_once 'activityRecord.php';
134 * getActivitiesReturn class
136 require_once 'getActivitiesReturn.php';
143 * @author Patrick Pollet :<patrick.pollet@insa-lyon.fr>
144 * @copyright (c) P.Pollet 2007 under GPL
151 private $uri = 'http://localhost:8891/moodle19/wspp/wsdl';
153 public function MoodleWS($wsdl = "http://localhost:8891/moodle19/wspp/wsdl_pp.php", $uri=null, $options = array()) {
157 $this->client = new SoapClient($wsdl, $options);
160 function castTo($className,$res){
161 if (class_exists($className)) {
162 $aux= new $className();
163 foreach ($res as $key=>$value)
171 * MoodleWS Client Login
173 * @param string $username
174 * @param string $password
175 * @return loginReturn
177 public function login($username, $password) {
178 $res= $this->client->__call('login', array(
179 new SoapParam($username, 'username'),
180 new SoapParam($password, 'password')
183 'uri' => $this->uri ,
187 return $this->castTo ('loginReturn',$res);
191 * MoodleWS: Client Logout
193 * @param integer $client
194 * @param string $sesskey
197 public function logout($client, $sesskey) {
198 $res= $this->client->__call('logout', array(
199 new SoapParam($client, 'client'),
200 new SoapParam($sesskey, 'sesskey')
203 'uri' => $this->uri ,
211 * MoodleWS: Edit Users Information
213 * @param integer $client
214 * @param string $sesskey
215 * @param editUsersInput $users
216 * @return editUsersOutput
218 public function edit_users($client, $sesskey, editUsersInput $users) {
219 $res= $this->client->__call('edit_users', array(
220 new SoapParam($client, 'client'),
221 new SoapParam($sesskey, 'sesskey'),
222 new SoapParam($users, 'users')
225 'uri' => $this->uri ,
229 return $this->castTo ('editUsersOutput',$res);
233 * MoodleWS: Get Users Information
235 * @param integer $client
236 * @param string $sesskey
237 * @param (getUsersInput) array of string $userids
238 * @param string $idfield
239 * @return getUsersReturn
241 public function get_users($client, $sesskey, $userids, $idfield) {
242 $res= $this->client->__call('get_users', array(
243 new SoapParam($client, 'client'),
244 new SoapParam($sesskey, 'sesskey'),
245 new SoapParam($userids, 'userids'),
246 new SoapParam($idfield, 'idfield')
249 'uri' => $this->uri ,
253 return $this->castTo ('getUsersReturn',$res);
257 * MoodleWS: Edit Courses Information
259 * @param integer $client
260 * @param string $sesskey
261 * @param editCoursesInput $courses
262 * @return editCoursesOutput
264 public function edit_courses($client, $sesskey, editCoursesInput $courses) {
265 $res= $this->client->__call('edit_courses', array(
266 new SoapParam($client, 'client'),
267 new SoapParam($sesskey, 'sesskey'),
268 new SoapParam($courses, 'courses')
271 'uri' => $this->uri ,
275 return $this->castTo ('editCoursesOutput',$res);
279 * MoodleWS: Get Courses Information
281 * @param integer $client
282 * @param string $sesskey
283 * @param (getCoursesInput) array of string $courseids
284 * @param string $idfield
285 * @return getCoursesReturn
287 public function get_courses($client, $sesskey, $courseids, $idfield) {
288 $res= $this->client->__call('get_courses', array(
289 new SoapParam($client, 'client'),
290 new SoapParam($sesskey, 'sesskey'),
291 new SoapParam($courseids, 'courseids'),
292 new SoapParam($idfield, 'idfield')
295 'uri' => $this->uri ,
299 return $this->castTo ('getCoursesReturn',$res);
303 * MoodleWS: Get resources in courses
305 * @param integer $client
306 * @param string $sesskey
307 * @param (getCoursesInput) array of string $courseids
308 * @param string $idfield
309 * @return getResourcesReturn
311 public function get_resources($client, $sesskey, $courseids, $idfield) {
312 $res= $this->client->__call('get_resources', array(
313 new SoapParam($client, 'client'),
314 new SoapParam($sesskey, 'sesskey'),
315 new SoapParam($courseids, 'courseids'),
316 new SoapParam($idfield, 'idfield')
319 'uri' => $this->uri ,
323 return $this->castTo ('getResourcesReturn',$res);
327 * MoodleWS: Get resources in courses
329 * @param integer $client
330 * @param string $sesskey
331 * @param (getCoursesInput) array of string $courseids
332 * @param string $idfield
333 * @param string $type
334 * @return getResourcesReturn
336 public function get_instances_bytype($client, $sesskey, $courseids, $idfield, $type) {
337 $res= $this->client->__call('get_instances_bytype', array(
338 new SoapParam($client, 'client'),
339 new SoapParam($sesskey, 'sesskey'),
340 new SoapParam($courseids, 'courseids'),
341 new SoapParam($idfield, 'idfield'),
342 new SoapParam($type, 'type')
345 'uri' => $this->uri ,
349 return $this->castTo ('getResourcesReturn',$res);
353 * MoodleWS: Get User Grades
355 * @param integer $client
356 * @param string $sesskey
357 * @param string $userid
358 * @param (getGradesInput) array of string $courseids
359 * @param string $idfield
360 * @return getGradesReturn
362 public function get_grades($client, $sesskey, $userid, $courseids, $idfield) {
363 $res= $this->client->__call('get_grades', array(
364 new SoapParam($client, 'client'),
365 new SoapParam($sesskey, 'sesskey'),
366 new SoapParam($userid, 'userid'),
367 new SoapParam($courseids, 'courseids'),
368 new SoapParam($idfield, 'idfield')
371 'uri' => $this->uri ,
375 return $this->castTo ('getGradesReturn',$res);
379 * MoodleWS: Enrol students in a course
381 * @param integer $client
382 * @param string $sesskey
383 * @param string $courseid
384 * @param (enrolStudentsInput) array of string $userids
385 * @param string $idfield
386 * @return enrolStudentsReturn
388 public function enrol_students($client, $sesskey, $courseid, $userids, $idfield) {
389 $res= $this->client->__call('enrol_students', array(
390 new SoapParam($client, 'client'),
391 new SoapParam($sesskey, 'sesskey'),
392 new SoapParam($courseid, 'courseid'),
393 new SoapParam($userids, 'userids'),
394 new SoapParam($idfield, 'idfield')
397 'uri' => $this->uri ,
401 return $this->castTo ('enrolStudentsReturn',$res);
405 * MoodleWS: Get last changes to a Moodle s course
408 * @param integer $client
409 * @param string $sesskey
410 * @param string $courseid
411 * @param string $idfield
412 * @param integer $limit
413 * @return getLastChangesReturn
415 public function get_last_changes($client, $sesskey, $courseid, $idfield, $limit) {
416 $res= $this->client->__call('get_last_changes', array(
417 new SoapParam($client, 'client'),
418 new SoapParam($sesskey, 'sesskey'),
419 new SoapParam($courseid, 'courseid'),
420 new SoapParam($idfield, 'idfield'),
421 new SoapParam($limit, 'limit')
424 'uri' => $this->uri ,
428 return $this->castTo ('getLastChangesReturn',$res);
432 * MoodleWS: Get Moodle s events
434 * @param integer $client
435 * @param string $sesskey
436 * @param integer $eventtype
437 * @param integer $ownerid
438 * @return getEventsReturn
440 public function get_events($client, $sesskey, $eventtype, $ownerid) {
441 $res= $this->client->__call('get_events', array(
442 new SoapParam($client, 'client'),
443 new SoapParam($sesskey, 'sesskey'),
444 new SoapParam($eventtype, 'eventtype'),
445 new SoapParam($ownerid, 'ownerid')
448 'uri' => $this->uri ,
452 return $this->castTo ('getEventsReturn',$res);
456 * MoodleWS: Get Course Information
458 * @param integer $client
459 * @param string $sesskey
460 * @param string $courseid
461 * @param string $idfield
462 * @return getCoursesReturn
464 public function get_course($client, $sesskey, $courseid, $idfield) {
465 $res= $this->client->__call('get_course', array(
466 new SoapParam($client, 'client'),
467 new SoapParam($sesskey, 'sesskey'),
468 new SoapParam($courseid, 'courseid'),
469 new SoapParam($idfield, 'idfield')
472 'uri' => $this->uri ,
476 return $this->castTo ('getCoursesReturn',$res);
480 * MoodleWS: Get Course Information
482 * @param integer $client
483 * @param string $sesskey
484 * @param string $info
485 * @return getCoursesReturn
487 public function get_course_byid($client, $sesskey, $info) {
488 $res= $this->client->__call('get_course_byid', array(
489 new SoapParam($client, 'client'),
490 new SoapParam($sesskey, 'sesskey'),
491 new SoapParam($info, 'info')
494 'uri' => $this->uri ,
498 return $this->castTo ('getCoursesReturn',$res);
502 * MoodleWS: Get Course Information
504 * @param integer $client
505 * @param string $sesskey
506 * @param string $info
507 * @return getCoursesReturn
509 public function get_course_byidnumber($client, $sesskey, $info) {
510 $res= $this->client->__call('get_course_byidnumber', array(
511 new SoapParam($client, 'client'),
512 new SoapParam($sesskey, 'sesskey'),
513 new SoapParam($info, 'info')
516 'uri' => $this->uri ,
520 return $this->castTo ('getCoursesReturn',$res);
524 * MoodleWS: Get one User Information
526 * @param integer $client
527 * @param string $sesskey
528 * @param string $userid
529 * @param string $idfield
530 * @return getUsersReturn
532 public function get_user($client, $sesskey, $userid, $idfield) {
533 $res= $this->client->__call('get_user', array(
534 new SoapParam($client, 'client'),
535 new SoapParam($sesskey, 'sesskey'),
536 new SoapParam($userid, 'userid'),
537 new SoapParam($idfield, 'idfield')
540 'uri' => $this->uri ,
544 return $this->castTo ('getUsersReturn',$res);
548 * MoodleWS: Get All roles defined in Moodle
550 * @param integer $client
551 * @param string $sesskey
552 * @return getRolesReturn
554 public function get_roles($client, $sesskey) {
555 $res= $this->client->__call('get_roles', array(
556 new SoapParam($client, 'client'),
557 new SoapParam($sesskey, 'sesskey')
560 'uri' => $this->uri ,
564 return $this->castTo ('getRolesReturn',$res);
568 * MoodleWS: Get one role defined in Moodle
570 * @param integer $client
571 * @param string $sesskey
572 * @param string $value
573 * @return getRolesReturn
575 public function get_role_byid($client, $sesskey, $value) {
576 $res= $this->client->__call('get_role_byid', array(
577 new SoapParam($client, 'client'),
578 new SoapParam($sesskey, 'sesskey'),
579 new SoapParam($value, 'value')
582 'uri' => $this->uri ,
586 return $this->castTo ('getRolesReturn',$res);
590 * MoodleWS: Get one role defined in Moodle
592 * @param integer $client
593 * @param string $sesskey
594 * @param string $value
595 * @return getRolesReturn
597 public function get_role_byname($client, $sesskey, $value) {
598 $res= $this->client->__call('get_role_byname', array(
599 new SoapParam($client, 'client'),
600 new SoapParam($sesskey, 'sesskey'),
601 new SoapParam($value, 'value')
604 'uri' => $this->uri ,
608 return $this->castTo ('getRolesReturn',$res);
612 * MoodleWS: Get Moodle course categories
614 * @param integer $client
615 * @param string $sesskey
616 * @return getCategoriesReturn
618 public function get_categories($client, $sesskey) {
619 $res= $this->client->__call('get_categories', array(
620 new SoapParam($client, 'client'),
621 new SoapParam($sesskey, 'sesskey')
624 'uri' => $this->uri ,
628 return $this->castTo ('getCategoriesReturn',$res);
632 * MoodleWS: Get one category defined in Moodle
634 * @param integer $client
635 * @param string $sesskey
636 * @param string $value
637 * @return getCategoriesReturn
639 public function get_category_byid($client, $sesskey, $value) {
640 $res= $this->client->__call('get_category_byid', array(
641 new SoapParam($client, 'client'),
642 new SoapParam($sesskey, 'sesskey'),
643 new SoapParam($value, 'value')
646 'uri' => $this->uri ,
650 return $this->castTo ('getCategoriesReturn',$res);
654 * MoodleWS: Get one category defined in Moodle
656 * @param integer $client
657 * @param string $sesskey
658 * @param string $value
659 * @return getCategoriesReturn
661 public function get_category_byname($client, $sesskey, $value) {
662 $res= $this->client->__call('get_category_byname', array(
663 new SoapParam($client, 'client'),
664 new SoapParam($sesskey, 'sesskey'),
665 new SoapParam($value, 'value')
668 'uri' => $this->uri ,
672 return $this->castTo ('getCategoriesReturn',$res);
676 * MoodleWS: Get Courses user identified by id is
679 * @param integer $client
680 * @param string $sesskey
681 * @param integer $uid
682 * @param string $sort
683 * @return getCoursesReturn
685 public function get_my_courses($client, $sesskey, $uid, $sort) {
686 $res= $this->client->__call('get_my_courses', array(
687 new SoapParam($client, 'client'),
688 new SoapParam($sesskey, 'sesskey'),
689 new SoapParam($uid, 'uid'),
690 new SoapParam($sort, 'sort')
693 'uri' => $this->uri ,
697 return $this->castTo ('getCoursesReturn',$res);
701 * MoodleWS: Get Courses current user identified
702 * by username is member of
704 * @param integer $client
705 * @param string $sesskey
706 * @param string $uinfo
707 * @param string $sort
708 * @return getCoursesReturn
710 public function get_my_courses_byusername($client, $sesskey, $uinfo, $sort) {
711 $res= $this->client->__call('get_my_courses_byusername', array(
712 new SoapParam($client, 'client'),
713 new SoapParam($sesskey, 'sesskey'),
714 new SoapParam($uinfo, 'uinfo'),
715 new SoapParam($sort, 'sort')
718 'uri' => $this->uri ,
722 return $this->castTo ('getCoursesReturn',$res);
726 * MoodleWS: Get Courses current user identified
727 * by idnumber is member of
729 * @param integer $client
730 * @param string $sesskey
731 * @param string $uinfo
732 * @param string $sort
733 * @return getCoursesReturn
735 public function get_my_courses_byidnumber($client, $sesskey, $uinfo, $sort) {
736 $res= $this->client->__call('get_my_courses_byidnumber', array(
737 new SoapParam($client, 'client'),
738 new SoapParam($sesskey, 'sesskey'),
739 new SoapParam($uinfo, 'uinfo'),
740 new SoapParam($sort, 'sort')
743 'uri' => $this->uri ,
747 return $this->castTo ('getCoursesReturn',$res);
751 * MoodleWS: Get user info from Moodle user login
754 * @param integer $client
755 * @param string $sesskey
756 * @param string $userinfo
757 * @return getUsersReturn
759 public function get_user_byusername($client, $sesskey, $userinfo) {
760 $res= $this->client->__call('get_user_byusername', array(
761 new SoapParam($client, 'client'),
762 new SoapParam($sesskey, 'sesskey'),
763 new SoapParam($userinfo, 'userinfo')
766 'uri' => $this->uri ,
770 return $this->castTo ('getUsersReturn',$res);
774 * MoodleWS: Get user info from Moodle user id number
777 * @param integer $client
778 * @param string $sesskey
779 * @param string $userinfo
780 * @return getUsersReturn
782 public function get_user_byidnumber($client, $sesskey, $userinfo) {
783 $res= $this->client->__call('get_user_byidnumber', array(
784 new SoapParam($client, 'client'),
785 new SoapParam($sesskey, 'sesskey'),
786 new SoapParam($userinfo, 'userinfo')
789 'uri' => $this->uri ,
793 return $this->castTo ('getUsersReturn',$res);
797 * MoodleWS: Get user info from Moodle user id
799 * @param integer $client
800 * @param string $sesskey
801 * @param string $userinfo
802 * @return getUsersReturn
804 public function get_user_byid($client, $sesskey, $userinfo) {
805 $res= $this->client->__call('get_user_byid', array(
806 new SoapParam($client, 'client'),
807 new SoapParam($sesskey, 'sesskey'),
808 new SoapParam($userinfo, 'userinfo')
811 'uri' => $this->uri ,
815 return $this->castTo ('getUsersReturn',$res);
819 * MoodleWS: Get users having a role in a course
822 * @param integer $client
823 * @param string $sesskey
824 * @param string $idcourse
825 * @param string $idfield
826 * @param integer $idrole
827 * @return getUsersReturn
829 public function get_users_bycourse($client, $sesskey, $idcourse, $idfield, $idrole) {
830 $res= $this->client->__call('get_users_bycourse', array(
831 new SoapParam($client, 'client'),
832 new SoapParam($sesskey, 'sesskey'),
833 new SoapParam($idcourse, 'idcourse'),
834 new SoapParam($idfield, 'idfield'),
835 new SoapParam($idrole, 'idrole')
838 'uri' => $this->uri ,
842 return $this->castTo ('getUsersReturn',$res);
846 * MoodleWS: count users having a role in a course
849 * @param integer $client
850 * @param string $sesskey
851 * @param string $idcourse
852 * @param string $idfield
853 * @param integer $idrole
856 public function count_users_bycourse($client, $sesskey, $idcourse, $idfield, $idrole) {
857 $res= $this->client->__call('count_users_bycourse', array(
858 new SoapParam($client, 'client'),
859 new SoapParam($sesskey, 'sesskey'),
860 new SoapParam($idcourse, 'idcourse'),
861 new SoapParam($idfield, 'idfield'),
862 new SoapParam($idrole, 'idrole')
865 'uri' => $this->uri ,
873 * MoodleWS: Get Courses belonging to category
875 * @param integer $client
876 * @param string $sesskey
877 * @param integer $categoryid
878 * @return getCoursesReturn
880 public function get_courses_bycategory($client, $sesskey, $categoryid) {
881 $res= $this->client->__call('get_courses_bycategory', array(
882 new SoapParam($client, 'client'),
883 new SoapParam($sesskey, 'sesskey'),
884 new SoapParam($categoryid, 'categoryid')
887 'uri' => $this->uri ,
891 return $this->castTo ('getCoursesReturn',$res);
895 * MoodleWS: Get Course groups
897 * @param integer $client
898 * @param string $sesskey
899 * @param string $courseid
900 * @param string $idfield
901 * @return getGroupsReturn
903 public function get_groups_bycourse($client, $sesskey, $courseid, $idfield) {
904 $res= $this->client->__call('get_groups_bycourse', array(
905 new SoapParam($client, 'client'),
906 new SoapParam($sesskey, 'sesskey'),
907 new SoapParam($courseid, 'courseid'),
908 new SoapParam($idfield, 'idfield')
911 'uri' => $this->uri ,
915 return $this->castTo ('getGroupsReturn',$res);
919 * MoodleWS: Get Course Information
921 * @param integer $client
922 * @param string $sesskey
923 * @param string $info
924 * @param integer $courseid
925 * @return getGroupsReturn
927 public function get_group_byid($client, $sesskey, $info, $courseid) {
928 $res= $this->client->__call('get_group_byid', array(
929 new SoapParam($client, 'client'),
930 new SoapParam($sesskey, 'sesskey'),
931 new SoapParam($info, 'info'),
932 new SoapParam($courseid, 'courseid')
935 'uri' => $this->uri ,
939 return $this->castTo ('getGroupsReturn',$res);
943 * MoodleWS: Get Course Information
945 * @param integer $client
946 * @param string $sesskey
947 * @param string $info
948 * @param integer $courseid
949 * @return getGroupsReturn
951 public function get_groups_byname($client, $sesskey, $info, $courseid) {
952 $res= $this->client->__call('get_groups_byname', array(
953 new SoapParam($client, 'client'),
954 new SoapParam($sesskey, 'sesskey'),
955 new SoapParam($info, 'info'),
956 new SoapParam($courseid, 'courseid')
959 'uri' => $this->uri ,
963 return $this->castTo ('getGroupsReturn',$res);
967 * MoodleWS: Get users members of a group in course
970 * @param integer $client
971 * @param string $sesskey
972 * @param integer $groupid
973 * @return getUsersReturn
975 public function get_group_members($client, $sesskey, $groupid) {
976 $res= $this->client->__call('get_group_members', array(
977 new SoapParam($client, 'client'),
978 new SoapParam($sesskey, 'sesskey'),
979 new SoapParam($groupid, 'groupid')
982 'uri' => $this->uri ,
986 return $this->castTo ('getUsersReturn',$res);
990 * MoodleWS: get current user Moodle internal id
993 * @param integer $client
994 * @param string $sesskey
997 public function get_my_id($client, $sesskey) {
998 $res= $this->client->__call('get_my_id', array(
999 new SoapParam($client, 'client'),
1000 new SoapParam($sesskey, 'sesskey')
1003 'uri' => $this->uri ,
1011 * MoodleWS: Get user group in course
1013 * @param integer $client
1014 * @param string $sesskey
1015 * @param integer $courseid
1016 * @param integer $uid
1017 * @return getGroupsReturn
1019 public function get_my_group($client, $sesskey, $courseid, $uid) {
1020 $res= $this->client->__call('get_my_group', array(
1021 new SoapParam($client, 'client'),
1022 new SoapParam($sesskey, 'sesskey'),
1023 new SoapParam($courseid, 'courseid'),
1024 new SoapParam($uid, 'uid')
1027 'uri' => $this->uri ,
1031 return $this->castTo ('getGroupsReturn',$res);
1035 * MoodleWS: Get user groups in all Moodle site
1037 * @param integer $client
1038 * @param string $sesskey
1039 * @param integer $uid
1040 * @return getGroupsReturn
1042 public function get_my_groups($client, $sesskey, $uid) {
1043 $res= $this->client->__call('get_my_groups', array(
1044 new SoapParam($client, 'client'),
1045 new SoapParam($sesskey, 'sesskey'),
1046 new SoapParam($uid, 'uid')
1049 'uri' => $this->uri ,
1053 return $this->castTo ('getGroupsReturn',$res);
1057 * MoodleWS: Get course teachers
1059 * @param integer $client
1060 * @param string $sesskey
1061 * @param string $value
1063 * @return getUsersReturn
1065 public function get_teachers($client, $sesskey, $value, $id) {
1066 $res= $this->client->__call('get_teachers', array(
1067 new SoapParam($client, 'client'),
1068 new SoapParam($sesskey, 'sesskey'),
1069 new SoapParam($value, 'value'),
1070 new SoapParam($id, 'id')
1073 'uri' => $this->uri ,
1077 return $this->castTo ('getUsersReturn',$res);
1081 * MoodleWS: Get course students
1083 * @param integer $client
1084 * @param string $sesskey
1085 * @param string $value
1087 * @return getUsersReturn
1089 public function get_students($client, $sesskey, $value, $id) {
1090 $res= $this->client->__call('get_students', array(
1091 new SoapParam($client, 'client'),
1092 new SoapParam($sesskey, 'sesskey'),
1093 new SoapParam($value, 'value'),
1094 new SoapParam($id, 'id')
1097 'uri' => $this->uri ,
1101 return $this->castTo ('getUsersReturn',$res);
1105 * MoodleWS: check if user has a given role in a
1108 * @param integer $client
1109 * @param string $sesskey
1110 * @param string $iduser
1111 * @param string $iduserfield
1112 * @param string $idcourse
1113 * @param string $idcoursefield
1114 * @param integer $idrole
1117 public function has_role_incourse($client, $sesskey, $iduser, $iduserfield, $idcourse, $idcoursefield, $idrole) {
1118 $res= $this->client->__call('has_role_incourse', array(
1119 new SoapParam($client, 'client'),
1120 new SoapParam($sesskey, 'sesskey'),
1121 new SoapParam($iduser, 'iduser'),
1122 new SoapParam($iduserfield, 'iduserfield'),
1123 new SoapParam($idcourse, 'idcourse'),
1124 new SoapParam($idcoursefield, 'idcoursefield'),
1125 new SoapParam($idrole, 'idrole')
1128 'uri' => $this->uri ,
1136 * MoodleWS: returns user s primary role in a given
1139 * @param integer $client
1140 * @param string $sesskey
1141 * @param string $iduser
1142 * @param string $iduserfield
1143 * @param string $idcourse
1144 * @param string $idcoursefield
1147 public function get_primaryrole_incourse($client, $sesskey, $iduser, $iduserfield, $idcourse, $idcoursefield) {
1148 $res= $this->client->__call('get_primaryrole_incourse', array(
1149 new SoapParam($client, 'client'),
1150 new SoapParam($sesskey, 'sesskey'),
1151 new SoapParam($iduser, 'iduser'),
1152 new SoapParam($iduserfield, 'iduserfield'),
1153 new SoapParam($idcourse, 'idcourse'),
1154 new SoapParam($idcoursefield, 'idcoursefield')
1157 'uri' => $this->uri ,
1165 * MoodleWS: Get user most recent activities in a
1168 * @param integer $client
1169 * @param string $sesskey
1170 * @param string $iduser
1171 * @param string $iduserfield
1172 * @param string $idcourse
1173 * @param string $idcoursefield
1174 * @param integer $idlimit
1175 * @return getActivitiesReturn
1177 public function get_activities($client, $sesskey, $iduser, $iduserfield, $idcourse, $idcoursefield, $idlimit) {
1178 $res= $this->client->__call('get_activities', array(
1179 new SoapParam($client, 'client'),
1180 new SoapParam($sesskey, 'sesskey'),
1181 new SoapParam($iduser, 'iduser'),
1182 new SoapParam($iduserfield, 'iduserfield'),
1183 new SoapParam($idcourse, 'idcourse'),
1184 new SoapParam($idcoursefield, 'idcoursefield'),
1185 new SoapParam($idlimit, 'idlimit')
1188 'uri' => $this->uri ,
1192 return $this->castTo ('getActivitiesReturn',$res);
1196 * MoodleWS: count user most recent activities in
1199 * @param integer $client
1200 * @param string $sesskey
1201 * @param string $value1
1202 * @param string $id1
1203 * @param string $value2
1204 * @param string $id2
1207 public function count_activities($client, $sesskey, $value1, $id1, $value2, $id2) {
1208 $res= $this->client->__call('count_activities', array(
1209 new SoapParam($client, 'client'),
1210 new SoapParam($sesskey, 'sesskey'),
1211 new SoapParam($value1, 'value1'),
1212 new SoapParam($id1, 'id1'),
1213 new SoapParam($value2, 'value2'),
1214 new SoapParam($id2, 'id2')
1217 'uri' => $this->uri ,