MDL-58333 enrol: Include course progress in course listing WS
[moodle.git] / lib / db / services.php
CommitLineData
9a0df45a 1<?php
9a0df45a 2// This file is part of Moodle - http://moodle.org/
3//
4// Moodle is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Moodle is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16
a0a07014 17
9a0df45a 18/**
19 * Core external functions and service definitions.
20 *
39b90b51
EL
21 * The functions and services defined on this file are
22 * processed and registered into the Moodle DB after any
23 * install or upgrade operation. All plugins support this.
24 *
25 * For more information, take a look to the documentation available:
26 * - Webservices API: {@link http://docs.moodle.org/dev/Web_services_API}
27 * - External API: {@link http://docs.moodle.org/dev/External_functions_API}
28 * - Upgrade API: {@link http://docs.moodle.org/dev/Upgrade_API}
29 *
a0a07014
JM
30 * @package core_webservice
31 * @category webservice
32 * @copyright 2009 Petr Skodak
9a0df45a 33 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
34 */
35
36$functions = array(
83e4dc17
JL
37 'core_auth_confirm_user' => array(
38 'classname' => 'core_auth_external',
39 'methodname' => 'confirm_user',
40 'description' => 'Confirm a user account.',
41 'type' => 'write',
42 'ajax' => true,
43 'loginrequired' => false,
44 ),
f23e9b6b
CB
45 'core_badges_get_user_badges' => array(
46 'classname' => 'core_badges_external',
47 'methodname' => 'get_user_badges',
48 'description' => 'Returns the list of badges awarded to a user.',
49 'type' => 'read',
ee7295ee
JL
50 'capabilities' => 'moodle/badges:viewotherbadges',
51 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
088645e2 52 ),
f23e9b6b
CB
53 'core_calendar_create_calendar_events' => array(
54 'classname' => 'core_calendar_external',
55 'methodname' => 'create_calendar_events',
56 'description' => 'Create calendar events',
57 'classpath' => 'calendar/externallib.php',
58 'type' => 'write',
59 'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries'
088645e2 60 ),
f23e9b6b
CB
61 'core_calendar_delete_calendar_events' => array(
62 'classname' => 'core_calendar_external',
63 'methodname' => 'delete_calendar_events',
64 'description' => 'Delete calendar events',
65 'classpath' => 'calendar/externallib.php',
66 'type' => 'write',
67 'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries'
088645e2 68 ),
f23e9b6b
CB
69 'core_calendar_get_calendar_events' => array(
70 'classname' => 'core_calendar_external',
71 'methodname' => 'get_calendar_events',
72 'description' => 'Get calendar events',
73 'classpath' => 'calendar/externallib.php',
74 'type' => 'read',
ee7295ee
JL
75 'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
76 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
088645e2 77 ),
c0f877fa
MN
78 'core_calendar_get_action_events_by_timesort' => array(
79 'classname' => 'core_calendar_external',
80 'methodname' => 'get_calendar_action_events_by_timesort',
81 'description' => 'Get calendar action events by tiemsort',
82 'classpath' => 'calendar/externallib.php',
83 'type' => 'read',
84 'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
60774b28
RW
85 'ajax' => true,
86 ),
87 'core_calendar_get_action_events_by_course' => array(
88 'classname' => 'core_calendar_external',
89 'methodname' => 'get_calendar_action_events_by_course',
90 'description' => 'Get calendar action events by course',
91 'classpath' => 'calendar/externallib.php',
92 'type' => 'read',
93 'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
9b8e5057
RW
94 'ajax' => true,
95 ),
96 'core_calendar_get_action_events_by_courses' => array(
97 'classname' => 'core_calendar_external',
98 'methodname' => 'get_calendar_action_events_by_courses',
99 'description' => 'Get calendar action events by courses',
100 'classpath' => 'calendar/externallib.php',
101 'type' => 'read',
102 'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
c0f877fa
MN
103 'ajax' => true,
104 ),
088645e2 105 'core_cohort_add_cohort_members' => array(
f23e9b6b
CB
106 'classname' => 'core_cohort_external',
107 'methodname' => 'add_cohort_members',
108 'classpath' => 'cohort/externallib.php',
088645e2 109 'description' => 'Adds cohort members.',
f23e9b6b
CB
110 'type' => 'write',
111 'capabilities' => 'moodle/cohort:assign'
112 ),
113 'core_cohort_create_cohorts' => array(
114 'classname' => 'core_cohort_external',
115 'methodname' => 'create_cohorts',
116 'classpath' => 'cohort/externallib.php',
117 'description' => 'Creates new cohorts.',
118 'type' => 'write',
119 'capabilities' => 'moodle/cohort:manage'
088645e2 120 ),
088645e2 121 'core_cohort_delete_cohort_members' => array(
f23e9b6b
CB
122 'classname' => 'core_cohort_external',
123 'methodname' => 'delete_cohort_members',
124 'classpath' => 'cohort/externallib.php',
088645e2 125 'description' => 'Deletes cohort members.',
0a4f3eb2 126 'type' => 'write',
f23e9b6b
CB
127 'capabilities' => 'moodle/cohort:assign'
128 ),
129 'core_cohort_delete_cohorts' => array(
130 'classname' => 'core_cohort_external',
131 'methodname' => 'delete_cohorts',
132 'classpath' => 'cohort/externallib.php',
133 'description' => 'Deletes all specified cohorts.',
0a4f3eb2 134 'type' => 'write',
f23e9b6b 135 'capabilities' => 'moodle/cohort:manage'
088645e2 136 ),
088645e2 137 'core_cohort_get_cohort_members' => array(
f23e9b6b
CB
138 'classname' => 'core_cohort_external',
139 'methodname' => 'get_cohort_members',
140 'classpath' => 'cohort/externallib.php',
088645e2 141 'description' => 'Returns cohort members.',
f23e9b6b
CB
142 'type' => 'read',
143 'capabilities' => 'moodle/cohort:view'
e77a0f36 144 ),
f23e9b6b
CB
145 'core_cohort_get_cohorts' => array(
146 'classname' => 'core_cohort_external',
147 'methodname' => 'get_cohorts',
148 'classpath' => 'cohort/externallib.php',
149 'description' => 'Returns cohort details.',
150 'type' => 'read',
151 'capabilities' => 'moodle/cohort:view'
d3549931 152 ),
f23e9b6b
CB
153 'core_cohort_update_cohorts' => array(
154 'classname' => 'core_cohort_external',
155 'methodname' => 'update_cohorts',
156 'classpath' => 'cohort/externallib.php',
157 'description' => 'Updates existing cohorts.',
158 'type' => 'write',
159 'capabilities' => 'moodle/cohort:manage'
d3549931 160 ),
f23e9b6b
CB
161 'core_comment_get_comments' => array(
162 'classname' => 'core_comment_external',
163 'methodname' => 'get_comments',
164 'description' => 'Returns comments.',
165 'type' => 'read',
ee7295ee
JL
166 'capabilities' => 'moodle/comment:view',
167 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
5d1017e1 168 ),
f23e9b6b
CB
169 'core_completion_get_activities_completion_status' => array(
170 'classname' => 'core_completion_external',
171 'methodname' => 'get_activities_completion_status',
172 'description' => 'Return the activities completion status for a user in a course.',
173 'type' => 'read',
ee7295ee 174 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9a0df45a 175 ),
f23e9b6b
CB
176 'core_completion_get_course_completion_status' => array(
177 'classname' => 'core_completion_external',
178 'methodname' => 'get_course_completion_status',
179 'description' => 'Returns course completion status.',
180 'type' => 'read',
ee7295ee
JL
181 'capabilities' => 'report/completion:view',
182 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
5d1017e1 183 ),
f23e9b6b
CB
184 'core_completion_mark_course_self_completed' => array(
185 'classname' => 'core_completion_external',
186 'methodname' => 'mark_course_self_completed',
187 'description' => 'Update the course completion status for the current user (if course self-completion is enabled).',
188 'type' => 'write',
ee7295ee 189 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9a0df45a 190 ),
f23e9b6b
CB
191 'core_completion_update_activity_completion_status_manually' => array(
192 'classname' => 'core_completion_external',
193 'methodname' => 'update_activity_completion_status_manually',
194 'description' => 'Update completion status for the current user in an activity, only for activities with manual tracking.',
195 'type' => 'write',
ee7295ee 196 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
5d1017e1 197 ),
f23e9b6b
CB
198 'core_course_create_categories' => array(
199 'classname' => 'core_course_external',
200 'methodname' => 'create_categories',
201 'classpath' => 'course/externallib.php',
202 'description' => 'Create course categories',
203 'type' => 'write',
204 'capabilities' => 'moodle/category:manage'
246f6da2 205 ),
f23e9b6b
CB
206 'core_course_create_courses' => array(
207 'classname' => 'core_course_external',
208 'methodname' => 'create_courses',
209 'classpath' => 'course/externallib.php',
210 'description' => 'Create new courses',
211 'type' => 'write',
212 'capabilities' => 'moodle/course:create, moodle/course:visibility'
5d1017e1 213 ),
f23e9b6b
CB
214 'core_course_delete_categories' => array(
215 'classname' => 'core_course_external',
216 'methodname' => 'delete_categories',
217 'classpath' => 'course/externallib.php',
218 'description' => 'Delete course categories',
219 'type' => 'write',
220 'capabilities' => 'moodle/category:manage'
9a0df45a 221 ),
f23e9b6b
CB
222 'core_course_delete_courses' => array(
223 'classname' => 'core_course_external',
224 'methodname' => 'delete_courses',
225 'classpath' => 'course/externallib.php',
226 'description' => 'Deletes all specified courses',
227 'type' => 'write',
228 'capabilities' => 'moodle/course:delete'
5d1017e1 229 ),
f23e9b6b
CB
230 'core_course_delete_modules' => array(
231 'classname' => 'core_course_external',
232 'methodname' => 'delete_modules',
233 'classpath' => 'course/externallib.php',
234 'description' => 'Deletes all specified module instances',
235 'type' => 'write',
236 'capabilities' => 'moodle/course:manageactivities'
9a0df45a 237 ),
f23e9b6b
CB
238 'core_course_duplicate_course' => array(
239 'classname' => 'core_course_external',
240 'methodname' => 'duplicate_course',
241 'classpath' => 'course/externallib.php',
242 'description' => 'Duplicate an existing course (creating a new one), without user data',
243 'type' => 'write',
244 'capabilities' => 'moodle/backup:backupcourse, moodle/restore:restorecourse, moodle/course:create'
5d1017e1 245 ),
f23e9b6b
CB
246 'core_course_get_categories' => array(
247 'classname' => 'core_course_external',
248 'methodname' => 'get_categories',
249 'classpath' => 'course/externallib.php',
250 'description' => 'Return category details',
251 'type' => 'read',
331e038b
JL
252 'capabilities' => 'moodle/category:viewhiddencategories',
253 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9a0df45a 254 ),
f23e9b6b
CB
255 'core_course_get_contents' => array(
256 'classname' => 'core_course_external',
257 'methodname' => 'get_course_contents',
258 'classpath' => 'course/externallib.php',
259 'description' => 'Get course contents',
260 'type' => 'read',
ee7295ee
JL
261 'capabilities' => 'moodle/course:update, moodle/course:viewhiddencourses',
262 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9a0df45a 263 ),
f23e9b6b
CB
264 'core_course_get_course_module' => array(
265 'classname' => 'core_course_external',
266 'methodname' => 'get_course_module',
267 'classpath' => 'course/externallib.php',
268 'description' => 'Return information about a course module',
269 'type' => 'read',
ee7295ee 270 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
5d1017e1 271 ),
f23e9b6b
CB
272 'core_course_get_course_module_by_instance' => array(
273 'classname' => 'core_course_external',
274 'methodname' => 'get_course_module_by_instance',
275 'classpath' => 'course/externallib.php',
276 'description' => 'Return information about a given module name and instance id',
277 'type' => 'read',
ee7295ee 278 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
7ce23590 279 ),
4529327a
MG
280 'core_course_get_module' => array(
281 'classname' => 'core_course_external',
282 'methodname' => 'get_module',
283 'classpath' => 'course/externallib.php',
284 'description' => 'Returns html with one activity module on course page',
285 'type' => 'read',
286 'ajax' => true,
287 ),
288 'core_course_edit_module' => array(
289 'classname' => 'core_course_external',
290 'methodname' => 'edit_module',
291 'classpath' => 'course/externallib.php',
292 'description' => 'Performs an action on course module (change visibility, duplicate, delete, etc.)',
293 'type' => 'write',
294 'ajax' => true,
295 ),
296 'core_course_edit_section' => array(
297 'classname' => 'core_course_external',
298 'methodname' => 'edit_section',
299 'classpath' => 'course/externallib.php',
300 'description' => 'Performs an action on course section (change visibility, set marker, delete)',
301 'type' => 'write',
302 'ajax' => true,
303 ),
f23e9b6b
CB
304 'core_course_get_courses' => array(
305 'classname' => 'core_course_external',
306 'methodname' => 'get_courses',
307 'classpath' => 'course/externallib.php',
308 'description' => 'Return course details',
309 'type' => 'read',
310 'capabilities' => 'moodle/course:view, moodle/course:update, moodle/course:viewhiddencourses',
5041600d 311 'ajax' => true,
ee7295ee 312 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
7ce23590 313 ),
f23e9b6b
CB
314 'core_course_import_course' => array(
315 'classname' => 'core_course_external',
316 'methodname' => 'import_course',
317 'classpath' => 'course/externallib.php',
318 'description' => 'Import course data from a course into another course. Does not include any user data.',
319 'type' => 'write',
320 'capabilities' => 'moodle/backup:backuptargetimport, moodle/restore:restoretargetimport'
7ce23590 321 ),
f23e9b6b
CB
322 'core_course_search_courses' => array(
323 'classname' => 'core_course_external',
324 'methodname' => 'search_courses',
325 'classpath' => 'course/externallib.php',
326 'description' => 'Search courses by (name, module, block, tag)',
327 'type' => 'read',
5041600d 328 'ajax' => true,
ee7295ee 329 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
7ce23590 330 ),
f23e9b6b
CB
331 'core_course_update_categories' => array(
332 'classname' => 'core_course_external',
333 'methodname' => 'update_categories',
334 'classpath' => 'course/externallib.php',
335 'description' => 'Update categories',
336 'type' => 'write',
337 'capabilities' => 'moodle/category:manage',
7ce23590 338 ),
f23e9b6b
CB
339 'core_course_update_courses' => array(
340 'classname' => 'core_course_external',
341 'methodname' => 'update_courses',
342 'classpath' => 'course/externallib.php',
343 'description' => 'Update courses',
344 'type' => 'write',
345 'capabilities' => 'moodle/course:update, moodle/course:changecategory, moodle/course:changefullname, '
346 . 'moodle/course:changeshortname, moodle/course:changeidnumber, moodle/course:changesummary, moodle/course:visibility'
7ce23590 347 ),
f23e9b6b
CB
348 'core_course_view_course' => array(
349 'classname' => 'core_course_external',
350 'methodname' => 'view_course',
351 'classpath' => 'course/externallib.php',
352 'description' => 'Log that the course was viewed',
353 'type' => 'write',
ee7295ee 354 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
7ce23590 355 ),
7c4e686f
JL
356 'core_course_get_activities_overview' => array(
357 'classname' => 'core_course_external',
358 'methodname' => 'get_activities_overview',
359 'classpath' => 'course/externallib.php',
e9dfeec9
MN
360 'description' => '** DEPRECATED ** Please do not call this function any more.
361 Return activities overview for the given courses.',
7c4e686f
JL
362 'type' => 'read',
363 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
364 ),
c115ff6a
JL
365 'core_course_get_user_navigation_options' => array(
366 'classname' => 'core_course_external',
367 'methodname' => 'get_user_navigation_options',
368 'classpath' => 'course/externallib.php',
369 'description' => 'Return a list of navigation options in a set of courses that are avaialable or not for the current user.',
370 'type' => 'read',
371 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
372 ),
b9050b10
JL
373 'core_course_get_user_administration_options' => array(
374 'classname' => 'core_course_external',
375 'methodname' => 'get_user_administration_options',
376 'classpath' => 'course/externallib.php',
377 'description' => 'Return a list of administration options in a set of courses that are avaialable or not for the current
378 user.',
379 'type' => 'read',
380 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
381 ),
80adabef
JL
382 'core_course_get_courses_by_field' => array(
383 'classname' => 'core_course_external',
384 'methodname' => 'get_courses_by_field',
385 'classpath' => 'course/externallib.php',
386 'description' => 'Get courses matching a specific field (id/s, shortname, idnumber, category)',
387 'type' => 'read',
388 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
389 ),
26659f62
JL
390 'core_course_check_updates' => array(
391 'classname' => 'core_course_external',
392 'methodname' => 'check_updates',
393 'classpath' => 'course/externallib.php',
394 'description' => 'Check if there is updates affecting the user for the given course and contexts.',
395 'type' => 'read',
396 'ajax' => true,
397 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
398 ),
879a8f56
JL
399 'core_course_get_updates_since' => array(
400 'classname' => 'core_course_external',
401 'methodname' => 'get_updates_since',
402 'classpath' => 'course/externallib.php',
403 'description' => 'Check if there are updates affecting the user for the given course since the given time stamp.',
404 'type' => 'read',
405 'ajax' => true,
406 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
407 ),
f23e9b6b
CB
408 'core_enrol_get_course_enrolment_methods' => array(
409 'classname' => 'core_enrol_external',
410 'methodname' => 'get_course_enrolment_methods',
411 'classpath' => 'enrol/externallib.php',
412 'description' => 'Get the list of course enrolment methods',
413 'type' => 'read',
ee7295ee 414 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
5d62e813 415 ),
f23e9b6b
CB
416 'core_enrol_get_enrolled_users' => array(
417 'classname' => 'core_enrol_external',
418 'methodname' => 'get_enrolled_users',
419 'classpath' => 'enrol/externallib.php',
420 'description' => 'Get enrolled users by course id.',
421 'type' => 'read',
422 'capabilities' => 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, '
ee7295ee
JL
423 . 'moodle/site:accessallgroups',
424 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
7107c2f0 425 ),
f23e9b6b
CB
426 'core_enrol_get_enrolled_users_with_capability' => array(
427 'classname' => 'core_enrol_external',
428 'methodname' => 'get_enrolled_users_with_capability',
429 'classpath' => 'enrol/externallib.php',
430 'description' => 'For each course and capability specified, return a list of the users that are enrolled in the course
431 and have that capability',
432 'type' => 'read',
c0ef63eb 433 ),
f23e9b6b
CB
434 'core_enrol_get_users_courses' => array(
435 'classname' => 'core_enrol_external',
436 'methodname' => 'get_users_courses',
437 'classpath' => 'enrol/externallib.php',
438 'description' => 'Get the list of courses where a user is enrolled in',
439 'type' => 'read',
ee7295ee
JL
440 'capabilities' => 'moodle/course:viewparticipants',
441 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9857381d 442 ),
f23e9b6b
CB
443 'core_fetch_notifications' => array(
444 'classname' => 'core_external',
445 'methodname' => 'fetch_notifications',
446 'classpath' => 'lib/external/externallib.php',
447 'description' => 'Return a list of notifications for the current session',
448 'type' => 'read',
5041600d
RT
449 'loginrequired' => false,
450 'ajax' => true,
5d1017e1 451 ),
5d1017e1 452 'core_files_get_files' => array(
f23e9b6b
CB
453 'classname' => 'core_files_external',
454 'methodname' => 'get_files',
249c4f60 455 'description' => 'browse moodle files',
f23e9b6b
CB
456 'type' => 'read',
457 'classpath' => 'files/externallib.php',
ee7295ee 458 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
5d1017e1 459 ),
5d1017e1 460 'core_files_upload' => array(
f23e9b6b
CB
461 'classname' => 'core_files_external',
462 'methodname' => 'upload',
249c4f60
DC
463 'description' => 'upload a file to moodle',
464 'type' => 'write',
465 'classpath' => 'files/externallib.php',
466 ),
f23e9b6b
CB
467 'core_get_component_strings' => array(
468 'classname' => 'core_external',
469 'methodname' => 'get_component_strings',
470 'classpath' => 'lib/external/externallib.php',
faeca20d
DM
471 'description' => 'Return all raw strings (with {$a->xxx}), for a specific component ' .
472 '- similar to core get_component_strings(), call',
f23e9b6b 473 'type' => 'read',
5041600d
RT
474 'loginrequired' => false,
475 'ajax' => true,
ee7295ee 476 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
3364dbb5 477 ),
f23e9b6b
CB
478 'core_get_fragment' => array(
479 'classname' => 'core_external',
480 'methodname' => 'get_fragment',
481 'classpath' => 'lib/external/externallib.php',
482 'description' => 'Return a fragment for inclusion, such as a JavaScript page.',
483 'type' => 'read',
5041600d 484 'ajax' => true,
5d1017e1 485 ),
f23e9b6b
CB
486 'core_get_string' => array(
487 'classname' => 'core_external',
488 'methodname' => 'get_string',
489 'classpath' => 'lib/external/externallib.php',
490 'description' => 'Return a translated string - similar to core get_string(), call',
491 'type' => 'read',
5041600d
RT
492 'loginrequired' => false,
493 'ajax' => true,
be9bf94e 494 ),
f23e9b6b
CB
495 'core_get_strings' => array(
496 'classname' => 'core_external',
497 'methodname' => 'get_strings',
498 'classpath' => 'lib/external/externallib.php',
499 'description' => 'Return some translated strings - like several core get_string(), calls',
500 'type' => 'read',
5041600d
RT
501 'loginrequired' => false,
502 'ajax' => true,
5d1017e1 503 ),
88c2941b
RW
504 'core_get_user_dates' => array(
505 'classname' => 'core_external',
506 'methodname' => 'get_user_dates',
507 'classpath' => 'lib/external/externallib.php',
508 'description' => 'Return formatted timestamps',
509 'type' => 'read',
510 'ajax' => true,
511 ),
f23e9b6b
CB
512 'core_grades_get_grades' => array(
513 'classname' => 'core_grades_external',
514 'methodname' => 'get_grades',
aa7e371a
JL
515 'description' => '** DEPRECATED ** Please do not call this function any more.
516 Returns student course total grade and grades for activities.
f23e9b6b
CB
517 This function does not return category or manual items.
518 This function is suitable for managers or teachers not students.',
519 'type' => 'read',
520 'capabilities' => 'moodle/grade:view, moodle/grade:viewall, moodle/grade:viewhidden'
e9b66095 521 ),
f23e9b6b
CB
522 'core_grades_update_grades' => array(
523 'classname' => 'core_grades_external',
524 'methodname' => 'update_grades',
525 'description' => 'Update a grade item and associated student grades.',
526 'type' => 'write',
5d1017e1 527 ),
f23e9b6b
CB
528 'core_grading_get_definitions' => array(
529 'classname' => 'core_grading_external',
530 'methodname' => 'get_definitions',
531 'description' => 'Get grading definitions',
532 'type' => 'read',
e9b66095 533 ),
f23e9b6b
CB
534 'core_grading_get_gradingform_instances' => array(
535 'classname' => 'core_grading_external',
536 'methodname' => 'get_gradingform_instances',
537 'description' => 'Get grading form instances',
538 'type' => 'read',
f2229c68 539 ),
f23e9b6b
CB
540 'core_grading_save_definitions' => array(
541 'classname' => 'core_grading_external',
542 'methodname' => 'save_definitions',
543 'description' => 'Save grading definitions',
544 'type' => 'write',
5d1017e1 545 ),
f23e9b6b
CB
546 'core_group_add_group_members' => array(
547 'classname' => 'core_group_external',
548 'methodname' => 'add_group_members',
549 'classpath' => 'group/externallib.php',
550 'description' => 'Adds group members.',
551 'type' => 'write',
552 'capabilities' => 'moodle/course:managegroups',
6bb31e40 553 ),
f23e9b6b
CB
554 'core_group_assign_grouping' => array(
555 'classname' => 'core_group_external',
556 'methodname' => 'assign_grouping',
557 'classpath' => 'group/externallib.php',
558 'description' => 'Assing groups from groupings',
559 'type' => 'write',
740c354f 560 ),
f23e9b6b
CB
561 'core_group_create_groupings' => array(
562 'classname' => 'core_group_external',
563 'methodname' => 'create_groupings',
564 'classpath' => 'group/externallib.php',
565 'description' => 'Creates new groupings',
566 'type' => 'write',
5d1017e1 567 ),
f23e9b6b
CB
568 'core_group_create_groups' => array(
569 'classname' => 'core_group_external',
570 'methodname' => 'create_groups',
571 'classpath' => 'group/externallib.php',
572 'description' => 'Creates new groups.',
573 'type' => 'write',
574 'capabilities' => 'moodle/course:managegroups'
6bb31e40 575 ),
f23e9b6b
CB
576 'core_group_delete_group_members' => array(
577 'classname' => 'core_group_external',
578 'methodname' => 'delete_group_members',
579 'classpath' => 'group/externallib.php',
580 'description' => 'Deletes group members.',
0a4f3eb2 581 'type' => 'write',
f23e9b6b 582 'capabilities' => 'moodle/course:managegroups'
63a85dc7 583 ),
f23e9b6b
CB
584 'core_group_delete_groupings' => array(
585 'classname' => 'core_group_external',
586 'methodname' => 'delete_groupings',
587 'classpath' => 'group/externallib.php',
588 'description' => 'Deletes all specified groupings.',
79949c1b 589 'type' => 'write',
79949c1b 590 ),
f23e9b6b
CB
591 'core_group_delete_groups' => array(
592 'classname' => 'core_group_external',
593 'methodname' => 'delete_groups',
594 'classpath' => 'group/externallib.php',
595 'description' => 'Deletes all specified groups.',
0a4f3eb2 596 'type' => 'write',
f23e9b6b 597 'capabilities' => 'moodle/course:managegroups'
3dc1d76e 598 ),
f23e9b6b
CB
599 'core_group_get_activity_allowed_groups' => array(
600 'classname' => 'core_group_external',
601 'methodname' => 'get_activity_allowed_groups',
602 'classpath' => 'group/externallib.php',
603 'description' => 'Gets a list of groups that the user is allowed to access within the specified activity.',
604 'type' => 'read',
ee7295ee 605 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
791723c3 606 ),
f23e9b6b
CB
607 'core_group_get_activity_groupmode' => array(
608 'classname' => 'core_group_external',
609 'methodname' => 'get_activity_groupmode',
610 'classpath' => 'group/externallib.php',
611 'description' => 'Returns effective groupmode used in a given activity.',
612 'type' => 'read',
ee7295ee 613 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
c4f7bf29 614 ),
f23e9b6b
CB
615 'core_group_get_course_groupings' => array(
616 'classname' => 'core_group_external',
617 'methodname' => 'get_course_groupings',
618 'classpath' => 'group/externallib.php',
619 'description' => 'Returns all groupings in specified course.',
620 'type' => 'read',
c5158499 621 ),
f23e9b6b
CB
622 'core_group_get_course_groups' => array(
623 'classname' => 'core_group_external',
624 'methodname' => 'get_course_groups',
625 'classpath' => 'group/externallib.php',
626 'description' => 'Returns all groups in specified course.',
627 'type' => 'read',
628 'capabilities' => 'moodle/course:managegroups'
13bb6819 629 ),
f23e9b6b
CB
630 'core_group_get_course_user_groups' => array(
631 'classname' => 'core_group_external',
632 'methodname' => 'get_course_user_groups',
633 'classpath' => 'group/externallib.php',
634 'description' => 'Returns all groups in specified course for the specified user.',
635 'type' => 'read',
ee7295ee
JL
636 'capabilities' => 'moodle/course:managegroups',
637 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
3ec163dd 638 ),
f23e9b6b
CB
639 'core_group_get_group_members' => array(
640 'classname' => 'core_group_external',
641 'methodname' => 'get_group_members',
642 'classpath' => 'group/externallib.php',
643 'description' => 'Returns group members.',
644 'type' => 'read',
645 'capabilities' => 'moodle/course:managegroups'
479a5db1 646 ),
f23e9b6b
CB
647 'core_group_get_groupings' => array(
648 'classname' => 'core_group_external',
649 'methodname' => 'get_groupings',
650 'classpath' => 'group/externallib.php',
651 'description' => 'Returns groupings details.',
652 'type' => 'read',
3ec163dd 653 ),
f23e9b6b
CB
654 'core_group_get_groups' => array(
655 'classname' => 'core_group_external',
656 'methodname' => 'get_groups',
657 'classpath' => 'group/externallib.php',
658 'description' => 'Returns group details.',
659 'type' => 'read',
660 'capabilities' => 'moodle/course:managegroups'
2f951d86 661 ),
f23e9b6b
CB
662 'core_group_unassign_grouping' => array(
663 'classname' => 'core_group_external',
664 'methodname' => 'unassign_grouping',
665 'classpath' => 'group/externallib.php',
666 'description' => 'Unassing groups from groupings',
667 'type' => 'write',
8430d87b 668 ),
f23e9b6b
CB
669 'core_group_update_groupings' => array(
670 'classname' => 'core_group_external',
671 'methodname' => 'update_groupings',
672 'classpath' => 'group/externallib.php',
673 'description' => 'Updates existing groupings',
674 'type' => 'write',
5d1017e1 675 ),
f23e9b6b
CB
676 'core_message_block_contacts' => array(
677 'classname' => 'core_message_external',
678 'methodname' => 'block_contacts',
679 'classpath' => 'message/externallib.php',
680 'description' => 'Block contacts',
681 'type' => 'write',
c6e97f54 682 'ajax' => true,
ee7295ee 683 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
a623b6b8 684 ),
d6731600 685 'core_message_create_contacts' => array(
f23e9b6b
CB
686 'classname' => 'core_message_external',
687 'methodname' => 'create_contacts',
688 'classpath' => 'message/externallib.php',
d6731600 689 'description' => 'Add contacts to the contact list',
f23e9b6b 690 'type' => 'write',
c6e97f54 691 'ajax' => true,
ee7295ee 692 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
12d8c7b2 693 'ajax' => true,
d6731600 694 ),
d6731600 695 'core_message_delete_contacts' => array(
f23e9b6b
CB
696 'classname' => 'core_message_external',
697 'methodname' => 'delete_contacts',
698 'classpath' => 'message/externallib.php',
d6731600 699 'description' => 'Remove contacts from the contact list',
f23e9b6b 700 'type' => 'write',
c6e97f54 701 'ajax' => true,
ee7295ee 702 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
12d8c7b2 703 'ajax' => true,
d6731600 704 ),
dec0cd99
MN
705 'core_message_delete_conversation' => array(
706 'classname' => 'core_message_external',
707 'methodname' => 'delete_conversation',
708 'classpath' => 'message/externallib.php',
709 'description' => 'Deletes a conversation.',
710 'type' => 'write',
711 'capabilities' => 'moodle/site:deleteownmessage',
712 'ajax' => true,
53522c6e 713 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
dec0cd99 714 ),
f23e9b6b
CB
715 'core_message_delete_message' => array(
716 'classname' => 'core_message_external',
717 'methodname' => 'delete_message',
718 'classpath' => 'message/externallib.php',
719 'description' => 'Deletes a message.',
720 'type' => 'write',
ee7295ee 721 'capabilities' => 'moodle/site:deleteownmessage',
3090f52f 722 'ajax' => true,
ee7295ee 723 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
d6731600 724 ),
f23e9b6b
CB
725 'core_message_get_blocked_users' => array(
726 'classname' => 'core_message_external',
727 'methodname' => 'get_blocked_users',
728 'classpath' => 'message/externallib.php',
729 'description' => 'Retrieve a list of users blocked',
730 'type' => 'read',
ee7295ee 731 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
d6731600 732 ),
cd03b8d7
MN
733 'core_message_data_for_messagearea_search_messages' => array(
734 'classname' => 'core_message_external',
735 'methodname' => 'data_for_messagearea_search_messages',
736 'classpath' => 'message/externallib.php',
737 'description' => 'Retrieve the template data for searching for messages',
738 'type' => 'read',
739 'ajax' => true,
53522c6e 740 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
cd03b8d7 741 ),
48e8bdba 742 'core_message_data_for_messagearea_search_users' => array(
cd03b8d7 743 'classname' => 'core_message_external',
48e8bdba 744 'methodname' => 'data_for_messagearea_search_users',
cd03b8d7
MN
745 'classpath' => 'message/externallib.php',
746 'description' => 'Retrieve the template data for searching for people',
747 'type' => 'read',
748 'ajax' => true,
749 ),
48e8bdba 750 'core_message_data_for_messagearea_search_users_in_course' => array(
cd03b8d7 751 'classname' => 'core_message_external',
48e8bdba 752 'methodname' => 'data_for_messagearea_search_users_in_course',
cd03b8d7
MN
753 'classpath' => 'message/externallib.php',
754 'description' => 'Retrieve the template data for searching for people in a course',
755 'type' => 'read',
756 'ajax' => true,
757 ),
9aa012b5
MN
758 'core_message_data_for_messagearea_conversations' => array(
759 'classname' => 'core_message_external',
760 'methodname' => 'data_for_messagearea_conversations',
761 'classpath' => 'message/externallib.php',
762 'description' => 'Retrieve the template data for the conversation list',
763 'type' => 'read',
764 'ajax' => true,
21d9f020 765 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9aa012b5
MN
766 ),
767 'core_message_data_for_messagearea_contacts' => array(
768 'classname' => 'core_message_external',
769 'methodname' => 'data_for_messagearea_contacts',
770 'classpath' => 'message/externallib.php',
771 'description' => 'Retrieve the template data for the contact list',
772 'type' => 'read',
773 'ajax' => true,
21d9f020 774 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9aa012b5 775 ),
3cd13828
MN
776 'core_message_data_for_messagearea_messages' => array(
777 'classname' => 'core_message_external',
778 'methodname' => 'data_for_messagearea_messages',
779 'classpath' => 'message/externallib.php',
780 'description' => 'Retrieve the template data for the messages',
781 'type' => 'read',
782 'ajax' => true,
21d9f020 783 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
3cd13828 784 ),
c060cd49
MN
785 'core_message_data_for_messagearea_get_most_recent_message' => array(
786 'classname' => 'core_message_external',
787 'methodname' => 'data_for_messagearea_get_most_recent_message',
788 'classpath' => 'message/externallib.php',
789 'description' => 'Retrieve the template data for the most recent message',
790 'type' => 'read',
791 'ajax' => true,
792 ),
c6e97f54
MN
793 'core_message_data_for_messagearea_get_profile' => array(
794 'classname' => 'core_message_external',
795 'methodname' => 'data_for_messagearea_get_profile',
796 'classpath' => 'message/externallib.php',
797 'description' => 'Retrieve the template data for the users\'s profile',
798 'type' => 'read',
799 'ajax' => true,
800 ),
d6731600 801 'core_message_get_contacts' => array(
f23e9b6b
CB
802 'classname' => 'core_message_external',
803 'methodname' => 'get_contacts',
804 'classpath' => 'message/externallib.php',
d6731600 805 'description' => 'Retrieve the contact list',
f23e9b6b 806 'type' => 'read',
ee7295ee 807 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
d6731600 808 ),
aff9da17 809 'core_message_get_messages' => array(
f23e9b6b
CB
810 'classname' => 'core_message_external',
811 'methodname' => 'get_messages',
812 'classpath' => 'message/externallib.php',
813 'description' => 'Retrieve a list of messages sent and received by a user (conversations, notifications or both)',
814 'type' => 'read',
ee7295ee 815 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
3274d5ca
RW
816 'ajax' => true,
817 ),
8c55bd6c
RW
818 'core_message_get_unread_conversations_count' => array(
819 'classname' => 'core_message_external',
820 'methodname' => 'get_unread_conversations_count',
821 'classpath' => 'message/externallib.php',
822 'description' => 'Retrieve the count of unread conversations for a given user',
823 'type' => 'read',
824 'ajax' => true,
53522c6e 825 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
8c55bd6c 826 ),
3274d5ca
RW
827 'core_message_mark_all_notifications_as_read' => array(
828 'classname' => 'core_message_external',
829 'methodname' => 'mark_all_notifications_as_read',
830 'classpath' => 'message/externallib.php',
8c55bd6c
RW
831 'description' => 'Mark all notifications as read for a given user',
832 'type' => 'write',
833 'ajax' => true,
53522c6e 834 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
8c55bd6c
RW
835 ),
836 'core_message_mark_all_messages_as_read' => array(
837 'classname' => 'core_message_external',
838 'methodname' => 'mark_all_messages_as_read',
839 'classpath' => 'message/externallib.php',
840 'description' => 'Mark all messages as read for a given user',
3274d5ca
RW
841 'type' => 'write',
842 'ajax' => true,
53522c6e 843 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
60ab2e1b 844 ),
a84f89ca 845 'core_message_mark_message_read' => array(
f23e9b6b
CB
846 'classname' => 'core_message_external',
847 'methodname' => 'mark_message_read',
848 'classpath' => 'message/externallib.php',
849 'description' => 'Mark a single message as read, trigger message_viewed event.',
850 'type' => 'write',
ee7295ee 851 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
0b19d048 852 'ajax' => true,
a84f89ca 853 ),
a0eabdd3
RW
854 'core_message_message_processor_config_form' => array(
855 'classname' => 'core_message_external',
856 'methodname' => 'message_processor_config_form',
857 'classpath' => 'message/externallib.php',
858 'description' => 'Process the message processor config form',
859 'type' => 'write',
860 'ajax' => true,
53522c6e 861 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
a0eabdd3 862 ),
8c125526
RW
863 'core_message_get_message_processor' => array(
864 'classname' => 'core_message_external',
865 'methodname' => 'get_message_processor',
866 'classpath' => 'message/externallib.php',
867 'description' => 'Get a message processor',
868 'type' => 'read',
869 'ajax' => true,
870 ),
f23e9b6b
CB
871 'core_message_search_contacts' => array(
872 'classname' => 'core_message_external',
873 'methodname' => 'search_contacts',
874 'classpath' => 'message/externallib.php',
875 'description' => 'Search for contacts',
876 'type' => 'read',
ee7295ee 877 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
419b1128 878 ),
f23e9b6b
CB
879 'core_message_send_instant_messages' => array(
880 'classname' => 'core_message_external',
881 'methodname' => 'send_instant_messages',
882 'classpath' => 'message/externallib.php',
883 'description' => 'Send instant messages',
884 'type' => 'write',
ee7295ee 885 'capabilities' => 'moodle/site:sendmessage',
c060cd49 886 'ajax' => true,
ee7295ee 887 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
f23e9b6b
CB
888 ),
889 'core_message_unblock_contacts' => array(
890 'classname' => 'core_message_external',
891 'methodname' => 'unblock_contacts',
892 'classpath' => 'message/externallib.php',
893 'description' => 'Unblock contacts',
894 'type' => 'write',
c6e97f54 895 'ajax' => true,
ee7295ee 896 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
5d1017e1 897 ),
e86f0cb4
JL
898 'core_message_get_user_notification_preferences' => array(
899 'classname' => 'core_message_external',
900 'methodname' => 'get_user_notification_preferences',
901 'classpath' => 'message/externallib.php',
902 'description' => 'Get the notification preferences for a given user.',
903 'type' => 'read',
904 'capabilities' => 'moodle/user:editownmessageprofile',
905 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
906 ),
2521afd2
JL
907 'core_message_get_user_message_preferences' => array(
908 'classname' => 'core_message_external',
909 'methodname' => 'get_user_message_preferences',
910 'classpath' => 'message/externallib.php',
911 'description' => 'Get the message preferences for a given user.',
912 'type' => 'read',
913 'capabilities' => 'moodle/user:editownmessageprofile',
914 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
915 ),
5d1017e1 916 'core_notes_create_notes' => array(
f23e9b6b
CB
917 'classname' => 'core_notes_external',
918 'methodname' => 'create_notes',
919 'classpath' => 'notes/externallib.php',
8d46dabb 920 'description' => 'Create notes',
f23e9b6b 921 'type' => 'write',
ee7295ee
JL
922 'capabilities' => 'moodle/notes:manage',
923 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
8d46dabb 924 ),
34348b2b 925 'core_notes_delete_notes' => array(
f23e9b6b
CB
926 'classname' => 'core_notes_external',
927 'methodname' => 'delete_notes',
928 'classpath' => 'notes/externallib.php',
34348b2b 929 'description' => 'Delete notes',
f23e9b6b 930 'type' => 'write',
ee7295ee
JL
931 'capabilities' => 'moodle/notes:manage',
932 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
f23e9b6b
CB
933 ),
934 'core_notes_get_course_notes' => array(
935 'classname' => 'core_notes_external',
936 'methodname' => 'get_course_notes',
937 'classpath' => 'notes/externallib.php',
938 'description' => 'Returns all notes in specified course (or site), for the specified user.',
939 'type' => 'read',
ee7295ee
JL
940 'capabilities' => 'moodle/notes:view',
941 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
34348b2b 942 ),
34348b2b 943 'core_notes_get_notes' => array(
f23e9b6b
CB
944 'classname' => 'core_notes_external',
945 'methodname' => 'get_notes',
946 'classpath' => 'notes/externallib.php',
34348b2b 947 'description' => 'Get notes',
f23e9b6b
CB
948 'type' => 'read',
949 'capabilities' => 'moodle/notes:view'
34348b2b 950 ),
34348b2b 951 'core_notes_update_notes' => array(
f23e9b6b
CB
952 'classname' => 'core_notes_external',
953 'methodname' => 'update_notes',
954 'classpath' => 'notes/externallib.php',
34348b2b 955 'description' => 'Update notes',
f23e9b6b
CB
956 'type' => 'write',
957 'capabilities' => 'moodle/notes:manage'
34348b2b 958 ),
a80b5518 959 'core_notes_view_notes' => array(
f23e9b6b
CB
960 'classname' => 'core_notes_external',
961 'methodname' => 'view_notes',
962 'classpath' => 'notes/externallib.php',
963 'description' => 'Simulates the web interface view of notes/index.php: trigger events.',
964 'type' => 'write',
ee7295ee
JL
965 'capabilities' => 'moodle/notes:view',
966 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9028d9b5 967 ),
f23e9b6b
CB
968 'core_output_load_template' => array(
969 'classname' => 'core\output\external',
970 'methodname' => 'load_template',
971 'description' => 'Load a template for a renderable',
972 'type' => 'read',
5041600d
RT
973 'loginrequired' => false,
974 'ajax' => true,
0ff4ebb4 975 ),
e330b1c2 976 'core_output_load_fontawesome_icon_map' => array(
a26ce248 977 'classname' => 'core\output\external',
e330b1c2 978 'methodname' => 'load_fontawesome_icon_map',
a26ce248
DW
979 'description' => 'Load the mapping of names to icons',
980 'type' => 'read',
981 'loginrequired' => false,
982 'ajax' => true,
983 ),
f23e9b6b
CB
984 // Question related functions.
985 'core_question_update_flag' => array(
986 'classname' => 'core_question_external',
987 'methodname' => 'update_flag',
988 'description' => 'Update the flag state of a question attempt.',
989 'type' => 'write',
990 'capabilities' => 'moodle/question:flag',
ee7295ee 991 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
3f0ea6d8 992 ),
f23e9b6b
CB
993 'core_rating_get_item_ratings' => array(
994 'classname' => 'core_rating_external',
995 'methodname' => 'get_item_ratings',
996 'description' => 'Retrieve all the ratings for an item.',
997 'type' => 'read',
ee7295ee
JL
998 'capabilities' => 'moodle/rating:view',
999 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
5d1017e1 1000 ),
afb7799a
JL
1001 'core_rating_add_rating' => array(
1002 'classname' => 'core_rating_external',
1003 'methodname' => 'add_rating',
1004 'description' => 'Rates an item.',
1005 'type' => 'write',
1006 'capabilities' => 'moodle/rating:rate',
1007 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1008 ),
f23e9b6b
CB
1009 'core_role_assign_roles' => array(
1010 'classname' => 'core_role_external',
1011 'methodname' => 'assign_roles',
1012 'classpath' => 'enrol/externallib.php',
1013 'description' => 'Manual role assignments.',
1014 'type' => 'write',
1015 'capabilities' => 'moodle/role:assign'
0bf486a6 1016 ),
f23e9b6b
CB
1017 'core_role_unassign_roles' => array(
1018 'classname' => 'core_role_external',
1019 'methodname' => 'unassign_roles',
1020 'classpath' => 'enrol/externallib.php',
1021 'description' => 'Manual role unassignments.',
1022 'type' => 'write',
1023 'capabilities' => 'moodle/role:assign'
11e76602 1024 ),
f23e9b6b
CB
1025 'core_tag_get_tagindex' => array(
1026 'classname' => 'core_tag_external',
1027 'methodname' => 'get_tagindex',
1028 'description' => 'Gets tag index page for one tag and one tag area',
1029 'type' => 'read',
5041600d 1030 'ajax' => true,
11e76602 1031 ),
f23e9b6b
CB
1032 'core_tag_get_tags' => array(
1033 'classname' => 'core_tag_external',
1034 'methodname' => 'get_tags',
1035 'description' => 'Gets tags by their ids',
1036 'type' => 'read',
5041600d 1037 'ajax' => true,
11e76602 1038 ),
f23e9b6b
CB
1039 'core_tag_update_tags' => array(
1040 'classname' => 'core_tag_external',
1041 'methodname' => 'update_tags',
1042 'description' => 'Updates tags',
1043 'type' => 'write',
5041600d 1044 'ajax' => true,
cc73ea07 1045 ),
cdc5f978 1046 'core_update_inplace_editable' => array(
f23e9b6b
CB
1047 'classname' => 'core_external',
1048 'methodname' => 'update_inplace_editable',
1049 'classpath' => 'lib/external/externallib.php',
cdc5f978 1050 'description' => 'Generic service to update title',
f23e9b6b 1051 'type' => 'write',
5041600d
RT
1052 'loginrequired' => true,
1053 'ajax' => true,
c66dc3df 1054 ),
f23e9b6b
CB
1055 'core_user_add_user_device' => array(
1056 'classname' => 'core_user_external',
1057 'methodname' => 'add_user_device',
1058 'classpath' => 'user/externallib.php',
1059 'description' => 'Store mobile user devices information for PUSH Notifications.',
1060 'type' => 'write',
ee7295ee 1061 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9bdcf579 1062 ),
f23e9b6b
CB
1063 'core_user_add_user_private_files' => array(
1064 'classname' => 'core_user_external',
1065 'methodname' => 'add_user_private_files',
1066 'classpath' => 'user/externallib.php',
1067 'description' => 'Copy files from a draft area to users private files area.',
1068 'type' => 'write',
ee7295ee
JL
1069 'capabilities' => 'moodle/user:manageownfiles',
1070 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
25c49a85 1071 ),
f23e9b6b
CB
1072 'core_user_create_users' => array(
1073 'classname' => 'core_user_external',
1074 'methodname' => 'create_users',
1075 'classpath' => 'user/externallib.php',
1076 'description' => 'Create users.',
1077 'type' => 'write',
1078 'capabilities' => 'moodle/user:create'
23b398fc 1079 ),
f23e9b6b
CB
1080 'core_user_delete_users' => array(
1081 'classname' => 'core_user_external',
1082 'methodname' => 'delete_users',
1083 'classpath' => 'user/externallib.php',
1084 'description' => 'Delete users.',
1085 'type' => 'write',
1086 'capabilities' => 'moodle/user:delete'
6c785afa 1087 ),
f23e9b6b
CB
1088 'core_user_get_course_user_profiles' => array(
1089 'classname' => 'core_user_external',
1090 'methodname' => 'get_course_user_profiles',
1091 'classpath' => 'user/externallib.php',
1092 'description' => 'Get course user profiles (each of the profils matching a course id and a user id),.',
1093 'type' => 'read',
1094 'capabilities' => 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, '
ee7295ee
JL
1095 . 'moodle/site:accessallgroups',
1096 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
6c785afa 1097 ),
f23e9b6b
CB
1098 'core_user_get_users' => array(
1099 'classname' => 'core_user_external',
1100 'methodname' => 'get_users',
1101 'classpath' => 'user/externallib.php',
1102 'description' => 'search for users matching the parameters',
1103 'type' => 'read',
1104 'capabilities' => 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update'
db5b6971 1105 ),
f23e9b6b
CB
1106 'core_user_get_users_by_field' => array(
1107 'classname' => 'core_user_external',
1108 'methodname' => 'get_users_by_field',
1109 'classpath' => 'user/externallib.php',
1110 'description' => 'Retrieve users\' information for a specified unique field - If you want to do a user search, use '
1111 . 'core_user_get_users()',
1112 'type' => 'read',
ee7295ee 1113 'capabilities' => 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update',
5041600d 1114 'ajax' => true,
ee7295ee 1115 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
8e355853 1116 ),
f23e9b6b
CB
1117 'core_user_remove_user_device' => array(
1118 'classname' => 'core_user_external',
1119 'methodname' => 'remove_user_device',
1120 'classpath' => 'user/externallib.php',
1121 'description' => 'Remove a user device from the Moodle database.',
1122 'type' => 'write',
ee7295ee 1123 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
ef4c23cc 1124 ),
c598f278 1125 'core_user_update_users' => array(
a0eabdd3 1126 'classname' => 'core_user_external',
c598f278 1127 'methodname' => 'update_users',
a0eabdd3 1128 'classpath' => 'user/externallib.php',
c598f278 1129 'description' => 'Update users.',
a0eabdd3
RW
1130 'type' => 'write',
1131 'capabilities' => 'moodle/user:update',
1132 'ajax' => true,
1133 ),
c598f278 1134 'core_user_update_user_preferences' => array(
f23e9b6b 1135 'classname' => 'core_user_external',
c598f278 1136 'methodname' => 'update_user_preferences',
f23e9b6b 1137 'classpath' => 'user/externallib.php',
c598f278 1138 'description' => 'Update a user\'s preferences',
f23e9b6b 1139 'type' => 'write',
c598f278 1140 'capabilities' => 'moodle/user:editownmessageprofile, moodle/user:editmessageprofile',
a0eabdd3 1141 'ajax' => true,
6d2f938c 1142 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
c026a28d 1143 ),
f23e9b6b
CB
1144 'core_user_view_user_list' => array(
1145 'classname' => 'core_user_external',
1146 'methodname' => 'view_user_list',
1147 'classpath' => 'user/externallib.php',
1148 'description' => 'Simulates the web-interface view of user/index.php (triggering events),.',
1149 'type' => 'write',
1150 'capabilities' => 'moodle/course:viewparticipants',
ee7295ee 1151 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
7361b968 1152 ),
f23e9b6b
CB
1153 'core_user_view_user_profile' => array(
1154 'classname' => 'core_user_external',
1155 'methodname' => 'view_user_profile',
1156 'classpath' => 'user/externallib.php',
1157 'description' => 'Simulates the web-interface view of user/view.php and user/profile.php (triggering events),.',
1158 'type' => 'write',
1159 'capabilities' => 'moodle/user:viewdetails',
ee7295ee 1160 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
f4fb827e 1161 ),
45fec983
JL
1162 'core_user_get_user_preferences' => array(
1163 'classname' => 'core_user_external',
1164 'methodname' => 'get_user_preferences',
1165 'classpath' => 'user/externallib.php',
1166 'description' => 'Return user preferences.',
1167 'type' => 'read',
1168 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1169 ),
d44e2e42
JL
1170 'core_user_update_picture' => array(
1171 'classname' => 'core_user_external',
1172 'methodname' => 'update_picture',
1173 'classpath' => 'user/externallib.php',
1174 'description' => 'Update or delete the user picture in the site',
1175 'type' => 'write',
1176 'capabilities' => 'moodle/user:editownprofile, moodle/user:editprofile',
1177 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1178 ),
649777fb
JL
1179 'core_user_set_user_preferences' => array(
1180 'classname' => 'core_user_external',
1181 'methodname' => 'set_user_preferences',
1182 'classpath' => 'user/externallib.php',
1183 'description' => 'Set user preferences.',
1184 'type' => 'write',
1185 'capabilities' => 'moodle/site:config',
1186 ),
3e8145a3
JL
1187 'core_user_agree_site_policy' => array(
1188 'classname' => 'core_user_external',
1189 'methodname' => 'agree_site_policy',
1190 'classpath' => 'user/externallib.php',
1191 'description' => 'Agree the site policy for the current user.',
1192 'type' => 'write',
1193 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1194 ),
649777fb 1195
81de839f
FM
1196 // Competencies functions.
1197 'core_competency_create_competency_framework' => array(
1198 'classname' => 'core_competency\external',
1199 'methodname' => 'create_competency_framework',
1200 'classpath' => '',
1201 'description' => 'Creates new competency frameworks.',
1202 'type' => 'write',
1203 'capabilities' => 'moodle/competency:competencymanage',
1204 'ajax' => true,
1205 ),
1206 'core_competency_read_competency_framework' => array(
1207 'classname' => 'core_competency\external',
1208 'methodname' => 'read_competency_framework',
1209 'classpath' => '',
1210 'description' => 'Load a summary of a competency framework.',
1211 'type' => 'read',
1212 'capabilities' => 'moodle/competency:competencyview',
1213 'ajax' => true,
1214 ),
1215 'core_competency_duplicate_competency_framework' => array(
1216 'classname' => 'core_competency\external',
1217 'methodname' => 'duplicate_competency_framework',
1218 'classpath' => '',
1219 'description' => 'Duplicate a competency framework.',
1220 'type' => 'write',
1221 'capabilities' => 'moodle/competency:competencymanage',
1222 'ajax' => true,
1223 ),
1224 'core_competency_delete_competency_framework' => array(
1225 'classname' => 'core_competency\external',
1226 'methodname' => 'delete_competency_framework',
1227 'classpath' => '',
1228 'description' => 'Delete a competency framework.',
1229 'type' => 'write',
1230 'capabilities' => 'moodle/competency:competencymanage',
1231 'ajax' => true,
1232 ),
1233 'core_competency_update_competency_framework' => array(
1234 'classname' => 'core_competency\external',
1235 'methodname' => 'update_competency_framework',
1236 'classpath' => '',
1237 'description' => 'Update a competency framework.',
1238 'type' => 'write',
1239 'capabilities' => 'moodle/competency:competencymanage',
1240 'ajax' => true,
1241 ),
1242 'core_competency_list_competency_frameworks' => array(
1243 'classname' => 'core_competency\external',
1244 'methodname' => 'list_competency_frameworks',
1245 'classpath' => '',
1246 'description' => 'Load a list of a competency frameworks.',
1247 'type' => 'read',
1248 'capabilities' => 'moodle/competency:competencyview',
1249 'ajax' => true,
1250 ),
1251 'core_competency_count_competency_frameworks' => array(
1252 'classname' => 'core_competency\external',
1253 'methodname' => 'count_competency_frameworks',
1254 'classpath' => '',
1255 'description' => 'Count a list of a competency frameworks.',
1256 'type' => 'read',
1257 'capabilities' => 'moodle/competency:competencyview',
1258 'ajax' => true,
1259 ),
1260 'core_competency_competency_framework_viewed' => array(
1261 'classname' => 'core_competency\external',
1262 'methodname' => 'competency_framework_viewed',
1263 'classpath' => '',
1264 'description' => 'Log event competency framework viewed',
1265 'type' => 'read',
1266 'capabilities' => 'moodle/competency:competencyview',
1267 'ajax' => true,
1268 ),
1269 'core_competency_create_competency' => array(
1270 'classname' => 'core_competency\external',
1271 'methodname' => 'create_competency',
1272 'classpath' => '',
1273 'description' => 'Creates new competencies.',
1274 'type' => 'write',
1275 'capabilities' => 'moodle/competency:competencymanage',
1276 'ajax' => true,
1277 ),
1278 'core_competency_read_competency' => array(
1279 'classname' => 'core_competency\external',
1280 'methodname' => 'read_competency',
1281 'classpath' => '',
1282 'description' => 'Load a summary of a competency.',
1283 'type' => 'read',
1284 'capabilities' => 'moodle/competency:competencyview',
1285 'ajax' => true,
1286 ),
1287 'core_competency_competency_viewed' => array(
1288 'classname' => 'core_competency\external',
1289 'methodname' => 'competency_viewed',
1290 'classpath' => '',
1291 'description' => 'Log event competency viewed',
1292 'type' => 'read',
1293 'capabilities' => 'moodle/competency:competencyview',
1294 'ajax' => true,
3123c2cf 1295 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
81de839f
FM
1296 ),
1297 'core_competency_delete_competency' => array(
1298 'classname' => 'core_competency\external',
1299 'methodname' => 'delete_competency',
1300 'classpath' => '',
1301 'description' => 'Delete a competency.',
1302 'type' => 'write',
1303 'capabilities' => 'moodle/competency:competencymanage',
1304 'ajax' => true,
1305 ),
1306 'core_competency_update_competency' => array(
1307 'classname' => 'core_competency\external',
1308 'methodname' => 'update_competency',
1309 'classpath' => '',
1310 'description' => 'Update a competency.',
1311 'type' => 'write',
1312 'capabilities' => 'moodle/competency:competencymanage',
1313 'ajax' => true,
1314 ),
1315 'core_competency_list_competencies' => array(
1316 'classname' => 'core_competency\external',
1317 'methodname' => 'list_competencies',
1318 'classpath' => '',
1319 'description' => 'Load a list of a competencies.',
1320 'type' => 'read',
1321 'capabilities' => 'moodle/competency:competencyview',
1322 'ajax' => true,
1323 ),
1324 'core_competency_list_competencies_in_template' => array(
1325 'classname' => 'core_competency\external',
1326 'methodname' => 'list_competencies_in_template',
1327 'classpath' => '',
1328 'description' => 'Load a list of a competencies for a given template.',
1329 'type' => 'read',
1330 'capabilities' => 'moodle/competency:competencyview',
1331 'ajax' => true,
1332 ),
1333 'core_competency_count_competencies' => array(
1334 'classname' => 'core_competency\external',
1335 'methodname' => 'count_competencies',
1336 'classpath' => '',
1337 'description' => 'Count a list of a competencies.',
1338 'type' => 'read',
1339 'capabilities' => 'moodle/competency:competencyview',
1340 'ajax' => true,
1341 ),
1342 'core_competency_count_competencies_in_template' => array(
1343 'classname' => 'core_competency\external',
1344 'methodname' => 'count_competencies_in_template',
1345 'classpath' => '',
1346 'description' => 'Count a list of a competencies for a given template.',
1347 'type' => 'read',
1348 'capabilities' => 'moodle/competency:competencyview',
1349 'ajax' => true,
1350 ),
1351 'core_competency_search_competencies' => array(
1352 'classname' => 'core_competency\external',
1353 'methodname' => 'search_competencies',
1354 'classpath' => '',
1355 'description' => 'Search a list of a competencies.',
1356 'type' => 'read',
1357 'capabilities' => 'moodle/competency:competencyview',
1358 'ajax' => true,
1359 ),
1360 'core_competency_set_parent_competency' => array(
1361 'classname' => 'core_competency\external',
1362 'methodname' => 'set_parent_competency',
1363 'classpath' => '',
1364 'description' => 'Set a new parent for a competency.',
1365 'type' => 'write',
1366 'capabilities' => 'moodle/competency:competencymanage',
1367 'ajax' => true,
1368 ),
1369 'core_competency_move_up_competency' => array(
1370 'classname' => 'core_competency\external',
1371 'methodname' => 'move_up_competency',
1372 'classpath' => '',
1373 'description' => 'Re-order a competency.',
1374 'type' => 'write',
1375 'capabilities' => 'moodle/competency:competencymanage',
1376 'ajax' => true,
1377 ),
1378 'core_competency_move_down_competency' => array(
1379 'classname' => 'core_competency\external',
1380 'methodname' => 'move_down_competency',
1381 'classpath' => '',
1382 'description' => 'Re-order a competency.',
1383 'type' => 'write',
1384 'capabilities' => 'moodle/competency:competencymanage',
1385 'ajax' => true,
1386 ),
1387 'core_competency_list_course_competencies' => array(
1388 'classname' => 'core_competency\external',
1389 'methodname' => 'list_course_competencies',
1390 'classpath' => '',
1391 'description' => 'List the competencies in a course',
1392 'type' => 'read',
1393 'capabilities' => 'moodle/competency:coursecompetencyview',
1394 'ajax' => true,
3123c2cf 1395 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
81de839f
FM
1396 ),
1397 'core_competency_count_competencies_in_course' => array(
1398 'classname' => 'core_competency\external',
1399 'methodname' => 'count_competencies_in_course',
1400 'classpath' => '',
1401 'description' => 'List the competencies in a course',
1402 'type' => 'read',
1403 'capabilities' => 'moodle/competency:coursecompetencyview',
1404 'ajax' => true,
1405 ),
1406 'core_competency_count_courses_using_competency' => array(
1407 'classname' => 'core_competency\external',
1408 'methodname' => 'count_courses_using_competency',
1409 'classpath' => '',
1410 'description' => 'List the courses using a competency',
1411 'type' => 'read',
1412 'capabilities' => 'moodle/competency:coursecompetencyview',
1413 'ajax' => true,
1414 ),
1415 'core_competency_add_competency_to_course' => array(
1416 'classname' => 'core_competency\external',
1417 'methodname' => 'add_competency_to_course',
1418 'classpath' => '',
1419 'description' => 'Add the competency to a course',
1420 'type' => 'write',
1421 'capabilities' => 'moodle/competency:coursecompetencymanage',
1422 'ajax' => true,
1423 ),
1424 'core_competency_add_competency_to_template' => array(
1425 'classname' => 'core_competency\external',
1426 'methodname' => 'add_competency_to_template',
1427 'classpath' => '',
1428 'description' => 'Add the competency to a template',
1429 'type' => 'write',
1430 'capabilities' => 'moodle/competency:templatemanage',
1431 'ajax' => true,
1432 ),
1433 'core_competency_remove_competency_from_course' => array(
1434 'classname' => 'core_competency\external',
1435 'methodname' => 'remove_competency_from_course',
1436 'classpath' => '',
1437 'description' => 'Remove a competency from a course',
1438 'type' => 'write',
1439 'capabilities' => 'moodle/competency:coursecompetencymanage',
1440 'ajax' => true,
1441 ),
1442 'core_competency_set_course_competency_ruleoutcome' => array(
1443 'classname' => 'core_competency\external',
1444 'methodname' => 'set_course_competency_ruleoutcome',
1445 'classpath' => '',
1446 'description' => 'Modify the ruleoutcome value for course competency',
1447 'type' => 'write',
1448 'capabilities' => 'moodle/competency:coursecompetencymanage',
1449 'ajax' => true,
1450 ),
1451 'core_competency_remove_competency_from_template' => array(
1452 'classname' => 'core_competency\external',
1453 'methodname' => 'remove_competency_from_template',
1454 'classpath' => '',
1455 'description' => 'Remove a competency from a template',
1456 'type' => 'write',
1457 'capabilities' => 'moodle/competency:templatemanage',
1458 'ajax' => true,
1459 ),
1460 'core_competency_reorder_course_competency' => array(
1461 'classname' => 'core_competency\external',
1462 'methodname' => 'reorder_course_competency',
1463 'classpath' => '',
1464 'description' => 'Move a course competency to a new relative sort order.',
1465 'type' => 'write',
1466 'capabilities' => 'moodle/competency:coursecompetencymanage',
1467 'ajax' => true,
1468 ),
1469 'core_competency_reorder_template_competency' => array(
1470 'classname' => 'core_competency\external',
1471 'methodname' => 'reorder_template_competency',
1472 'classpath' => '',
1473 'description' => 'Move a template competency to a new relative sort order.',
1474 'type' => 'write',
1475 'capabilities' => 'moodle/competency:templatemanage',
1476 'ajax' => true,
1477 ),
1478 'core_competency_create_template' => array(
1479 'classname' => 'core_competency\external',
1480 'methodname' => 'create_template',
1481 'classpath' => '',
1482 'description' => 'Creates new learning plan templates.',
1483 'type' => 'write',
1484 'capabilities' => 'moodle/competency:templatemanage',
1485 'ajax' => true,
1486 ),
1487 'core_competency_duplicate_template' => array(
1488 'classname' => 'core_competency\external',
1489 'methodname' => 'duplicate_template',
1490 'classpath' => '',
1491 'description' => 'Duplicate learning plan template.',
1492 'type' => 'write',
1493 'capabilities' => 'moodle/competency:templatemanage',
1494 'ajax' => true,
1495 ),
1496 'core_competency_read_template' => array(
1497 'classname' => 'core_competency\external',
1498 'methodname' => 'read_template',
1499 'classpath' => '',
1500 'description' => 'Load a summary of a learning plan template.',
1501 'type' => 'read',
1502 'capabilities' => 'moodle/competency:templateview',
1503 'ajax' => true,
1504 ),
1505 'core_competency_delete_template' => array(
1506 'classname' => 'core_competency\external',
1507 'methodname' => 'delete_template',
1508 'classpath' => '',
1509 'description' => 'Delete a learning plan template.',
1510 'type' => 'write',
1511 'capabilities' => 'moodle/competency:templatemanage',
1512 'ajax' => true,
1513 ),
1514 'core_competency_update_template' => array(
1515 'classname' => 'core_competency\external',
1516 'methodname' => 'update_template',
1517 'classpath' => '',
1518 'description' => 'Update a learning plan template.',
1519 'type' => 'write',
1520 'capabilities' => 'moodle/competency:templatemanage',
1521 'ajax' => true,
1522 ),
1523 'core_competency_list_templates' => array(
1524 'classname' => 'core_competency\external',
1525 'methodname' => 'list_templates',
1526 'classpath' => '',
1527 'description' => 'Load a list of a learning plan templates.',
1528 'type' => 'read',
1529 'capabilities' => 'moodle/competency:templateview',
1530 'ajax' => true,
1531 ),
1532 'core_competency_list_templates_using_competency' => array(
1533 'classname' => 'core_competency\external',
1534 'methodname' => 'list_templates_using_competency',
1535 'classpath' => '',
1536 'description' => 'Load a list of a learning plan templates for a given competency.',
1537 'type' => 'read',
1538 'capabilities' => 'moodle/competency:templateview',
1539 'ajax' => true,
1540 ),
1541 'core_competency_count_templates' => array(
1542 'classname' => 'core_competency\external',
1543 'methodname' => 'count_templates',
1544 'classpath' => '',
1545 'description' => 'Count a list of a learning plan templates.',
1546 'type' => 'read',
1547 'capabilities' => 'moodle/competency:templateview',
1548 'ajax' => true,
1549 ),
1550 'core_competency_count_templates_using_competency' => array(
1551 'classname' => 'core_competency\external',
1552 'methodname' => 'count_templates_using_competency',
1553 'classpath' => '',
1554 'description' => 'Count a list of a learning plan templates for a given competency.',
1555 'type' => 'read',
1556 'capabilities' => 'moodle/competency:templateview',
1557 'ajax' => true,
1558 ),
1559 'core_competency_create_plan' => array(
1560 'classname' => 'core_competency\external',
1561 'methodname' => 'create_plan',
1562 'classpath' => '',
1563 'description' => 'Creates a learning plan.',
1564 'type' => 'write',
1565 'capabilities' => 'moodle/competency:planmanage',
1566 'ajax' => true,
1567 ),
1568 'core_competency_update_plan' => array(
1569 'classname' => 'core_competency\external',
1570 'methodname' => 'update_plan',
1571 'classpath' => '',
1572 'description' => 'Updates a learning plan.',
1573 'type' => 'write',
1574 'capabilities' => 'moodle/competency:planmanage',
1575 'ajax' => true,
1576 ),
1577 'core_competency_complete_plan' => array(
1578 'classname' => 'core_competency\external',
1579 'methodname' => 'complete_plan',
1580 'classpath' => '',
1581 'description' => 'Complete learning plan.',
1582 'type' => 'write',
1583 'capabilities' => 'moodle/competency:planmanage',
1584 'ajax' => true,
1585 ),
1586 'core_competency_reopen_plan' => array(
1587 'classname' => 'core_competency\external',
1588 'methodname' => 'reopen_plan',
1589 'classpath' => '',
1590 'description' => 'Reopen learning plan.',
1591 'type' => 'write',
1592 'capabilities' => 'moodle/competency:planmanage',
1593 'ajax' => true,
1594 ),
1595 'core_competency_read_plan' => array(
1596 'classname' => 'core_competency\external',
1597 'methodname' => 'read_plan',
1598 'classpath' => '',
1599 'description' => 'Load a learning plan.',
1600 'type' => 'read',
1601 'capabilities' => 'moodle/competency:planviewown',
1602 'ajax' => true,
1603 ),
1604 'core_competency_delete_plan' => array(
1605 'classname' => 'core_competency\external',
1606 'methodname' => 'delete_plan',
1607 'classpath' => '',
1608 'description' => 'Delete a learning plan.',
1609 'type' => 'write',
1610 'capabilities' => 'moodle/competency:planmanage',
1611 'ajax' => true,
1612 ),
1613 'core_competency_list_user_plans' => array(
1614 'classname' => 'core_competency\external',
1615 'methodname' => 'list_user_plans',
1616 'classpath' => '',
1617 'description' => 'List a user\'s learning plans.',
1618 'type' => 'read',
1619 'capabilities' => 'moodle/competency:planviewown',
1620 'ajax' => true,
1621 ),
1622 'core_competency_list_plan_competencies' => array(
1623 'classname' => 'core_competency\external',
1624 'methodname' => 'list_plan_competencies',
1625 'classpath' => '',
1626 'description' => 'List the competencies in a plan',
1627 'type' => 'read',
1628 'capabilities' => 'moodle/competency:planviewown',
1629 'ajax' => true,
1630 ),
1631 'core_competency_add_competency_to_plan' => array(
1632 'classname' => 'core_competency\external',
1633 'methodname' => 'add_competency_to_plan',
1634 'classpath' => '',
1635 'description' => 'Add the competency to a learning plan',
1636 'type' => 'write',
1637 'capabilities' => 'moodle/competency:planmanage',
1638 'ajax' => true,
1639 ),
1640 'core_competency_remove_competency_from_plan' => array(
1641 'classname' => 'core_competency\external',
1642 'methodname' => 'remove_competency_from_plan',
1643 'classpath' => '',
1644 'description' => 'Remove the competency from a learning plan',
1645 'type' => 'write',
1646 'capabilities' => 'moodle/competency:planmanage',
1647 'ajax' => true,
1648 ),
1649 'core_competency_reorder_plan_competency' => array(
1650 'classname' => 'core_competency\external',
1651 'methodname' => 'reorder_plan_competency',
1652 'classpath' => '',
1653 'description' => 'Move a plan competency to a new relative sort order.',
1654 'type' => 'write',
1655 'capabilities' => 'moodle/competency:planmanage',
1656 'ajax' => true,
1657 ),
1658 'core_competency_plan_request_review' => array(
1659 'classname' => 'core_competency\external',
1660 'methodname' => 'plan_request_review',
1661 'classpath' => '',
1662 'description' => 'Request for a plan to be reviewed.',
1663 'type' => 'write',
1664 'capabilities' => 'moodle/competency:planmanagedraft',
1665 'ajax' => true,
1666 ),
1667 'core_competency_plan_start_review' => array(
1668 'classname' => 'core_competency\external',
1669 'methodname' => 'plan_start_review',
1670 'classpath' => '',
1671 'description' => 'Start the review of a plan.',
1672 'type' => 'write',
1673 'capabilities' => 'moodle/competency:planmanage',
1674 'ajax' => true,
1675 ),
1676 'core_competency_plan_stop_review' => array(
1677 'classname' => 'core_competency\external',
1678 'methodname' => 'plan_stop_review',
1679 'classpath' => '',
1680 'description' => 'Stop the review of a plan.',
1681 'type' => 'write',
1682 'capabilities' => 'moodle/competency:planmanage',
1683 'ajax' => true,
1684 ),
1685 'core_competency_plan_cancel_review_request' => array(
1686 'classname' => 'core_competency\external',
1687 'methodname' => 'plan_cancel_review_request',
1688 'classpath' => '',
1689 'description' => 'Cancel the review of a plan.',
1690 'type' => 'write',
1691 'capabilities' => 'moodle/competency:planmanagedraft',
1692 'ajax' => true,
1693 ),
1694 'core_competency_approve_plan' => array(
1695 'classname' => 'core_competency\external',
1696 'methodname' => 'approve_plan',
1697 'classpath' => '',
1698 'description' => 'Approve a plan.',
1699 'type' => 'write',
1700 'capabilities' => 'moodle/competency:planmanage',
1701 'ajax' => true,
1702 ),
1703 'core_competency_unapprove_plan' => array(
1704 'classname' => 'core_competency\external',
1705 'methodname' => 'unapprove_plan',
1706 'classpath' => '',
1707 'description' => 'Unapprove a plan.',
1708 'type' => 'write',
1709 'capabilities' => 'moodle/competency:planmanage',
1710 'ajax' => true,
1711 ),
1712 'core_competency_template_has_related_data' => array(
1713 'classname' => 'core_competency\external',
1714 'methodname' => 'template_has_related_data',
1715 'classpath' => '',
1716 'description' => 'Check if a template has related data',
1717 'type' => 'read',
1718 'capabilities' => 'moodle/competency:templateview',
1719 'ajax' => true,
1720 ),
1721 'core_competency_get_scale_values' => array(
1722 'classname' => 'core_competency\external',
1723 'methodname' => 'get_scale_values',
1724 'classpath' => '',
1725 'description' => 'Fetch the values for a specific scale',
1726 'type' => 'read',
1727 'capabilities' => 'moodle/competency:competencymanage',
1728 'ajax' => true,
3123c2cf 1729 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
81de839f
FM
1730 ),
1731 'core_competency_add_related_competency' => array(
1732 'classname' => 'core_competency\external',
1733 'methodname' => 'add_related_competency',
1734 'classpath' => '',
1735 'description' => 'Adds a related competency',
1736 'type' => 'write',
1737 'capabilities' => 'moodle/competency:competencymanage',
1738 'ajax' => true,
1739 ),
1740 'core_competency_remove_related_competency' => array(
1741 'classname' => 'core_competency\external',
1742 'methodname' => 'remove_related_competency',
1743 'classpath' => '',
1744 'description' => 'Remove a related competency',
1745 'type' => 'write',
1746 'capabilities' => 'moodle/competency:competencymanage',
1747 'ajax' => true,
1748 ),
1749 'core_competency_read_user_evidence' => array(
1750 'classname' => 'core_competency\external',
1751 'methodname' => 'read_user_evidence',
1752 'classpath' => '',
1753 'description' => 'Read an evidence of prior learning.',
1754 'type' => 'read',
1755 'capabilities' => 'moodle/competency:userevidenceview',
1756 'ajax' => true,
1757 ),
1758 'core_competency_delete_user_evidence' => array(
1759 'classname' => 'core_competency\external',
1760 'methodname' => 'delete_user_evidence',
1761 'classpath' => '',
1762 'description' => 'Delete an evidence of prior learning.',
1763 'type' => 'write',
1764 'capabilities' => 'moodle/competency:userevidencemanageown',
1765 'ajax' => true,
1766 ),
1767 'core_competency_create_user_evidence_competency' => array(
1768 'classname' => 'core_competency\external',
1769 'methodname' => 'create_user_evidence_competency',
1770 'classpath' => '',
1771 'description' => 'Create an evidence of prior learning relationship with a competency.',
1772 'type' => 'read',
1773 'capabilities' => 'moodle/competency:userevidencemanageown, moodle/competency:competencyview',
1774 'ajax' => true,
1775 ),
1776 'core_competency_delete_user_evidence_competency' => array(
1777 'classname' => 'core_competency\external',
1778 'methodname' => 'delete_user_evidence_competency',
1779 'classpath' => '',
1780 'description' => 'Delete an evidence of prior learning relationship with a competency.',
1781 'type' => 'write',
1782 'capabilities' => 'moodle/competency:userevidencemanageown',
1783 'ajax' => true,
1784 ),
1785 'core_competency_user_competency_cancel_review_request' => array(
1786 'classname' => 'core_competency\external',
1787 'methodname' => 'user_competency_cancel_review_request',
1788 'classpath' => '',
1789 'description' => 'Cancel a review request.',
1790 'type' => 'write',
1791 'capabilities' => 'moodle/competency:userevidencemanageown',
1792 'ajax' => true,
1793 ),
1794 'core_competency_user_competency_request_review' => array(
1795 'classname' => 'core_competency\external',
1796 'methodname' => 'user_competency_request_review',
1797 'classpath' => '',
1798 'description' => 'Request a review.',
1799 'type' => 'write',
1800 'capabilities' => 'moodle/competency:userevidencemanageown',
1801 'ajax' => true,
1802 ),
1803 'core_competency_user_competency_start_review' => array(
1804 'classname' => 'core_competency\external',
1805 'methodname' => 'user_competency_start_review',
1806 'classpath' => '',
1807 'description' => 'Start a review.',
1808 'type' => 'write',
1809 'capabilities' => 'moodle/competency:competencygrade',
1810 'ajax' => true,
1811 ),
1812 'core_competency_user_competency_stop_review' => array(
1813 'classname' => 'core_competency\external',
1814 'methodname' => 'user_competency_stop_review',
1815 'classpath' => '',
1816 'description' => 'Stop a review.',
1817 'type' => 'write',
1818 'capabilities' => 'moodle/competency:competencygrade',
1819 'ajax' => true,
1820 ),
1821 'core_competency_user_competency_viewed' => array(
1822 'classname' => 'core_competency\external',
1823 'methodname' => 'user_competency_viewed',
1824 'classpath' => '',
1825 'description' => 'Log the user competency viewed event.',
1826 'type' => 'read',
1827 'capabilities' => 'moodle/competency:usercompetencyview',
1828 'ajax' => true,
3123c2cf 1829 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
81de839f
FM
1830 ),
1831 'core_competency_user_competency_viewed_in_plan' => array(
1832 'classname' => 'core_competency\external',
1833 'methodname' => 'user_competency_viewed_in_plan',
1834 'classpath' => '',
1835 'description' => 'Log the user competency viewed in plan event.',
1836 'type' => 'read',
1837 'capabilities' => 'moodle/competency:usercompetencyview',
1838 'ajax' => true,
3123c2cf 1839 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
81de839f
FM
1840 ),
1841 'core_competency_user_competency_viewed_in_course' => array(
1842 'classname' => 'core_competency\external',
1843 'methodname' => 'user_competency_viewed_in_course',
1844 'classpath' => '',
1845 'description' => 'Log the user competency viewed in course event',
1846 'type' => 'read',
1847 'capabilities' => 'moodle/competency:usercompetencyview',
1848 'ajax' => true,
3123c2cf 1849 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
81de839f
FM
1850 ),
1851 'core_competency_user_competency_plan_viewed' => array(
1852 'classname' => 'core_competency\external',
1853 'methodname' => 'user_competency_plan_viewed',
1854 'classpath' => '',
1855 'description' => 'Log the user competency plan viewed event.',
1856 'type' => 'read',
1857 'capabilities' => 'moodle/competency:usercompetencyview',
1858 'ajax' => true,
3123c2cf 1859 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
81de839f
FM
1860 ),
1861 'core_competency_grade_competency' => array(
1862 'classname' => 'core_competency\external',
1863 'methodname' => 'grade_competency',
1864 'classpath' => '',
1865 'description' => 'Grade a competency.',
1866 'type' => 'write',
1867 'capabilities' => 'moodle/competency:competencygrade',
1868 'ajax' => true,
1869 ),
1870 'core_competency_grade_competency_in_plan' => array(
1871 'classname' => 'core_competency\external',
1872 'methodname' => 'grade_competency_in_plan',
1873 'classpath' => '',
1874 'description' => 'Grade a competency from the user plan page.',
1875 'type' => 'write',
1876 'capabilities' => 'moodle/competency:competencygrade',
1877 'ajax' => true,
1878 ),
1879 'core_competency_grade_competency_in_course' => array(
1880 'classname' => 'core_competency\external',
1881 'methodname' => 'grade_competency_in_course',
1882 'classpath' => '',
1883 'description' => 'Grade a competency from the course page.',
1884 'type' => 'write',
1885 'capabilities' => 'moodle/competency:competencygrade',
1886 'ajax' => true,
3123c2cf 1887 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
81de839f
FM
1888 ),
1889 'core_competency_unlink_plan_from_template' => array(
1890 'classname' => 'core_competency\external',
1891 'methodname' => 'unlink_plan_from_template',
1892 'classpath' => '',
1893 'description' => 'Unlink a plan form it template.',
1894 'type' => 'write',
1895 'capabilities' => 'moodle/competency:planmanage',
1896 'ajax' => true,
1897 ),
1898 'core_competency_template_viewed' => array(
1899 'classname' => 'core_competency\external',
1900 'methodname' => 'template_viewed',
1901 'classpath' => '',
1902 'description' => 'Log event template viewed',
1903 'type' => 'read',
1904 'capabilities' => 'moodle/competency:templateview',
1905 'ajax' => true,
1906 ),
1907 'core_competency_request_review_of_user_evidence_linked_competencies' => array(
1908 'classname' => 'core_competency\external',
1909 'methodname' => 'request_review_of_user_evidence_linked_competencies',
1910 'classpath' => '',
1911 'description' => 'Send user evidence competencies in review',
1912 'type' => 'write',
1913 'capabilities' => 'moodle/competency:userevidencemanageown',
1914 'ajax' => true,
1915 ),
1916 'core_competency_update_course_competency_settings' => array(
1917 'classname' => 'core_competency\external',
1918 'methodname' => 'update_course_competency_settings',
1919 'classpath' => '',
1920 'description' => 'Update the course competency settings',
1921 'type' => 'write',
1922 'capabilities' => 'moodle/competency:coursecompetencyconfigure',
1923 'ajax' => true,
1924 ),
1e99f31e
FM
1925 'core_competency_delete_evidence' => array(
1926 'classname' => 'core_competency\external',
1927 'methodname' => 'delete_evidence',
1928 'classpath' => '',
1929 'description' => 'Delete an evidence',
1930 'type' => 'write',
1931 'capabilities' => 'moodle/competency:evidencedelete',
1932 'ajax' => true,
3123c2cf 1933 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1e99f31e 1934 ),
f23e9b6b
CB
1935
1936 'core_webservice_get_site_info' => array(
1937 'classname' => 'core_webservice_external',
1938 'methodname' => 'get_site_info',
1939 'classpath' => 'webservice/externallib.php',
1940 'description' => 'Return some site info / user info / list web service functions',
1941 'type' => 'read',
ee7295ee 1942 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
f23e9b6b 1943 )
9a0df45a 1944);
c1b65883
JM
1945
1946$services = array(
96e0194c 1947 'Moodle mobile web service' => array(
12c52b91 1948 'functions' => array(), // Unused as we add the service in each function definition, third party services would use this.
96e0194c
SH
1949 'enabled' => 0,
1950 'restrictedusers' => 0,
af03513f 1951 'shortname' => MOODLE_OFFICIAL_MOBILE_SERVICE,
106c55fb
DW
1952 'downloadfiles' => 1,
1953 'uploadfiles' => 1
96e0194c
SH
1954 ),
1955);