Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
<?php
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
 
17
 
18
/**
19
 * Core external functions and service definitions.
20
 *
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 https://moodledev.io/docs/apis/subsystems/external/writing-a-service}
27
 *     - External API: {@link https://moodledev.io/docs/apis/subsystems/external/functions}
28
 *     - Upgrade API: {@link https://moodledev.io/docs/guides/upgrade}
29
 *
30
 * @package    core_webservice
31
 * @category   webservice
32
 * @copyright  2009 Petr Skodak
33
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
34
 */
35
 
36
$functions = array(
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
    ),
45
    'core_auth_request_password_reset' => array(
46
        'classname'   => 'core_auth_external',
47
        'methodname'  => 'request_password_reset',
48
        'description' => 'Requests a password reset.',
49
        'type'        => 'write',
50
        'ajax'          => true,
51
        'loginrequired' => false,
52
    ),
53
    'core_auth_is_minor' => array(
54
        'classname'   => 'core_auth_external',
55
        'methodname'  => 'is_minor',
56
        'description' => 'Requests a check if a user is a digital minor.',
57
        'type'        => 'read',
58
        'ajax'          => true,
59
        'loginrequired' => false,
60
    ),
61
    'core_auth_is_age_digital_consent_verification_enabled' => array(
62
        'classname'   => 'core_auth_external',
63
        'methodname'  => 'is_age_digital_consent_verification_enabled',
64
        'description' => 'Checks if age digital consent verification is enabled.',
65
        'type'        => 'read',
66
        'ajax'          => true,
67
        'loginrequired' => false,
68
    ),
69
    'core_auth_resend_confirmation_email' => array(
70
        'classname'   => 'core_auth_external',
71
        'methodname'  => 'resend_confirmation_email',
72
        'description' => 'Resend confirmation email.',
73
        'type'        => 'write',
74
        'ajax'          => true,
75
        'loginrequired' => false,
76
    ),
77
    'core_backup_get_async_backup_progress' => array(
78
        'classname'   => 'core_backup_external',
79
        'classpath' => 'backup/externallib.php',
80
        'methodname'  => 'get_async_backup_progress',
81
        'description' => 'Get the progress of an Asyncronhous backup.',
82
        'type'        => 'read',
83
        'ajax'          => true,
84
        'loginrequired' => true,
85
    ),
86
    'core_backup_get_async_backup_links_backup' => array(
87
        'classname'   => 'core_backup_external',
88
        'classpath' => 'backup/externallib.php',
89
        'methodname'  => 'get_async_backup_links_backup',
90
        'description' => 'Gets the data to use when updating the status table row in the UI for when an async backup completes.',
91
        'type'        => 'read',
92
        'ajax'          => true,
93
        'loginrequired' => true,
94
    ),
95
    'core_backup_get_async_backup_links_restore' => array(
96
        'classname'   => 'core_backup_external',
97
        'classpath' => 'backup/externallib.php',
98
        'methodname'  => 'get_async_backup_links_restore',
99
        'description' => 'Gets the data to use when updating the status table row in the UI for when an async restore completes.',
100
        'type'        => 'read',
101
        'ajax'          => true,
102
        'loginrequired' => true,
103
    ),
104
    'core_backup_get_copy_progress' => array(
105
        'classname'   => 'core_backup_external',
106
        'classpath' => 'backup/externallib.php',
107
        'methodname'  => 'get_copy_progress',
108
        'description' => 'Gets the progress of course copy operations.',
109
        'type'        => 'read',
110
        'ajax'          => true,
111
        'loginrequired' => true,
112
    ),
113
    'core_backup_submit_copy_form' => array(
114
        'classname'   => 'core_backup_external',
115
        'classpath' => 'backup/externallib.php',
116
        'methodname'  => 'submit_copy_form',
117
        'description' => 'Handles ajax submission of course copy form.',
118
        'type'        => 'read',
119
        'ajax'          => true,
120
        'loginrequired' => true,
121
    ),
122
    'core_badges_get_user_badges' => array(
123
        'classname'     => 'core_badges_external',
124
        'methodname'    => 'get_user_badges',
125
        'description'   => 'Returns the list of badges awarded to a user.',
126
        'type'          => 'read',
127
        'capabilities'  => 'moodle/badges:viewotherbadges',
128
        'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
129
    ),
130
    'core_badges_get_user_badge_by_hash' => [
131
        'classname'     => 'core_badges\external\get_user_badge_by_hash',
132
        'description'   => 'Returns the badge awarded to a user by hash.',
133
        'type'          => 'read',
134
        'services'      => [MOODLE_OFFICIAL_MOBILE_SERVICE],
135
    ],
136
    'core_blog_get_entries' => array(
137
        'classname'   => 'core_blog\external',
138
        'methodname'  => 'get_entries',
139
        'description' => 'Returns blog entries.',
140
        'type'        => 'read',
141
        'services'    => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
142
        'ajax'          => true,
143
        'loginrequired' => false,
144
    ),
145
    'core_blog_view_entries' => array(
146
        'classname'   => 'core_blog\external',
147
        'methodname'  => 'view_entries',
148
        'description' => 'Trigger the blog_entries_viewed event.',
149
        'type'        => 'read',
150
        'services'    => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
151
        'ajax'          => true,
152
        'loginrequired' => false,
153
    ),
154
    'core_blog_get_access_information' => [
155
        'classname' => '\core_blog\external\get_access_information',
156
        'description' => 'Retrieves permission information for the current user.',
157
        'type' => 'read',
158
        'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
159
    ],
160
    'core_blog_add_entry' => [
161
        'classname' => '\core_blog\external\add_entry',
162
        'description' => 'Creates a new blog post entry.',
163
        'type' => 'write',
164
        'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
165
    ],
166
    'core_blog_delete_entry' => [
167
        'classname' => '\core_blog\external\delete_entry',
168
        'description' => 'Deletes a blog post entry.',
169
        'type' => 'write',
170
        'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
171
    ],
172
    'core_blog_prepare_entry_for_edition' => [
173
        'classname' => '\core_blog\external\prepare_entry_for_edition',
174
        'description' => 'Prepare a draft area for editing a blog entry..',
175
        'type' => 'write',
176
        'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
177
    ],
178
    'core_blog_update_entry' => [
179
        'classname' => '\core_blog\external\update_entry',
180
        'description' => 'Updates a blog entry.',
181
        'type' => 'write',
182
        'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
183
    ],
184
    'core_calendar_get_calendar_monthly_view' => array(
185
        'classname' => 'core_calendar_external',
186
        'methodname' => 'get_calendar_monthly_view',
187
        'description' => 'Fetch the monthly view data for a calendar',
188
        'classpath' => 'calendar/externallib.php',
189
        'type' => 'read',
190
        'capabilities' => '',
191
        'ajax' => true,
192
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
193
    ),
194
    'core_calendar_get_calendar_day_view' => array(
195
        'classname' => 'core_calendar_external',
196
        'methodname' => 'get_calendar_day_view',
197
        'description' => 'Fetch the day view data for a calendar',
198
        'classpath' => 'calendar/externallib.php',
199
        'type' => 'read',
200
        'capabilities' => '',
201
        'ajax' => true,
202
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
203
    ),
204
    'core_calendar_get_calendar_upcoming_view' => array(
205
        'classname' => 'core_calendar_external',
206
        'methodname' => 'get_calendar_upcoming_view',
207
        'description' => 'Fetch the upcoming view data for a calendar',
208
        'classpath' => 'calendar/externallib.php',
209
        'type' => 'read',
210
        'capabilities' => '',
211
        'ajax' => true,
212
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
213
    ),
214
    'core_calendar_update_event_start_day' => array(
215
        'classname' => 'core_calendar_external',
216
        'methodname' => 'update_event_start_day',
217
        'description' => 'Update the start day (but not time) for an event.',
218
        'classpath' => 'calendar/externallib.php',
219
        'type' => 'write',
220
        'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
221
        'ajax' => true,
222
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
223
    ),
224
    'core_calendar_create_calendar_events' => array(
225
        'classname' => 'core_calendar_external',
226
        'methodname' => 'create_calendar_events',
227
        'description' => 'Create calendar events',
228
        'classpath' => 'calendar/externallib.php',
229
        'type' => 'write',
230
        'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
231
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
232
    ),
233
    'core_calendar_delete_calendar_events' => array(
234
        'classname' => 'core_calendar_external',
235
        'methodname' => 'delete_calendar_events',
236
        'description' => 'Delete calendar events',
237
        'classpath' => 'calendar/externallib.php',
238
        'type' => 'write',
239
        'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
240
        'ajax' => true,
241
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
242
    ),
243
    'core_calendar_get_calendar_events' => array(
244
        'classname' => 'core_calendar_external',
245
        'methodname' => 'get_calendar_events',
246
        'description' => 'Get calendar events',
247
        'classpath' => 'calendar/externallib.php',
248
        'type' => 'read',
249
        'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
250
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
251
    ),
252
    'core_calendar_get_action_events_by_timesort' => array(
253
        'classname' => 'core_calendar_external',
254
        'methodname' => 'get_calendar_action_events_by_timesort',
255
        'description' => 'Get calendar action events by tiemsort',
256
        'classpath' => 'calendar/externallib.php',
257
        'type' => 'read',
258
        'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
259
        'ajax' => true,
260
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
261
        'readonlysession' => true,
262
    ),
263
    'core_calendar_get_action_events_by_course' => array(
264
        'classname' => 'core_calendar_external',
265
        'methodname' => 'get_calendar_action_events_by_course',
266
        'description' => 'Get calendar action events by course',
267
        'classpath' => 'calendar/externallib.php',
268
        'type' => 'read',
269
        'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
270
        'ajax' => true,
271
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
272
    ),
273
    'core_calendar_get_action_events_by_courses' => array(
274
        'classname' => 'core_calendar_external',
275
        'methodname' => 'get_calendar_action_events_by_courses',
276
        'description' => 'Get calendar action events by courses',
277
        'classpath' => 'calendar/externallib.php',
278
        'type' => 'read',
279
        'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
280
        'ajax' => true,
281
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
282
    ),
283
    'core_calendar_get_calendar_event_by_id' => array(
284
        'classname' => 'core_calendar_external',
285
        'methodname' => 'get_calendar_event_by_id',
286
        'description' => 'Get calendar event by id',
287
        'classpath' => 'calendar/externallib.php',
288
        'type' => 'read',
289
        'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
290
        'ajax' => true,
291
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
292
    ),
293
    'core_calendar_submit_create_update_form' => array(
294
        'classname' => 'core_calendar_external',
295
        'methodname' => 'submit_create_update_form',
296
        'description' => 'Submit form data for event form',
297
        'classpath' => 'calendar/externallib.php',
298
        'type' => 'write',
299
        'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
300
        'ajax' => true,
301
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
302
    ),
303
    'core_calendar_get_calendar_access_information' => array(
304
        'classname' => 'core_calendar_external',
305
        'methodname' => 'get_calendar_access_information',
306
        'description' => 'Convenience function to retrieve some permissions/access information for the given course calendar.',
307
        'classpath' => 'calendar/externallib.php',
308
        'type' => 'read',
309
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
310
    ),
311
    'core_calendar_get_allowed_event_types' => array(
312
        'classname' => 'core_calendar_external',
313
        'methodname' => 'get_allowed_event_types',
314
        'description' => 'Get the type of events a user can create in the given course.',
315
        'classpath' => 'calendar/externallib.php',
316
        'type' => 'read',
317
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
318
    ),
319
    'core_calendar_get_timestamps' => [
320
        'classname'     => 'core_calendar_external',
321
        'methodname'    => 'get_timestamps',
322
        'description'   => 'Fetch unix timestamps for given date times.',
323
        'classpath' => 'calendar/externallib.php',
324
        'type'          => 'read',
325
        'ajax'          => true,
326
    ],
327
    'core_calendar_get_calendar_export_token' => [
328
        'classname'     => 'core_calendar\external\export\token',
329
        'description'   => 'Return the auth token required for exporting a calendar.',
330
        'type'          => 'read',
331
        'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
332
    ],
333
    'core_calendar_delete_subscription' => [
334
        'classname' => 'core_calendar\external\subscription\delete',
335
        'description' => 'Delete the calendar subscription',
336
        'type' => 'write',
337
        'ajax' => true
338
    ],
339
    'core_check_get_result_admintree' => [
340
        'classname' => 'core\check\external\get_result_admintree',
341
        'description' => 'Executes a check stored in the admin tree and returns the result',
342
        'type' => 'read',
343
        'ajax' => true,
344
        'readonlysession' => true,
345
    ],
346
    'core_cohort_add_cohort_members' => array(
347
        'classname' => 'core_cohort_external',
348
        'methodname' => 'add_cohort_members',
349
        'classpath' => 'cohort/externallib.php',
350
        'description' => 'Adds cohort members.',
351
        'type' => 'write',
352
        'capabilities' => 'moodle/cohort:assign'
353
    ),
354
    'core_cohort_create_cohorts' => array(
355
        'classname' => 'core_cohort_external',
356
        'methodname' => 'create_cohorts',
357
        'classpath' => 'cohort/externallib.php',
358
        'description' => 'Creates new cohorts.',
359
        'type' => 'write',
360
        'capabilities' => 'moodle/cohort:manage'
361
    ),
362
    'core_cohort_delete_cohort_members' => array(
363
        'classname' => 'core_cohort_external',
364
        'methodname' => 'delete_cohort_members',
365
        'classpath' => 'cohort/externallib.php',
366
        'description' => 'Deletes cohort members.',
367
        'type' => 'write',
368
        'capabilities' => 'moodle/cohort:assign'
369
    ),
370
    'core_cohort_delete_cohorts' => array(
371
        'classname' => 'core_cohort_external',
372
        'methodname' => 'delete_cohorts',
373
        'classpath' => 'cohort/externallib.php',
374
        'description' => 'Deletes all specified cohorts.',
375
        'type' => 'write',
376
        'capabilities' => 'moodle/cohort:manage'
377
    ),
378
    'core_cohort_get_cohort_members' => array(
379
        'classname' => 'core_cohort_external',
380
        'methodname' => 'get_cohort_members',
381
        'classpath' => 'cohort/externallib.php',
382
        'description' => 'Returns cohort members.',
383
        'type' => 'read',
384
        'capabilities' => 'moodle/cohort:view'
385
    ),
386
    'core_cohort_search_cohorts' => array(
387
        'classname' => 'core_cohort_external',
388
        'methodname' => 'search_cohorts',
389
        'classpath' => 'cohort/externallib.php',
390
        'description' => 'Search for cohorts.',
391
        'type' => 'read',
392
        'ajax' => true,
393
        'capabilities' => 'moodle/cohort:view'
394
    ),
395
    'core_cohort_get_cohorts' => array(
396
        'classname' => 'core_cohort_external',
397
        'methodname' => 'get_cohorts',
398
        'classpath' => 'cohort/externallib.php',
399
        'description' => 'Returns cohort details.',
400
        'type' => 'read',
401
        'capabilities' => 'moodle/cohort:view'
402
    ),
403
    'core_cohort_update_cohorts' => array(
404
        'classname' => 'core_cohort_external',
405
        'methodname' => 'update_cohorts',
406
        'classpath' => 'cohort/externallib.php',
407
        'description' => 'Updates existing cohorts.',
408
        'type' => 'write',
409
        'capabilities' => 'moodle/cohort:manage'
410
    ),
411
    'core_comment_get_comments' => array(
412
        'classname' => 'core_comment_external',
413
        'methodname' => 'get_comments',
414
        'description' => 'Returns comments.',
415
        'type' => 'read',
416
        'capabilities' => 'moodle/comment:view',
417
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
418
    ),
419
    'core_comment_add_comments' => array(
420
        'classname' => 'core_comment_external',
421
        'methodname' => 'add_comments',
422
        'description' => 'Adds a comment or comments.',
423
        'type' => 'write',
424
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
425
    ),
426
    'core_comment_delete_comments' => array(
427
        'classname' => 'core_comment_external',
428
        'methodname' => 'delete_comments',
429
        'description' => 'Deletes a comment or comments.',
430
        'type' => 'write',
431
        'ajax' => true,
432
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
433
    ),
434
    'core_completion_get_activities_completion_status' => array(
435
        'classname' => 'core_completion_external',
436
        'methodname' => 'get_activities_completion_status',
437
        'description' => 'Return the activities completion status for a user in a course.',
438
        'type' => 'read',
439
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
440
    ),
441
    'core_completion_get_course_completion_status' => array(
442
        'classname' => 'core_completion_external',
443
        'methodname' => 'get_course_completion_status',
444
        'description' => 'Returns course completion status.',
445
        'type' => 'read',
446
        'capabilities' => 'report/completion:view',
447
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
448
    ),
449
    'core_completion_mark_course_self_completed' => array(
450
        'classname' => 'core_completion_external',
451
        'methodname' => 'mark_course_self_completed',
452
        'description' => 'Update the course completion status for the current user (if course self-completion is enabled).',
453
        'type' => 'write',
454
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
455
    ),
456
    'core_completion_update_activity_completion_status_manually' => array(
457
        'classname' => 'core_completion_external',
458
        'methodname' => 'update_activity_completion_status_manually',
459
        'description' => 'Update completion status for the current user in an activity, only for activities with manual tracking.',
460
        'type' => 'write',
461
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
462
        'ajax' => true,
463
    ),
464
    'core_completion_override_activity_completion_status' => array(
465
        'classname'     => 'core_completion_external',
466
        'methodname'    => 'override_activity_completion_status',
467
        'description'   => 'Update completion status for a user in an activity by overriding it.',
468
        'type'          => 'write',
469
        'capabilities'  => 'moodle/course:overridecompletion',
470
        'ajax'          => true,
471
    ),
472
    'core_course_create_categories' => array(
473
        'classname' => 'core_course_external',
474
        'methodname' => 'create_categories',
475
        'classpath' => 'course/externallib.php',
476
        'description' => 'Create course categories',
477
        'type' => 'write',
478
        'capabilities' => 'moodle/category:manage'
479
    ),
480
    'core_course_create_courses' => array(
481
        'classname' => 'core_course_external',
482
        'methodname' => 'create_courses',
483
        'classpath' => 'course/externallib.php',
484
        'description' => 'Create new courses',
485
        'type' => 'write',
486
        'capabilities' => 'moodle/course:create, moodle/course:visibility'
487
    ),
488
    'core_course_delete_categories' => array(
489
        'classname' => 'core_course_external',
490
        'methodname' => 'delete_categories',
491
        'classpath' => 'course/externallib.php',
492
        'description' => 'Delete course categories',
493
        'type' => 'write',
494
        'capabilities' => 'moodle/category:manage'
495
    ),
496
    'core_course_delete_courses' => array(
497
        'classname' => 'core_course_external',
498
        'methodname' => 'delete_courses',
499
        'classpath' => 'course/externallib.php',
500
        'description' => 'Deletes all specified courses',
501
        'type' => 'write',
502
        'capabilities' => 'moodle/course:delete'
503
    ),
504
    'core_course_delete_modules' => array(
505
        'classname' => 'core_course_external',
506
        'methodname' => 'delete_modules',
507
        'classpath' => 'course/externallib.php',
508
        'description' => 'Deletes all specified module instances',
509
        'type' => 'write',
510
        'capabilities' => 'moodle/course:manageactivities'
511
    ),
512
    'core_course_duplicate_course' => array(
513
        'classname' => 'core_course_external',
514
        'methodname' => 'duplicate_course',
515
        'classpath' => 'course/externallib.php',
516
        'description' => 'Duplicate an existing course (creating a new one).',
517
        'type' => 'write',
518
        'capabilities' => 'moodle/backup:backupcourse, moodle/restore:restorecourse, moodle/course:create'
519
    ),
520
    'core_course_get_categories' => array(
521
        'classname' => 'core_course_external',
522
        'methodname' => 'get_categories',
523
        'classpath' => 'course/externallib.php',
524
        'description' => 'Return category details',
525
        'type' => 'read',
526
        'capabilities' => 'moodle/category:viewhiddencategories',
527
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
528
    ),
529
    'core_course_get_contents' => array(
530
        'classname' => 'core_course_external',
531
        'methodname' => 'get_course_contents',
532
        'classpath' => 'course/externallib.php',
533
        'description' => 'Get course contents',
534
        'type' => 'read',
535
        'capabilities' => 'moodle/course:update, moodle/course:viewhiddencourses',
536
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
537
    ),
538
    'core_course_get_course_module' => array(
539
        'classname' => 'core_course_external',
540
        'methodname' => 'get_course_module',
541
        'classpath' => 'course/externallib.php',
542
        'description' => 'Return information about a course module',
543
        'type' => 'read',
544
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
545
    ),
546
    'core_course_get_course_module_by_instance' => array(
547
        'classname' => 'core_course_external',
548
        'methodname' => 'get_course_module_by_instance',
549
        'classpath' => 'course/externallib.php',
550
        'description' => 'Return information about a given module name and instance id',
551
        'type' => 'read',
552
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
553
    ),
554
    'core_course_get_module' => array(
555
        'classname'   => 'core_course_external',
556
        'methodname'  => 'get_module',
557
        'classpath'   => 'course/externallib.php',
558
        'description' => 'Returns html with one activity module on course page',
559
        'type'        => 'read',
560
        'ajax'        => true,
561
    ),
562
    'core_courseformat_file_handlers' => [
563
        'classname'     => 'core_courseformat\external\file_handlers',
564
        'description'   => 'Get the current course file hanlders.',
565
        'type'          => 'read',
566
        'ajax'          => true,
567
    ],
568
    'core_courseformat_get_state' => [
569
        'classname'     => 'core_courseformat\external\get_state',
570
        'description'   => 'Get the current course state.',
571
        'type'          => 'read',
572
        'ajax'          => true,
573
    ],
574
    'core_courseformat_update_course' => [
575
        'classname'     => 'core_courseformat\external\update_course',
576
        'methodname'    => 'execute',
577
        'description'   => 'Update course contents.',
578
        'type'          => 'write',
579
        'ajax'          => true,
580
        'capabilities'  => 'moodle/course:sectionvisibility, moodle/course:activityvisibility',
581
    ],
582
    'core_course_edit_module' => array(
583
        'classname'   => 'core_course_external',
584
        'methodname'  => 'edit_module',
585
        'classpath'   => 'course/externallib.php',
586
        'description' => 'Performs an action on course module (change visibility, duplicate, delete, etc.)',
587
        'type'        => 'write',
588
        'ajax'        => true,
589
    ),
590
    'core_course_edit_section' => array(
591
        'classname'   => 'core_course_external',
592
        'methodname'  => 'edit_section',
593
        'classpath'   => 'course/externallib.php',
594
        'description' => 'Performs an action on course section (change visibility, set marker, delete)',
595
        'type'        => 'write',
596
        'ajax'        => true,
597
    ),
598
    'core_course_get_courses' => array(
599
        'classname' => 'core_course_external',
600
        'methodname' => 'get_courses',
601
        'classpath' => 'course/externallib.php',
602
        'description' => 'Return course details',
603
        'type' => 'read',
604
        'capabilities' => 'moodle/course:view, moodle/course:update, moodle/course:viewhiddencourses',
605
        'ajax' => true,
606
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
607
    ),
608
    'core_course_import_course' => array(
609
        'classname' => 'core_course_external',
610
        'methodname' => 'import_course',
611
        'classpath' => 'course/externallib.php',
612
        'description' => 'Import course data from a course into another course. Does not include any user data.',
613
        'type' => 'write',
614
        'capabilities' => 'moodle/backup:backuptargetimport, moodle/restore:restoretargetimport'
615
    ),
616
    'core_course_search_courses' => array(
617
        'classname' => 'core_course_external',
618
        'methodname' => 'search_courses',
619
        'classpath' => 'course/externallib.php',
620
        'description' => 'Search courses by (name, module, block, tag)',
621
        'type' => 'read',
622
        'ajax' => true,
623
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
624
    ),
625
    'core_course_update_categories' => array(
626
        'classname' => 'core_course_external',
627
        'methodname' => 'update_categories',
628
        'classpath' => 'course/externallib.php',
629
        'description' => 'Update categories',
630
        'type' => 'write',
631
        'capabilities' => 'moodle/category:manage',
632
    ),
633
    'core_course_update_courses' => array(
634
        'classname' => 'core_course_external',
635
        'methodname' => 'update_courses',
636
        'classpath' => 'course/externallib.php',
637
        'description' => 'Update courses',
638
        'type' => 'write',
639
        'capabilities' => 'moodle/course:update, moodle/course:changecategory, moodle/course:changefullname, '
640
            . 'moodle/course:changeshortname, moodle/course:changeidnumber, moodle/course:changesummary, moodle/course:visibility'
641
    ),
642
    'core_course_view_course' => array(
643
        'classname' => 'core_course_external',
644
        'methodname' => 'view_course',
645
        'classpath' => 'course/externallib.php',
646
        'description' => 'Log that the course was viewed',
647
        'type' => 'write',
648
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
649
    ),
650
    'core_course_get_user_navigation_options' => array(
651
        'classname' => 'core_course_external',
652
        'methodname' => 'get_user_navigation_options',
653
        'classpath' => 'course/externallib.php',
654
        'description' => 'Return a list of navigation options in a set of courses that are avaialable or not for the current user.',
655
        'type' => 'read',
656
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
657
    ),
658
    'core_course_get_user_administration_options' => array(
659
        'classname' => 'core_course_external',
660
        'methodname' => 'get_user_administration_options',
661
        'classpath' => 'course/externallib.php',
662
        'description' => 'Return a list of administration options in a set of courses that are avaialable or not for the current
663
                            user.',
664
        'type' => 'read',
665
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
666
    ),
667
    'core_course_get_courses_by_field' => array(
668
        'classname' => 'core_course_external',
669
        'methodname' => 'get_courses_by_field',
670
        'classpath' => 'course/externallib.php',
671
        'description' => 'Get courses matching a specific field (id/s, shortname, idnumber, category)',
672
        'type' => 'read',
673
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
674
    ),
675
    'core_course_check_updates' => array(
676
        'classname' => 'core_course_external',
677
        'methodname' => 'check_updates',
678
        'classpath' => 'course/externallib.php',
679
        'description' => 'Check if there is updates affecting the user for the given course and contexts.',
680
        'type' => 'read',
681
        'ajax' => true,
682
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
683
    ),
684
    'core_course_get_updates_since' => array(
685
        'classname' => 'core_course_external',
686
        'methodname' => 'get_updates_since',
687
        'classpath' => 'course/externallib.php',
688
        'description' => 'Check if there are updates affecting the user for the given course since the given time stamp.',
689
        'type' => 'read',
690
        'ajax' => true,
691
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
692
    ),
693
    'core_course_get_enrolled_courses_by_timeline_classification' => array(
694
        'classname' => 'core_course_external',
695
        'methodname' => 'get_enrolled_courses_by_timeline_classification',
696
        'classpath' => 'course/externallib.php',
697
        'description' => 'List of enrolled courses for the given timeline classification (past, inprogress, or future).',
698
        'type' => 'read',
699
        'ajax' => true,
700
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
701
    ),
702
    'core_course_get_enrolled_courses_with_action_events_by_timeline_classification' => array(
703
        'classname' => '\core_course\external\get_enrolled_courses_with_action_events_by_timeline_classification',
704
        'methodname' => 'execute',
705
        'classpath' => '',
706
        'description' => 'List of enrolled courses with action events in a given timeframe, for the given timeline classification.',
707
        'type' => 'read',
708
        'ajax' => true,
709
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
710
        'readonlysession' => true,
711
    ),
712
    'core_course_get_recent_courses' => array(
713
        'classname' => 'core_course_external',
714
        'methodname' => 'get_recent_courses',
715
        'classpath' => 'course/externallib.php',
716
        'description' => 'List of courses a user has accessed most recently.',
717
        'type' => 'read',
718
        'ajax' => true,
719
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
720
    ),
721
    'core_course_set_favourite_courses' => array(
722
        'classname' => 'core_course_external',
723
        'methodname' => 'set_favourite_courses',
724
        'classpath' => 'course/externallib.php',
725
        'description' => 'Add a list of courses to the list of favourite courses.',
726
        'type' => 'read',
727
        'ajax' => true,
728
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
729
    ),
730
    'core_course_get_enrolled_users_by_cmid' => array(
731
        'classname' => 'core_course_external',
732
        'methodname' => 'get_enrolled_users_by_cmid',
733
        'classpath' => 'course/externallib.php',
734
        'description' => 'List users by course module id, filter by group and active enrolment status.',
735
        'type' => 'read',
736
        'ajax' => true,
737
    ),
738
    'core_course_add_content_item_to_user_favourites' => array(
739
        'classname' => 'core_course_external',
740
        'methodname' => 'add_content_item_to_user_favourites',
741
        'classpath' => 'course/externallib.php',
742
        'description' => 'Adds a content item (activity, resource or their subtypes) to the favourites for the user.',
743
        'type' => 'write',
744
        'ajax' => true,
745
    ),
746
    'core_course_remove_content_item_from_user_favourites' => array(
747
        'classname' => 'core_course_external',
748
        'methodname' => 'remove_content_item_from_user_favourites',
749
        'classpath' => 'course/externallib.php',
750
        'description' => 'Removes a content item (activity, resource or their subtypes) from the favourites for the user.',
751
        'type' => 'write',
752
        'ajax' => true,
753
    ),
754
    'core_course_get_course_content_items' => array(
755
        'classname' => 'core_course_external',
756
        'methodname' => 'get_course_content_items',
757
        'classpath' => 'course/externallib.php',
758
        'description' => 'Fetch all the content items (activities, resources and their subtypes) for the activity picker',
759
        'type' => 'read',
760
        'ajax' => true,
761
    ),
762
    'core_course_get_activity_chooser_footer' => array(
763
        'classname' => 'core_course_external',
764
        'methodname' => 'get_activity_chooser_footer',
765
        'classpath' => 'course/externallib.php',
766
        'description' => 'Fetch the data for the activity chooser footer.',
767
        'type' => 'read',
768
        'ajax' => true,
769
    ),
770
    'core_course_toggle_activity_recommendation' => array(
771
        'classname' => 'core_course_external',
772
        'methodname' => 'toggle_activity_recommendation',
773
        'classpath' => 'course/externallib.php',
774
        'description' => 'Adds or removes an activity as a recommendation in the activity chooser.',
775
        'type' => 'write',
776
        'ajax' => true,
777
    ),
778
    'core_enrol_get_course_enrolment_methods' => array(
779
        'classname' => 'core_enrol_external',
780
        'methodname' => 'get_course_enrolment_methods',
781
        'classpath' => 'enrol/externallib.php',
782
        'description' => 'Get the list of course enrolment methods',
783
        'type' => 'read',
784
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
785
    ),
786
    'core_enrol_get_enrolled_users' => array(
787
        'classname' => 'core_enrol_external',
788
        'methodname' => 'get_enrolled_users',
789
        'classpath' => 'enrol/externallib.php',
790
        'description' => 'Get enrolled users by course id.',
791
        'type' => 'read',
792
        'capabilities' => 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, '
793
            . 'moodle/site:accessallgroups',
794
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
795
    ),
796
    'core_enrol_get_enrolled_users_with_capability' => array(
797
        'classname' => 'core_enrol_external',
798
        'methodname' => 'get_enrolled_users_with_capability',
799
        'classpath' => 'enrol/externallib.php',
800
        'description' => 'For each course and capability specified, return a list of the users that are enrolled in the course
801
                                  and have that capability',
802
        'type' => 'read',
803
    ),
804
    'core_enrol_get_potential_users' => array(
805
        'classname' => 'core_enrol_external',
806
        'methodname' => 'get_potential_users',
807
        'classpath' => 'enrol/externallib.php',
808
        'description' => 'Get the list of potential users to enrol',
809
        'ajax' => true,
810
        'type' => 'read',
811
        'capabilities' => 'moodle/course:enrolreview'
812
    ),
813
    'core_enrol_search_users' => [
814
        'classname' => 'core_enrol_external',
815
        'methodname' => 'search_users',
816
        'classpath' => 'enrol/externallib.php',
817
        'description' => 'Search within the list of course participants',
818
        'ajax' => true,
819
        'type' => 'read',
820
        'capabilities' => 'moodle/course:viewparticipants',
821
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
822
    ],
823
    'core_enrol_get_users_courses' => array(
824
        'classname' => 'core_enrol_external',
825
        'methodname' => 'get_users_courses',
826
        'classpath' => 'enrol/externallib.php',
827
        'description' => 'Get the list of courses where a user is enrolled in',
828
        'type' => 'read',
829
        'capabilities' => 'moodle/course:viewparticipants',
830
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
831
    ),
832
    'core_enrol_submit_user_enrolment_form' => array(
833
        'classname' => 'core_enrol_external',
834
        'methodname' => 'submit_user_enrolment_form',
835
        'classpath' => 'enrol/externallib.php',
836
        'description' => 'Submit form data for enrolment form',
837
        'type' => 'write',
838
        'ajax' => true,
839
    ),
840
    'core_enrol_unenrol_user_enrolment' => array(
841
        'classname' => 'core_enrol_external',
842
        'methodname' => 'unenrol_user_enrolment',
843
        'classpath' => 'enrol/externallib.php',
844
        'description' => 'External function that unenrols a given user enrolment',
845
        'type' => 'write',
846
        'ajax' => true,
847
    ),
848
    'core_fetch_notifications' => array(
849
        'classname' => 'core_external',
850
        'methodname' => 'fetch_notifications',
851
        'classpath' => 'lib/external/externallib.php',
852
        'description' => 'Return a list of notifications for the current session',
853
        'type' => 'read',
854
        'loginrequired' => false,
855
        'ajax' => true,
856
        'readonlysession' => false, // Fetching removes from stack.
857
    ),
858
    'core_session_touch' => array(
859
        'classname' => 'core\session\external',
860
        'methodname' => 'touch_session',
861
        'description' => 'Keep the users session alive',
862
        'type' => 'read',
863
        'loginrequired' => true,
864
        'ajax' => true,
865
    ),
866
    'core_session_time_remaining' => array(
867
        'classname' => 'core\session\external',
868
        'methodname' => 'time_remaining',
869
        'description' => 'Count the seconds remaining in this session',
870
        'type' => 'read',
871
        'loginrequired' => true,
872
        'ajax' => true,
873
    ),
874
    'core_files_get_files' => array(
875
        'classname' => 'core_files_external',
876
        'methodname' => 'get_files',
877
        'description' => 'browse moodle files',
878
        'type' => 'read',
879
        'classpath' => 'files/externallib.php',
880
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
881
    ),
882
    'core_files_upload' => array(
883
        'classname' => 'core_files_external',
884
        'methodname' => 'upload',
885
        'description' => 'upload a file to moodle',
886
        'type'        => 'write',
887
        'classpath'   => 'files/externallib.php',
888
    ),
889
    'core_files_delete_draft_files' => array(
890
        'classname' => 'core_files\external\delete\draft',
891
        'description' => 'Delete the indicated files (or directories) from a user draft file area.',
892
        'type'        => 'write',
893
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
894
    ),
895
    'core_files_get_unused_draft_itemid' => array(
896
        'classname' => 'core_files\external\get\unused_draft',
897
        'description' => 'Generate a new draft itemid for the current user.',
898
        'type'        => 'write',
899
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
900
    ),
901
    'core_form_get_filetypes_browser_data' => array(
902
        'classname' => 'core_form\external',
903
        'methodname' => 'get_filetypes_browser_data',
904
        'classpath' => '',
905
        'description' => 'Provides data for the filetypes element browser.',
906
        'type' => 'read',
907
        'loginrequired' => false,
908
        'ajax' => true,
909
    ),
910
    'core_form_dynamic_form' => array(
911
        'classname' => 'core_form\external\dynamic_form',
912
        'description' => 'Process submission of a dynamic (modal) form',
913
        'type' => 'write',
914
        'ajax' => true,
915
    ),
916
    'core_get_component_strings' => array(
917
        'classname' => 'core_external',
918
        'methodname' => 'get_component_strings',
919
        'classpath' => 'lib/external/externallib.php',
920
        'description' => 'Return all raw strings (with {$a->xxx}), for a specific component ' .
921
            '- similar to core get_component_strings(), call',
922
        'type' => 'read',
923
        'loginrequired' => false,
924
        'ajax' => true,
925
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
926
    ),
927
    'core_get_fragment' => array(
928
        'classname' => 'core_external',
929
        'methodname' => 'get_fragment',
930
        'classpath' => 'lib/external/externallib.php',
931
        'description' => 'Return a fragment for inclusion, such as a JavaScript page.',
932
        'type' => 'read',
933
        'ajax' => true,
934
    ),
935
    'core_get_string' => array(
936
        'classname' => 'core_external',
937
        'methodname' => 'get_string',
938
        'classpath' => 'lib/external/externallib.php',
939
        'description' => 'Return a translated string - similar to core get_string(), call',
940
        'type' => 'read',
941
        'loginrequired' => false,
942
        'ajax' => true,
943
    ),
944
    'core_get_strings' => array(
945
        'classname' => 'core_external',
946
        'methodname' => 'get_strings',
947
        'classpath' => 'lib/external/externallib.php',
948
        'description' => 'Return some translated strings - like several core get_string(), calls',
949
        'type' => 'read',
950
        'loginrequired' => false,
951
        'ajax' => true,
952
    ),
953
    'core_get_user_dates' => array(
954
        'classname' => 'core_external',
955
        'methodname' => 'get_user_dates',
956
        'classpath' => 'lib/external/externallib.php',
957
        'description' => 'Return formatted timestamps',
958
        'type' => 'read',
959
        'ajax' => true,
960
    ),
961
    'core_grades_update_grades' => array(
962
        'classname' => 'core_grades_external',
963
        'methodname' => 'update_grades',
964
        'description' => 'Update a grade item and associated student grades.',
965
        'type' => 'write',
966
    ),
967
    'core_grades_grader_gradingpanel_point_fetch' => [
968
        'classname' => 'core_grades\\grades\\grader\\gradingpanel\\point\\external\\fetch',
969
        'description' => 'Fetch the data required to display the grader grading panel for simple grading, ' .
970
            'creating the grade item if required',
971
        'type' => 'write',
972
        'ajax' => true,
973
        'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
974
    ],
975
    'core_grades_grader_gradingpanel_point_store' => [
976
        'classname' => 'core_grades\\grades\\grader\\gradingpanel\\point\\external\\store',
977
        'description' => 'Store the data required to display the grader grading panel for simple grading',
978
        'type' => 'write',
979
        'ajax' => true,
980
        'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
981
    ],
982
    'core_grades_grader_gradingpanel_scale_fetch' => [
983
        'classname' => 'core_grades\\grades\\grader\\gradingpanel\\scale\\external\\fetch',
984
        'description' => 'Fetch the data required to display the grader grading panel for scale-based grading, ' .
985
            'creating the grade item if required',
986
        'type' => 'write',
987
        'ajax' => true,
988
        'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
989
    ],
990
    'core_grades_grader_gradingpanel_scale_store' => [
991
        'classname' => 'core_grades\\grades\\grader\\gradingpanel\\scale\\external\\store',
992
        'description' => 'Store the data required to display the grader grading panel for scale-based grading',
993
        'type' => 'write',
994
        'ajax' => true,
995
        'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
996
    ],
997
    'core_grades_create_gradecategories' => array (
998
        'classname' => 'core_grades\external\create_gradecategories',
999
        'description' => 'Create grade categories inside a course gradebook.',
1000
        'type' => 'write',
1001
        'capabilities' => 'moodle/grade:manage',
1002
    ),
1003
    'core_grades_get_enrolled_users_for_search_widget' => array (
1004
        'classname' => 'core_grades\external\get_enrolled_users_for_search_widget',
1005
        'description' => '** DEPRECATED ** Please do not call this function any more. ' .
1006
            'Use core_grades_get_enrolled_users_for_selector instead. ' .
1007
            'Returns the enrolled users within and map some fields to the returned array of user objects.',
1008
        'type' => 'read',
1009
        'ajax' => true,
1010
        'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
1011
    ),
1012
    'core_grades_get_enrolled_users_for_selector' => array (
1013
        'classname' => 'core_grades\external\get_enrolled_users_for_selector',
1014
        'description' => 'Returns the enrolled users within and map some fields to the returned array of user objects.',
1015
        'type' => 'read',
1016
        'ajax' => true,
1017
        'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
1018
    ),
1019
    'core_grades_get_groups_for_search_widget' => [
1020
        'classname' => 'core_group\external\get_groups_for_selector',
1021
        'description' => '** DEPRECATED ** Please do not call this function any more. ' .
1022
            'Use core_group_get_groups_for_selector instead. ' .
1023
            'Get the group/(s) for a course',
1024
        'type' => 'read',
1025
        'ajax' => true,
1026
        'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
1027
    ],
1028
    'core_grades_get_groups_for_selector' => [
1029
        'classname' => 'core_group\external\get_groups_for_selector',
1030
        'description' => '** DEPRECATED ** Please do not call this function any more. ' .
1031
            'Use core_group_get_groups_for_selector instead. ' .
1032
            'Get the group/(s) for a course',
1033
        'type' => 'read',
1034
        'ajax' => true,
1035
        'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
1036
    ],
1037
    'core_grades_get_feedback' => [
1038
        'classname' => 'core_grades\external\get_feedback',
1039
        'description' => 'Get the feedback data for a grade item',
1040
        'type' => 'read',
1041
        'ajax' => true,
1042
        ],
1043
    'core_grades_get_gradeitems' => [
1044
        'classname' => 'core_grades\external\get_gradeitems',
1045
        'description' => 'Get the gradeitems for a course',
1046
        'type' => 'read',
1047
        'ajax' => true,
1048
        'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
1049
    ],
1050
    'core_grades_get_grade_tree' => [
1051
        'classname' => 'core_grades\external\get_grade_tree',
1052
        'description' => 'Get the grade tree structure for a course',
1053
        'type' => 'read',
1054
        'ajax' => true,
1055
    ],
1056
    'core_grades_get_gradable_users' => [
1057
        'classname' => 'core_grades\external\get_gradable_users',
1058
        'description' => 'Returns the gradable users in a course',
1059
        'type' => 'read',
1060
        'ajax' => true,
1061
        'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
1062
    ],
1063
    'core_grading_get_definitions' => array(
1064
        'classname' => 'core_grading_external',
1065
        'methodname' => 'get_definitions',
1066
        'description' => 'Get grading definitions',
1067
        'type' => 'read',
1068
    ),
1069
    'core_grading_get_gradingform_instances' => array(
1070
        'classname' => 'core_grading_external',
1071
        'methodname' => 'get_gradingform_instances',
1072
        'description' => 'Get grading form instances',
1073
        'type' => 'read',
1074
    ),
1075
    'core_grading_save_definitions' => array(
1076
        'classname' => 'core_grading_external',
1077
        'methodname' => 'save_definitions',
1078
        'description' => 'Save grading definitions',
1079
        'type' => 'write',
1080
    ),
1081
    'core_group_add_group_members' => array(
1082
        'classname' => 'core_group_external',
1083
        'methodname' => 'add_group_members',
1084
        'classpath' => 'group/externallib.php',
1085
        'description' => 'Adds group members.',
1086
        'type' => 'write',
1087
        'capabilities' => 'moodle/course:managegroups',
1088
    ),
1089
    'core_group_assign_grouping' => array(
1090
        'classname' => 'core_group_external',
1091
        'methodname' => 'assign_grouping',
1092
        'classpath' => 'group/externallib.php',
1093
        'description' => 'Assing groups from groupings',
1094
        'type' => 'write',
1095
    ),
1096
    'core_group_create_groupings' => array(
1097
        'classname' => 'core_group_external',
1098
        'methodname' => 'create_groupings',
1099
        'classpath' => 'group/externallib.php',
1100
        'description' => 'Creates new groupings',
1101
        'type' => 'write',
1102
    ),
1103
    'core_group_create_groups' => array(
1104
        'classname' => 'core_group_external',
1105
        'methodname' => 'create_groups',
1106
        'classpath' => 'group/externallib.php',
1107
        'description' => 'Creates new groups.',
1108
        'type' => 'write',
1109
        'capabilities' => 'moodle/course:managegroups'
1110
    ),
1111
    'core_group_delete_group_members' => array(
1112
        'classname' => 'core_group_external',
1113
        'methodname' => 'delete_group_members',
1114
        'classpath' => 'group/externallib.php',
1115
        'description' => 'Deletes group members.',
1116
        'type' => 'write',
1117
        'capabilities' => 'moodle/course:managegroups'
1118
    ),
1119
    'core_group_delete_groupings' => array(
1120
        'classname' => 'core_group_external',
1121
        'methodname' => 'delete_groupings',
1122
        'classpath' => 'group/externallib.php',
1123
        'description' => 'Deletes all specified groupings.',
1124
        'type' => 'write',
1125
    ),
1126
    'core_group_delete_groups' => array(
1127
        'classname' => 'core_group_external',
1128
        'methodname' => 'delete_groups',
1129
        'classpath' => 'group/externallib.php',
1130
        'description' => 'Deletes all specified groups.',
1131
        'type' => 'write',
1132
        'capabilities' => 'moodle/course:managegroups'
1133
    ),
1134
    'core_group_get_activity_allowed_groups' => array(
1135
        'classname' => 'core_group_external',
1136
        'methodname' => 'get_activity_allowed_groups',
1137
        'classpath' => 'group/externallib.php',
1138
        'description' => 'Gets a list of groups that the user is allowed to access within the specified activity.',
1139
        'type' => 'read',
1140
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1141
    ),
1142
    'core_group_get_activity_groupmode' => array(
1143
        'classname' => 'core_group_external',
1144
        'methodname' => 'get_activity_groupmode',
1145
        'classpath' => 'group/externallib.php',
1146
        'description' => 'Returns effective groupmode used in a given activity.',
1147
        'type' => 'read',
1148
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1149
    ),
1150
    'core_group_get_course_groupings' => array(
1151
        'classname' => 'core_group_external',
1152
        'methodname' => 'get_course_groupings',
1153
        'classpath' => 'group/externallib.php',
1154
        'description' => 'Returns all groupings in specified course.',
1155
        'type' => 'read',
1156
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1157
    ),
1158
    'core_group_get_course_groups' => array(
1159
        'classname' => 'core_group_external',
1160
        'methodname' => 'get_course_groups',
1161
        'classpath' => 'group/externallib.php',
1162
        'description' => 'Returns all groups in specified course.',
1163
        'type' => 'read',
1164
        'ajax' => true,
1165
        'capabilities' => 'moodle/course:managegroups',
1166
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1167
    ),
1168
    'core_group_get_course_user_groups' => array(
1169
        'classname' => 'core_group_external',
1170
        'methodname' => 'get_course_user_groups',
1171
        'classpath' => 'group/externallib.php',
1172
        'description' => 'Returns all groups in specified course for the specified user.',
1173
        'type' => 'read',
1174
        'capabilities' => 'moodle/course:managegroups',
1175
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1176
    ),
1177
    'core_group_get_group_members' => array(
1178
        'classname' => 'core_group_external',
1179
        'methodname' => 'get_group_members',
1180
        'classpath' => 'group/externallib.php',
1181
        'description' => 'Returns group members.',
1182
        'type' => 'read',
1183
        'capabilities' => 'moodle/course:managegroups'
1184
    ),
1185
    'core_group_get_groupings' => array(
1186
        'classname' => 'core_group_external',
1187
        'methodname' => 'get_groupings',
1188
        'classpath' => 'group/externallib.php',
1189
        'description' => 'Returns groupings details.',
1190
        'type' => 'read',
1191
    ),
1192
    'core_group_get_groups' => array(
1193
        'classname' => 'core_group_external',
1194
        'methodname' => 'get_groups',
1195
        'classpath' => 'group/externallib.php',
1196
        'description' => 'Returns group details.',
1197
        'type' => 'read',
1198
        'capabilities' => 'moodle/course:managegroups'
1199
    ),
1200
    'core_group_get_groups_for_selector' => [
1201
        'classname' => 'core_group\external\get_groups_for_selector',
1202
        'description' => 'Get the group/(s) for a course',
1203
        'type' => 'read',
1204
        'ajax' => true,
1205
        'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
1206
    ],
1207
    'core_group_unassign_grouping' => array(
1208
        'classname' => 'core_group_external',
1209
        'methodname' => 'unassign_grouping',
1210
        'classpath' => 'group/externallib.php',
1211
        'description' => 'Unassing groups from groupings',
1212
        'type' => 'write',
1213
    ),
1214
    'core_group_update_groupings' => array(
1215
        'classname' => 'core_group_external',
1216
        'methodname' => 'update_groupings',
1217
        'classpath' => 'group/externallib.php',
1218
        'description' => 'Updates existing groupings',
1219
        'type' => 'write',
1220
    ),
1221
    'core_group_update_groups' => array(
1222
        'classname' => 'core_group_external',
1223
        'methodname' => 'update_groups',
1224
        'classpath' => 'group/externallib.php',
1225
        'description' => 'Updates existing groups.',
1226
        'type' => 'write',
1227
        'capabilities' => 'moodle/course:managegroups'
1228
    ),
1229
    'core_message_mute_conversations' => array(
1230
        'classname' => 'core_message_external',
1231
        'methodname' => 'mute_conversations',
1232
        'classpath' => 'message/externallib.php',
1233
        'description' => 'Mutes a list of conversations',
1234
        'type' => 'write',
1235
        'ajax' => true,
1236
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1237
    ),
1238
    'core_message_unmute_conversations' => array(
1239
        'classname' => 'core_message_external',
1240
        'methodname' => 'unmute_conversations',
1241
        'classpath' => 'message/externallib.php',
1242
        'description' => 'Unmutes a list of conversations',
1243
        'type' => 'write',
1244
        'ajax' => true,
1245
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1246
    ),
1247
    'core_message_block_user' => array(
1248
        'classname' => 'core_message_external',
1249
        'methodname' => 'block_user',
1250
        'classpath' => 'message/externallib.php',
1251
        'description' => 'Blocks a user',
1252
        'type' => 'write',
1253
        'ajax' => true,
1254
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1255
    ),
1256
    'core_message_get_contact_requests' => array(
1257
        'classname' => 'core_message_external',
1258
        'methodname' => 'get_contact_requests',
1259
        'classpath' => 'message/externallib.php',
1260
        'description' => 'Returns contact requests for a user',
1261
        'type' => 'read',
1262
        'ajax' => true,
1263
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1264
    ),
1265
    'core_message_create_contact_request' => array(
1266
        'classname' => 'core_message_external',
1267
        'methodname' => 'create_contact_request',
1268
        'classpath' => 'message/externallib.php',
1269
        'description' => 'Creates a contact request',
1270
        'type' => 'write',
1271
        'ajax' => true,
1272
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1273
    ),
1274
    'core_message_confirm_contact_request' => array(
1275
        'classname' => 'core_message_external',
1276
        'methodname' => 'confirm_contact_request',
1277
        'classpath' => 'message/externallib.php',
1278
        'description' => 'Confirms a contact request',
1279
        'type' => 'write',
1280
        'ajax' => true,
1281
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1282
    ),
1283
    'core_message_decline_contact_request' => array(
1284
        'classname' => 'core_message_external',
1285
        'methodname' => 'decline_contact_request',
1286
        'classpath' => 'message/externallib.php',
1287
        'description' => 'Declines a contact request',
1288
        'type' => 'write',
1289
        'ajax' => true,
1290
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1291
    ),
1292
    'core_message_get_received_contact_requests_count' => array(
1293
        'classname' => 'core_message_external',
1294
        'methodname' => 'get_received_contact_requests_count',
1295
        'classpath' => 'message/externallib.php',
1296
        'description' => 'Gets the number of received contact requests',
1297
        'type' => 'read',
1298
        'ajax' => true,
1299
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1300
    ),
1301
    'core_message_delete_contacts' => array(
1302
        'classname' => 'core_message_external',
1303
        'methodname' => 'delete_contacts',
1304
        'classpath' => 'message/externallib.php',
1305
        'description' => 'Remove contacts from the contact list',
1306
        'type' => 'write',
1307
        'ajax' => true,
1308
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1309
    ),
1310
    'core_message_delete_conversations_by_id' => array(
1311
        'classname' => 'core_message_external',
1312
        'methodname' => 'delete_conversations_by_id',
1313
        'classpath' => 'message/externallib.php',
1314
        'description' => 'Deletes a list of conversations.',
1315
        'type' => 'write',
1316
        'capabilities' => 'moodle/site:deleteownmessage',
1317
        'ajax' => true,
1318
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1319
    ),
1320
    'core_message_delete_message' => array(
1321
        'classname' => 'core_message_external',
1322
        'methodname' => 'delete_message',
1323
        'classpath' => 'message/externallib.php',
1324
        'description' => 'Deletes a message.',
1325
        'type' => 'write',
1326
        'capabilities' => 'moodle/site:deleteownmessage',
1327
        'ajax' => true,
1328
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1329
    ),
1330
    'core_message_get_blocked_users' => array(
1331
        'classname' => 'core_message_external',
1332
        'methodname' => 'get_blocked_users',
1333
        'classpath' => 'message/externallib.php',
1334
        'description' => 'Retrieve a list of users blocked',
1335
        'type' => 'read',
1336
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1337
    ),
1338
    'core_message_data_for_messagearea_search_messages' => array(
1339
        'classname' => 'core_message_external',
1340
        'methodname' => 'data_for_messagearea_search_messages',
1341
        'classpath' => 'message/externallib.php',
1342
        'description' => 'Retrieve the template data for searching for messages',
1343
        'type' => 'read',
1344
        'ajax' => true,
1345
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1346
    ),
1347
    'core_message_message_search_users' => array(
1348
        'classname' => 'core_message_external',
1349
        'methodname' => 'message_search_users',
1350
        'classpath' => 'message/externallib.php',
1351
        'description' => 'Retrieve the data for searching for people',
1352
        'type' => 'read',
1353
        'ajax' => true,
1354
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1355
    ),
1356
    'core_message_get_user_contacts' => array(
1357
        'classname' => 'core_message_external',
1358
        'methodname' => 'get_user_contacts',
1359
        'classpath' => 'message/externallib.php',
1360
        'description' => 'Retrieve the contact list',
1361
        'type' => 'read',
1362
        'ajax' => true,
1363
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1364
    ),
1365
    'core_message_get_conversations' => array(
1366
        'classname' => 'core_message_external',
1367
        'methodname' => 'get_conversations',
1368
        'classpath' => 'message/externallib.php',
1369
        'description' => 'Retrieve a list of conversations for a user',
1370
        'type' => 'read',
1371
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1372
        'ajax' => true
1373
    ),
1374
    'core_message_get_conversation' => array(
1375
        'classname' => 'core_message_external',
1376
        'methodname' => 'get_conversation',
1377
        'classpath' => 'message/externallib.php',
1378
        'description' => 'Retrieve a conversation for a user',
1379
        'type' => 'read',
1380
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1381
        'ajax' => true
1382
    ),
1383
    'core_message_get_conversation_between_users' => array(
1384
        'classname' => 'core_message_external',
1385
        'methodname' => 'get_conversation_between_users',
1386
        'classpath' => 'message/externallib.php',
1387
        'description' => 'Retrieve a conversation for a user between another user',
1388
        'type' => 'read',
1389
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1390
        'ajax' => true
1391
    ),
1392
    'core_message_get_self_conversation' => array(
1393
        'classname' => 'core_message_external',
1394
        'methodname' => 'get_self_conversation',
1395
        'classpath' => 'message/externallib.php',
1396
        'description' => 'Retrieve a self-conversation for a user',
1397
        'type' => 'read',
1398
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1399
        'ajax' => true
1400
    ),
1401
    'core_message_get_messages' => array(
1402
        'classname' => 'core_message_external',
1403
        'methodname' => 'get_messages',
1404
        'classpath' => 'message/externallib.php',
1405
        'description' => 'Retrieve a list of messages sent and received by a user (conversations, notifications or both)',
1406
        'type' => 'read',
1407
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1408
        'ajax' => true,
1409
    ),
1410
    'core_message_get_conversation_counts' => array(
1411
        'classname' => 'core_message_external',
1412
        'methodname' => 'get_conversation_counts',
1413
        'classpath' => 'message/externallib.php',
1414
        'description' => 'Retrieve a list of conversation counts, indexed by type.',
1415
        'type' => 'read',
1416
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1417
        'ajax' => true,
1418
    ),
1419
    'core_message_get_unread_conversation_counts' => array(
1420
        'classname' => 'core_message_external',
1421
        'methodname' => 'get_unread_conversation_counts',
1422
        'classpath' => 'message/externallib.php',
1423
        'description' => 'Retrieve a list of unread conversation counts, indexed by type.',
1424
        'type' => 'read',
1425
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1426
        'ajax' => true,
1427
    ),
1428
    'core_message_get_conversation_members' => array(
1429
        'classname' => 'core_message_external',
1430
        'methodname' => 'get_conversation_members',
1431
        'classpath' => 'message/externallib.php',
1432
        'description' => 'Retrieve a list of members in a conversation',
1433
        'type' => 'read',
1434
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1435
        'ajax' => true,
1436
    ),
1437
    'core_message_get_member_info' => array(
1438
        'classname' => 'core_message_external',
1439
        'methodname' => 'get_member_info',
1440
        'classpath' => 'message/externallib.php',
1441
        'description' => 'Retrieve a user message profiles',
1442
        'type' => 'read',
1443
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1444
        'ajax' => true,
1445
    ),
1446
    'core_message_get_unread_conversations_count' => array(
1447
        'classname' => 'core_message_external',
1448
        'methodname' => 'get_unread_conversations_count',
1449
        'classpath' => 'message/externallib.php',
1450
        'description' => 'Retrieve the count of unread conversations for a given user',
1451
        'type' => 'read',
1452
        'ajax' => true,
1453
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1454
        'readonlysession' => true, // We don't modify the session.
1455
    ),
1456
    'core_message_mark_all_notifications_as_read' => array(
1457
        'classname' => 'core_message_external',
1458
        'methodname' => 'mark_all_notifications_as_read',
1459
        'classpath' => 'message/externallib.php',
1460
        'description' => 'Mark all notifications as read for a given user',
1461
        'type' => 'write',
1462
        'ajax' => true,
1463
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1464
    ),
1465
    'core_message_mark_all_conversation_messages_as_read' => array(
1466
        'classname' => 'core_message_external',
1467
        'methodname' => 'mark_all_conversation_messages_as_read',
1468
        'classpath' => 'message/externallib.php',
1469
        'description' => 'Mark all conversation messages as read for a given user',
1470
        'type' => 'write',
1471
        'ajax' => true,
1472
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1473
    ),
1474
    'core_message_mark_message_read' => array(
1475
        'classname' => 'core_message_external',
1476
        'methodname' => 'mark_message_read',
1477
        'classpath' => 'message/externallib.php',
1478
        'description' => 'Mark a single message as read, trigger message_viewed event.',
1479
        'type' => 'write',
1480
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1481
        'ajax' => true,
1482
    ),
1483
    'core_message_mark_notification_read' => array(
1484
        'classname' => 'core_message_external',
1485
        'methodname' => 'mark_notification_read',
1486
        'classpath' => 'message/externallib.php',
1487
        'description' => 'Mark a single notification as read, trigger notification_viewed event.',
1488
        'type' => 'write',
1489
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1490
        'ajax' => true,
1491
    ),
1492
    'core_message_message_processor_config_form' => array(
1493
        'classname' => 'core_message_external',
1494
        'methodname' => 'message_processor_config_form',
1495
        'classpath' => 'message/externallib.php',
1496
        'description' => 'Process the message processor config form',
1497
        'type' => 'write',
1498
        'ajax' => true,
1499
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1500
    ),
1501
    'core_message_get_message_processor' => array(
1502
        'classname' => 'core_message_external',
1503
        'methodname' => 'get_message_processor',
1504
        'classpath' => 'message/externallib.php',
1505
        'description' => 'Get a message processor',
1506
        'type' => 'read',
1507
        'ajax' => true,
1508
    ),
1509
    'core_message_search_contacts' => array(
1510
        'classname' => 'core_message_external',
1511
        'methodname' => 'search_contacts',
1512
        'classpath' => 'message/externallib.php',
1513
        'description' => 'Search for contacts',
1514
        'type' => 'read',
1515
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1516
    ),
1517
    'core_message_send_instant_messages' => array(
1518
        'classname' => 'core_message_external',
1519
        'methodname' => 'send_instant_messages',
1520
        'classpath' => 'message/externallib.php',
1521
        'description' => 'Send instant messages',
1522
        'type' => 'write',
1523
        'capabilities' => 'moodle/site:sendmessage',
1524
        'ajax' => true,
1525
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1526
        'readonlysession' => true,
1527
    ),
1528
    'core_message_send_messages_to_conversation' => array(
1529
        'classname' => 'core_message_external',
1530
        'methodname' => 'send_messages_to_conversation',
1531
        'classpath' => 'message/externallib.php',
1532
        'description' => 'Send messages to an existing conversation between users',
1533
        'type' => 'write',
1534
        'capabilities' => 'moodle/site:sendmessage',
1535
        'ajax' => true,
1536
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1537
    ),
1538
    'core_message_get_conversation_messages' => array(
1539
        'classname' => 'core_message_external',
1540
        'methodname' => 'get_conversation_messages',
1541
        'classpath' => 'message/externallib.php',
1542
        'description' => 'Retrieve the conversation messages and relevant member information',
1543
        'type' => 'read',
1544
        'ajax' => true,
1545
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1546
    ),
1547
    'core_message_unblock_user' => array(
1548
        'classname' => 'core_message_external',
1549
        'methodname' => 'unblock_user',
1550
        'classpath' => 'message/externallib.php',
1551
        'description' => 'Unblocks a user',
1552
        'type' => 'write',
1553
        'ajax' => true,
1554
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1555
    ),
1556
    'core_message_get_user_notification_preferences' => array(
1557
        'classname' => 'core_message_external',
1558
        'methodname' => 'get_user_notification_preferences',
1559
        'classpath' => 'message/externallib.php',
1560
        'description' => 'Get the notification preferences for a given user.',
1561
        'type' => 'read',
1562
        'capabilities' => 'moodle/user:editownmessageprofile',
1563
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1564
    ),
1565
    'core_message_get_user_message_preferences' => array(
1566
        'classname' => 'core_message_external',
1567
        'methodname' => 'get_user_message_preferences',
1568
        'classpath' => 'message/externallib.php',
1569
        'description' => 'Get the message preferences for a given user.',
1570
        'type' => 'read',
1571
        'capabilities' => 'moodle/user:editownmessageprofile',
1572
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1573
        'ajax' => true
1574
    ),
1575
    'core_message_set_favourite_conversations' => array(
1576
        'classname' => 'core_message_external',
1577
        'methodname' => 'set_favourite_conversations',
1578
        'classpath' => 'message/externallib.php',
1579
        'description' => 'Mark a conversation or group of conversations as favourites/starred conversations.',
1580
        'type' => 'write',
1581
        'ajax' => true,
1582
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1583
    ),
1584
    'core_message_unset_favourite_conversations' => array(
1585
        'classname' => 'core_message_external',
1586
        'methodname' => 'unset_favourite_conversations',
1587
        'classpath' => 'message/externallib.php',
1588
        'description' => 'Unset a conversation or group of conversations as favourites/starred conversations.',
1589
        'type' => 'write',
1590
        'ajax' => true,
1591
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1592
    ),
1593
    'core_message_delete_message_for_all_users' => array(
1594
        'classname' => 'core_message_external',
1595
        'methodname' => 'delete_message_for_all_users',
1596
        'classpath' => 'message/externallib.php',
1597
        'description' => 'Deletes a message for all users.',
1598
        'type' => 'write',
1599
        'capabilities' => 'moodle/site:deleteanymessage',
1600
        'ajax' => true,
1601
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1602
    ),
1603
    'core_message_get_unread_notification_count' => [
1604
        'classname'     => '\core_message\external\get_unread_notification_count',
1605
        'description'   => 'Get number of unread notifications.',
1606
        'type'          => 'read',
1607
        'services'      => [MOODLE_OFFICIAL_MOBILE_SERVICE],
1608
    ],
1609
    'core_my_view_page' => [
1610
        'classname'     => '\core_my\external\view_page',
1611
        'methodname'    => 'execute',
1612
        'description'   => 'Trigger the My or Dashboard viewed event.',
1613
        'type'          => 'write',
1614
        'services'      => [MOODLE_OFFICIAL_MOBILE_SERVICE],
1615
    ],
1616
    'core_notes_create_notes' => array(
1617
        'classname' => 'core_notes_external',
1618
        'methodname' => 'create_notes',
1619
        'classpath' => 'notes/externallib.php',
1620
        'description' => 'Create notes',
1621
        'type' => 'write',
1622
        'ajax' => true,
1623
        'capabilities' => 'moodle/notes:manage',
1624
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1625
    ),
1626
    'core_notes_delete_notes' => array(
1627
        'classname' => 'core_notes_external',
1628
        'methodname' => 'delete_notes',
1629
        'classpath' => 'notes/externallib.php',
1630
        'description' => 'Delete notes',
1631
        'type' => 'write',
1632
        'capabilities' => 'moodle/notes:manage',
1633
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1634
    ),
1635
    'core_notes_get_course_notes' => array(
1636
        'classname' => 'core_notes_external',
1637
        'methodname' => 'get_course_notes',
1638
        'classpath' => 'notes/externallib.php',
1639
        'description' => 'Returns all notes in specified course (or site), for the specified user.',
1640
        'type' => 'read',
1641
        'capabilities' => 'moodle/notes:view',
1642
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1643
    ),
1644
    'core_notes_get_notes' => array(
1645
        'classname' => 'core_notes_external',
1646
        'methodname' => 'get_notes',
1647
        'classpath' => 'notes/externallib.php',
1648
        'description' => 'Get notes',
1649
        'type' => 'read',
1650
        'capabilities' => 'moodle/notes:view'
1651
    ),
1652
    'core_notes_update_notes' => array(
1653
        'classname' => 'core_notes_external',
1654
        'methodname' => 'update_notes',
1655
        'classpath' => 'notes/externallib.php',
1656
        'description' => 'Update notes',
1657
        'type' => 'write',
1658
        'capabilities' => 'moodle/notes:manage'
1659
    ),
1660
    'core_notes_view_notes' => array(
1661
        'classname' => 'core_notes_external',
1662
        'methodname' => 'view_notes',
1663
        'classpath' => 'notes/externallib.php',
1664
        'description' => 'Simulates the web interface view of notes/index.php: trigger events.',
1665
        'type' => 'write',
1666
        'capabilities' => 'moodle/notes:view',
1667
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1668
    ),
1669
    'core_output_load_template' => array(
1670
        'classname' => 'core\output\external',
1671
        'methodname' => 'load_template',
1672
        'description' => 'Load a template for a renderable',
1673
        'type' => 'read',
1674
        'loginrequired' => false,
1675
        'ajax' => true,
1676
    ),
1677
    'core_output_load_template_with_dependencies' => array(
1678
        'classname' => 'core\output\external',
1679
        'methodname' => 'load_template_with_dependencies',
1680
        'description' => 'Load a template and its dependencies for a renderable',
1681
        'type' => 'read',
1682
        'loginrequired' => false,
1683
        'ajax' => true,
1684
    ),
1685
    'core_output_load_fontawesome_icon_map' => array(
1686
        'classname' => 'core\output\external',
1687
        'methodname' => 'load_fontawesome_icon_map',
1688
        'description' => 'Load the mapping of names to icons',
1689
        'type' => 'read',
1690
        'loginrequired' => false,
1691
        'ajax' => true,
1692
    ),
1693
    'core_output_load_fontawesome_icon_system_map' => array(
1694
        'classname' => 'core\external\output\icon_system\load_fontawesome_map',
1695
        'description' => 'Load the mapping of moodle pix names to fontawesome icon names',
1696
        'type' => 'read',
1697
        'loginrequired' => false,
1698
        'ajax' => true,
1699
    ),
1700
    // Question related functions.
1701
    'core_question_update_flag' => array(
1702
        'classname'     => 'core_question_external',
1703
        'methodname'    => 'update_flag',
1704
        'description'   => 'Update the flag state of a question attempt.',
1705
        'type'          => 'write',
1706
        'capabilities'  => 'moodle/question:flag',
1707
        'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1708
    ),
1709
    'core_question_get_random_question_summaries' => array(
1710
        'classname' => 'core_question_external',
1711
        'methodname' => 'get_random_question_summaries',
1712
        'description' => 'Get the random question set for a criteria',
1713
        'type' => 'read',
1714
        'ajax' => true,
1715
    ),
1716
    'core_rating_get_item_ratings' => array(
1717
        'classname' => 'core_rating_external',
1718
        'methodname' => 'get_item_ratings',
1719
        'description' => 'Retrieve all the ratings for an item.',
1720
        'type' => 'read',
1721
        'capabilities' => 'moodle/rating:view',
1722
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1723
    ),
1724
    'core_rating_add_rating' => array(
1725
        'classname' => 'core_rating_external',
1726
        'methodname' => 'add_rating',
1727
        'description' => 'Rates an item.',
1728
        'type' => 'write',
1729
        'capabilities' => 'moodle/rating:rate',
1730
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1731
    ),
1732
    'core_role_assign_roles' => array(
1733
        'classname' => 'core_role_external',
1734
        'methodname' => 'assign_roles',
1735
        'classpath' => 'enrol/externallib.php',
1736
        'description' => 'Manual role assignments.',
1737
        'type' => 'write',
1738
        'capabilities' => 'moodle/role:assign'
1739
    ),
1740
    'core_role_unassign_roles' => array(
1741
        'classname' => 'core_role_external',
1742
        'methodname' => 'unassign_roles',
1743
        'classpath' => 'enrol/externallib.php',
1744
        'description' => 'Manual role unassignments.',
1745
        'type' => 'write',
1746
        'capabilities' => 'moodle/role:assign'
1747
    ),
1748
    'core_search_get_relevant_users' => array(
1749
        'classname' => '\core_search\external',
1750
        'methodname' => 'get_relevant_users',
1751
        'description' => 'Gets relevant users for a search request.',
1752
        'type' => 'read',
1753
        'ajax' => true
1754
    ),
1755
    'core_search_get_results' => [
1756
        'classname' => '\core_search\external\get_results',
1757
        'description' => 'Get search results.',
1758
        'type' => 'read',
1759
        'capabilities' => 'moodle/search:query',
1760
        'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
1761
    ],
1762
    'core_search_get_search_areas_list' => [
1763
        'classname' => '\core_search\external\get_search_areas_list',
1764
        'description' => 'Get search areas.',
1765
        'type' => 'read',
1766
        'capabilities' => 'moodle/search:query',
1767
        'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
1768
    ],
1769
    'core_search_view_results' => [
1770
        'classname' => '\core_search\external\view_results',
1771
        'description' => 'Trigger view search results event.',
1772
        'type' => 'write',
1773
        'capabilities' => 'moodle/search:query',
1774
        'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
1775
    ],
1776
    'core_search_get_top_results' => [
1777
        'classname' => '\core_search\external\get_top_results',
1778
        'description' => 'Get top search results.',
1779
        'type' => 'read',
1780
        'capabilities' => 'moodle/search:query',
1781
        'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
1782
    ],
1783
    'core_tag_get_tagindex' => array(
1784
        'classname' => 'core_tag_external',
1785
        'methodname' => 'get_tagindex',
1786
        'description' => 'Gets tag index page for one tag and one tag area',
1787
        'type' => 'read',
1788
        'ajax' => true,
1789
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1790
    ),
1791
    'core_tag_get_tags' => array(
1792
        'classname' => 'core_tag_external',
1793
        'methodname' => 'get_tags',
1794
        'description' => 'Gets tags by their ids',
1795
        'type' => 'read',
1796
        'ajax' => true,
1797
    ),
1798
    'core_tag_update_tags' => array(
1799
        'classname' => 'core_tag_external',
1800
        'methodname' => 'update_tags',
1801
        'description' => 'Updates tags',
1802
        'type' => 'write',
1803
        'ajax' => true,
1804
    ),
1805
    'core_tag_get_tagindex_per_area' => array(
1806
        'classname' => 'core_tag_external',
1807
        'methodname' => 'get_tagindex_per_area',
1808
        'description' => 'Gets tag index page per different areas.',
1809
        'type' => 'read',
1810
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1811
    ),
1812
    'core_tag_get_tag_areas' => array(
1813
        'classname' => 'core_tag_external',
1814
        'methodname' => 'get_tag_areas',
1815
        'description' => 'Retrieves existing tag areas.',
1816
        'type' => 'read',
1817
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1818
    ),
1819
    'core_tag_get_tag_collections' => array(
1820
        'classname' => 'core_tag_external',
1821
        'methodname' => 'get_tag_collections',
1822
        'description' => 'Retrieves existing tag collections.',
1823
        'type' => 'read',
1824
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1825
    ),
1826
    'core_tag_get_tag_cloud' => array(
1827
        'classname' => 'core_tag_external',
1828
        'methodname' => 'get_tag_cloud',
1829
        'description' => 'Retrieves a tag cloud for the given collection and/or query search.',
1830
        'type' => 'read',
1831
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1832
    ),
1833
    'core_update_inplace_editable' => array(
1834
        'classname' => 'core_external',
1835
        'methodname' => 'update_inplace_editable',
1836
        'classpath' => 'lib/external/externallib.php',
1837
        'description' => 'Generic service to update title',
1838
        'type' => 'write',
1839
        'loginrequired' => true,
1840
        'ajax' => true,
1841
    ),
1842
    'core_user_add_user_device' => array(
1843
        'classname' => 'core_user_external',
1844
        'methodname' => 'add_user_device',
1845
        'classpath' => 'user/externallib.php',
1846
        'description' => 'Store mobile user devices information for PUSH Notifications.',
1847
        'type' => 'write',
1848
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1849
    ),
1850
    'core_user_update_user_device_public_key' => array(
1851
        'classname' => '\core_user\external\update_user_device_public_key',
1852
        'description' => 'Store mobile user public key.',
1853
        'type' => 'write',
1854
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1855
    ),
1856
    'core_user_add_user_private_files' => array(
1857
        'classname' => 'core_user_external',
1858
        'methodname' => 'add_user_private_files',
1859
        'classpath' => 'user/externallib.php',
1860
        'description' => 'Copy files from a draft area to users private files area.',
1861
        'type' => 'write',
1862
        'capabilities' => 'moodle/user:manageownfiles',
1863
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1864
    ),
1865
    'core_user_create_users' => array(
1866
        'classname' => 'core_user_external',
1867
        'methodname' => 'create_users',
1868
        'classpath' => 'user/externallib.php',
1869
        'description' => 'Create users.',
1870
        'type' => 'write',
1871
        'capabilities' => 'moodle/user:create'
1872
    ),
1873
    'core_user_delete_users' => array(
1874
        'classname' => 'core_user_external',
1875
        'methodname' => 'delete_users',
1876
        'classpath' => 'user/externallib.php',
1877
        'description' => 'Delete users.',
1878
        'type' => 'write',
1879
        'capabilities' => 'moodle/user:delete'
1880
    ),
1881
    'core_user_get_course_user_profiles' => array(
1882
        'classname' => 'core_user_external',
1883
        'methodname' => 'get_course_user_profiles',
1884
        'classpath' => 'user/externallib.php',
1885
        'description' => 'Get course user profiles (each of the profils matching a course id and a user id),.',
1886
        'type' => 'read',
1887
        'capabilities' => 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, '
1888
            . 'moodle/site:accessallgroups',
1889
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1890
    ),
1891
    'core_user_get_users' => array(
1892
        'classname' => 'core_user_external',
1893
        'methodname' => 'get_users',
1894
        'classpath' => 'user/externallib.php',
1895
        'description' => 'search for users matching the parameters',
1896
        'type' => 'read',
1897
        'capabilities' => 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update'
1898
    ),
1899
    'core_user_get_users_by_field' => array(
1900
        'classname' => 'core_user_external',
1901
        'methodname' => 'get_users_by_field',
1902
        'classpath' => 'user/externallib.php',
1903
        'description' => 'Retrieve users\' information for a specified unique field - If you want to do a user search, use '
1904
            . 'core_user_get_users() or core_user_search_identity().',
1905
        'type' => 'read',
1906
        'capabilities' => 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update',
1907
        'ajax' => true,
1908
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1909
    ),
1910
    'core_user_search_identity' => array(
1911
        'classname' => '\core_user\external\search_identity',
1912
        'description' => 'Return list of users identities matching the given criteria in their name or other identity fields.',
1913
        'type' => 'read',
1914
        'capabilities' => 'moodle/user:viewalldetails',
1915
        'ajax' => true,
1916
        'loginrequired' => true,
1917
    ),
1918
    'core_user_remove_user_device' => array(
1919
        'classname' => 'core_user_external',
1920
        'methodname' => 'remove_user_device',
1921
        'classpath' => 'user/externallib.php',
1922
        'description' => 'Remove a user device from the Moodle database.',
1923
        'type' => 'write',
1924
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1925
    ),
1926
    'core_user_update_users' => array(
1927
        'classname' => 'core_user_external',
1928
        'methodname' => 'update_users',
1929
        'classpath' => 'user/externallib.php',
1930
        'description' => 'Update users.',
1931
        'type' => 'write',
1932
        'capabilities' => 'moodle/user:update',
1933
        'ajax' => true,
1934
    ),
1935
    'core_user_update_user_preferences' => array(
1936
        'classname' => 'core_user_external',
1937
        'methodname' => 'update_user_preferences',
1938
        'classpath' => 'user/externallib.php',
1939
        'description' => 'Update a user\'s preferences',
1940
        'type' => 'write',
1941
        'capabilities' => 'moodle/user:editownmessageprofile, moodle/user:editmessageprofile',
1942
        'ajax' => true,
1943
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1944
    ),
1945
    'core_user_view_user_list' => array(
1946
        'classname' => 'core_user_external',
1947
        'methodname' => 'view_user_list',
1948
        'classpath' => 'user/externallib.php',
1949
        'description' => 'Simulates the web-interface view of user/index.php (triggering events),.',
1950
        'type' => 'write',
1951
        'capabilities' => 'moodle/course:viewparticipants',
1952
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1953
    ),
1954
    'core_user_view_user_profile' => array(
1955
        'classname' => 'core_user_external',
1956
        'methodname' => 'view_user_profile',
1957
        'classpath' => 'user/externallib.php',
1958
        'description' => 'Simulates the web-interface view of user/view.php and user/profile.php (triggering events),.',
1959
        'type' => 'write',
1960
        'capabilities' => 'moodle/user:viewdetails',
1961
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1962
    ),
1963
    'core_user_get_user_preferences' => array(
1964
        'classname' => 'core_user_external',
1965
        'methodname' => 'get_user_preferences',
1966
        'classpath' => 'user/externallib.php',
1967
        'description' => 'Return user preferences.',
1968
        'type' => 'read',
1969
        'ajax' => true,
1970
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1971
    ),
1972
    'core_user_update_picture' => array(
1973
        'classname' => 'core_user_external',
1974
        'methodname' => 'update_picture',
1975
        'classpath' => 'user/externallib.php',
1976
        'description' => 'Update or delete the user picture in the site',
1977
        'type' => 'write',
1978
        'capabilities' => 'moodle/user:editownprofile, moodle/user:editprofile',
1979
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1980
    ),
1981
    'core_user_set_user_preferences' => array(
1982
        'classname' => 'core_user_external',
1983
        'methodname' => 'set_user_preferences',
1984
        'classpath' => 'user/externallib.php',
1985
        'description' => 'Set user preferences.',
1986
        'type' => 'write',
1987
        'capabilities' => 'moodle/site:config',
1988
        'ajax' => true,
1989
        'loginrequired' => false,
1990
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1991
    ),
1992
    'core_user_agree_site_policy' => array(
1993
        'classname' => 'core_user_external',
1994
        'methodname' => 'agree_site_policy',
1995
        'classpath' => 'user/externallib.php',
1996
        'description' => 'Agree the site policy for the current user.',
1997
        'type' => 'write',
1998
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1999
    ),
2000
    'core_user_get_private_files_info' => array(
2001
        'classname' => 'core_user_external',
2002
        'methodname' => 'get_private_files_info',
2003
        'classpath' => 'user/externallib.php',
2004
        'description' => 'Returns general information about files in the user private files area.',
2005
        'type' => 'read',
2006
        'capabilities' => 'moodle/user:manageownfiles',
2007
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2008
    ),
2009
 
2010
    // Competencies functions.
2011
    'core_competency_create_competency_framework' => array(
2012
        'classname'    => 'core_competency\external',
2013
        'methodname'   => 'create_competency_framework',
2014
        'classpath'    => '',
2015
        'description'  => 'Creates new competency frameworks.',
2016
        'type'         => 'write',
2017
        'capabilities' => 'moodle/competency:competencymanage',
2018
        'ajax'         => true,
2019
    ),
2020
    'core_competency_read_competency_framework' => array(
2021
        'classname'    => 'core_competency\external',
2022
        'methodname'   => 'read_competency_framework',
2023
        'classpath'    => '',
2024
        'description'  => 'Load a summary of a competency framework.',
2025
        'type'         => 'read',
2026
        'capabilities' => 'moodle/competency:competencyview',
2027
        'ajax'         => true,
2028
    ),
2029
    'core_competency_duplicate_competency_framework' => array(
2030
        'classname'    => 'core_competency\external',
2031
        'methodname'   => 'duplicate_competency_framework',
2032
        'classpath'    => '',
2033
        'description'  => 'Duplicate a competency framework.',
2034
        'type'         => 'write',
2035
        'capabilities' => 'moodle/competency:competencymanage',
2036
        'ajax'         => true,
2037
    ),
2038
    'core_competency_delete_competency_framework' => array(
2039
        'classname'    => 'core_competency\external',
2040
        'methodname'   => 'delete_competency_framework',
2041
        'classpath'    => '',
2042
        'description'  => 'Delete a competency framework.',
2043
        'type'         => 'write',
2044
        'capabilities' => 'moodle/competency:competencymanage',
2045
        'ajax'         => true,
2046
    ),
2047
    'core_competency_update_competency_framework' => array(
2048
        'classname'    => 'core_competency\external',
2049
        'methodname'   => 'update_competency_framework',
2050
        'classpath'    => '',
2051
        'description'  => 'Update a competency framework.',
2052
        'type'         => 'write',
2053
        'capabilities' => 'moodle/competency:competencymanage',
2054
        'ajax'         => true,
2055
    ),
2056
    'core_competency_list_competency_frameworks' => array(
2057
        'classname'    => 'core_competency\external',
2058
        'methodname'   => 'list_competency_frameworks',
2059
        'classpath'    => '',
2060
        'description'  => 'Load a list of a competency frameworks.',
2061
        'type'         => 'read',
2062
        'capabilities' => 'moodle/competency:competencyview',
2063
        'ajax'         => true,
2064
    ),
2065
    'core_competency_count_competency_frameworks' => array(
2066
        'classname'    => 'core_competency\external',
2067
        'methodname'   => 'count_competency_frameworks',
2068
        'classpath'    => '',
2069
        'description'  => 'Count a list of a competency frameworks.',
2070
        'type'         => 'read',
2071
        'capabilities' => 'moodle/competency:competencyview',
2072
        'ajax'         => true,
2073
    ),
2074
    'core_competency_competency_framework_viewed' => array(
2075
        'classname'    => 'core_competency\external',
2076
        'methodname'   => 'competency_framework_viewed',
2077
        'classpath'    => '',
2078
        'description'  => 'Log event competency framework viewed',
2079
        'type'         => 'read',
2080
        'capabilities' => 'moodle/competency:competencyview',
2081
        'ajax'         => true,
2082
    ),
2083
    'core_competency_create_competency' => array(
2084
        'classname'    => 'core_competency\external',
2085
        'methodname'   => 'create_competency',
2086
        'classpath'    => '',
2087
        'description'  => 'Creates new competencies.',
2088
        'type'         => 'write',
2089
        'capabilities' => 'moodle/competency:competencymanage',
2090
        'ajax'         => true,
2091
    ),
2092
    'core_competency_read_competency' => array(
2093
        'classname'    => 'core_competency\external',
2094
        'methodname'   => 'read_competency',
2095
        'classpath'    => '',
2096
        'description'  => 'Load a summary of a competency.',
2097
        'type'         => 'read',
2098
        'capabilities' => 'moodle/competency:competencyview',
2099
        'ajax'         => true,
2100
    ),
2101
    'core_competency_competency_viewed' => array(
2102
        'classname'    => 'core_competency\external',
2103
        'methodname'   => 'competency_viewed',
2104
        'classpath'    => '',
2105
        'description'  => 'Log event competency viewed',
2106
        'type'         => 'read',
2107
        'capabilities' => 'moodle/competency:competencyview',
2108
        'ajax'         => true,
2109
        'services'     => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2110
    ),
2111
    'core_competency_delete_competency' => array(
2112
        'classname'    => 'core_competency\external',
2113
        'methodname'   => 'delete_competency',
2114
        'classpath'    => '',
2115
        'description'  => 'Delete a competency.',
2116
        'type'         => 'write',
2117
        'capabilities' => 'moodle/competency:competencymanage',
2118
        'ajax'         => true,
2119
    ),
2120
    'core_competency_update_competency' => array(
2121
        'classname'    => 'core_competency\external',
2122
        'methodname'   => 'update_competency',
2123
        'classpath'    => '',
2124
        'description'  => 'Update a competency.',
2125
        'type'         => 'write',
2126
        'capabilities' => 'moodle/competency:competencymanage',
2127
        'ajax'         => true,
2128
    ),
2129
    'core_competency_list_competencies' => array(
2130
        'classname'    => 'core_competency\external',
2131
        'methodname'   => 'list_competencies',
2132
        'classpath'    => '',
2133
        'description'  => 'Load a list of a competencies.',
2134
        'type'         => 'read',
2135
        'capabilities' => 'moodle/competency:competencyview',
2136
        'ajax'         => true,
2137
    ),
2138
    'core_competency_list_competencies_in_template' => array(
2139
        'classname'    => 'core_competency\external',
2140
        'methodname'   => 'list_competencies_in_template',
2141
        'classpath'    => '',
2142
        'description'  => 'Load a list of a competencies for a given template.',
2143
        'type'         => 'read',
2144
        'capabilities' => 'moodle/competency:competencyview',
2145
        'ajax'         => true,
2146
    ),
2147
    'core_competency_count_competencies' => array(
2148
        'classname'    => 'core_competency\external',
2149
        'methodname'   => 'count_competencies',
2150
        'classpath'    => '',
2151
        'description'  => 'Count a list of a competencies.',
2152
        'type'         => 'read',
2153
        'capabilities' => 'moodle/competency:competencyview',
2154
        'ajax'         => true,
2155
    ),
2156
    'core_competency_count_competencies_in_template' => array(
2157
        'classname'    => 'core_competency\external',
2158
        'methodname'   => 'count_competencies_in_template',
2159
        'classpath'    => '',
2160
        'description'  => 'Count a list of a competencies for a given template.',
2161
        'type'         => 'read',
2162
        'capabilities' => 'moodle/competency:competencyview',
2163
        'ajax'         => true,
2164
    ),
2165
    'core_competency_search_competencies' => array(
2166
        'classname'    => 'core_competency\external',
2167
        'methodname'   => 'search_competencies',
2168
        'classpath'    => '',
2169
        'description'  => 'Search a list of a competencies.',
2170
        'type'         => 'read',
2171
        'capabilities' => 'moodle/competency:competencyview',
2172
        'ajax'         => true,
2173
    ),
2174
    'core_competency_set_parent_competency' => array(
2175
        'classname'    => 'core_competency\external',
2176
        'methodname'   => 'set_parent_competency',
2177
        'classpath'    => '',
2178
        'description'  => 'Set a new parent for a competency.',
2179
        'type'         => 'write',
2180
        'capabilities' => 'moodle/competency:competencymanage',
2181
        'ajax'         => true,
2182
    ),
2183
    'core_competency_move_up_competency' => array(
2184
        'classname'    => 'core_competency\external',
2185
        'methodname'   => 'move_up_competency',
2186
        'classpath'    => '',
2187
        'description'  => 'Re-order a competency.',
2188
        'type'         => 'write',
2189
        'capabilities' => 'moodle/competency:competencymanage',
2190
        'ajax'         => true,
2191
    ),
2192
    'core_competency_move_down_competency' => array(
2193
        'classname'    => 'core_competency\external',
2194
        'methodname'   => 'move_down_competency',
2195
        'classpath'    => '',
2196
        'description'  => 'Re-order a competency.',
2197
        'type'         => 'write',
2198
        'capabilities' => 'moodle/competency:competencymanage',
2199
        'ajax'         => true,
2200
    ),
2201
    'core_competency_list_course_module_competencies' => array(
2202
        'classname'    => 'core_competency\external',
2203
        'methodname'   => 'list_course_module_competencies',
2204
        'classpath'    => '',
2205
        'description'  => 'List the competencies in a course module',
2206
        'type'         => 'read',
2207
        'capabilities' => 'moodle/competency:coursecompetencyview',
2208
        'ajax'         => true,
2209
    ),
2210
    'core_competency_count_course_module_competencies' => array(
2211
        'classname'    => 'core_competency\external',
2212
        'methodname'   => 'count_course_module_competencies',
2213
        'classpath'    => '',
2214
        'description'  => 'Count the competencies in a course module',
2215
        'type'         => 'read',
2216
        'capabilities' => 'moodle/competency:coursecompetencyview',
2217
        'ajax'         => true,
2218
    ),
2219
    'core_competency_list_course_competencies' => array(
2220
        'classname'    => 'core_competency\external',
2221
        'methodname'   => 'list_course_competencies',
2222
        'classpath'    => '',
2223
        'description'  => 'List the competencies in a course',
2224
        'type'         => 'read',
2225
        'capabilities' => 'moodle/competency:coursecompetencyview',
2226
        'ajax'         => true,
2227
        'services'     => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2228
    ),
2229
    'core_competency_count_competencies_in_course' => array(
2230
        'classname'    => 'core_competency\external',
2231
        'methodname'   => 'count_competencies_in_course',
2232
        'classpath'    => '',
2233
        'description'  => 'List the competencies in a course',
2234
        'type'         => 'read',
2235
        'capabilities' => 'moodle/competency:coursecompetencyview',
2236
        'ajax'         => true,
2237
    ),
2238
    'core_competency_count_courses_using_competency' => array(
2239
        'classname'    => 'core_competency\external',
2240
        'methodname'   => 'count_courses_using_competency',
2241
        'classpath'    => '',
2242
        'description'  => 'List the courses using a competency',
2243
        'type'         => 'read',
2244
        'capabilities' => 'moodle/competency:coursecompetencyview',
2245
        'ajax'         => true,
2246
    ),
2247
    'core_competency_add_competency_to_course' => array(
2248
        'classname'    => 'core_competency\external',
2249
        'methodname'   => 'add_competency_to_course',
2250
        'classpath'    => '',
2251
        'description'  => 'Add the competency to a course',
2252
        'type'         => 'write',
2253
        'capabilities' => 'moodle/competency:coursecompetencymanage',
2254
        'ajax'         => true,
2255
    ),
2256
    'core_competency_add_competency_to_template' => array(
2257
        'classname'    => 'core_competency\external',
2258
        'methodname'   => 'add_competency_to_template',
2259
        'classpath'    => '',
2260
        'description'  => 'Add the competency to a template',
2261
        'type'         => 'write',
2262
        'capabilities' => 'moodle/competency:templatemanage',
2263
        'ajax'         => true,
2264
    ),
2265
    'core_competency_remove_competency_from_course' => array(
2266
        'classname'    => 'core_competency\external',
2267
        'methodname'   => 'remove_competency_from_course',
2268
        'classpath'    => '',
2269
        'description'  => 'Remove a competency from a course',
2270
        'type'         => 'write',
2271
        'capabilities' => 'moodle/competency:coursecompetencymanage',
2272
        'ajax'         => true,
2273
    ),
2274
    'core_competency_set_course_competency_ruleoutcome' => array(
2275
        'classname'    => 'core_competency\external',
2276
        'methodname'   => 'set_course_competency_ruleoutcome',
2277
        'classpath'    => '',
2278
        'description'  => 'Modify the ruleoutcome value for course competency',
2279
        'type'         => 'write',
2280
        'capabilities' => 'moodle/competency:coursecompetencymanage',
2281
        'ajax'         => true,
2282
    ),
2283
    'core_competency_remove_competency_from_template' => array(
2284
        'classname'    => 'core_competency\external',
2285
        'methodname'   => 'remove_competency_from_template',
2286
        'classpath'    => '',
2287
        'description'  => 'Remove a competency from a template',
2288
        'type'         => 'write',
2289
        'capabilities' => 'moodle/competency:templatemanage',
2290
        'ajax'         => true,
2291
    ),
2292
    'core_competency_reorder_course_competency' => array(
2293
        'classname'    => 'core_competency\external',
2294
        'methodname'   => 'reorder_course_competency',
2295
        'classpath'    => '',
2296
        'description'  => 'Move a course competency to a new relative sort order.',
2297
        'type'         => 'write',
2298
        'capabilities' => 'moodle/competency:coursecompetencymanage',
2299
        'ajax'         => true,
2300
    ),
2301
    'core_competency_reorder_template_competency' => array(
2302
        'classname'    => 'core_competency\external',
2303
        'methodname'   => 'reorder_template_competency',
2304
        'classpath'    => '',
2305
        'description'  => 'Move a template competency to a new relative sort order.',
2306
        'type'         => 'write',
2307
        'capabilities' => 'moodle/competency:templatemanage',
2308
        'ajax'         => true,
2309
    ),
2310
    'core_competency_create_template' => array(
2311
        'classname'    => 'core_competency\external',
2312
        'methodname'   => 'create_template',
2313
        'classpath'    => '',
2314
        'description'  => 'Creates new learning plan templates.',
2315
        'type'         => 'write',
2316
        'capabilities' => 'moodle/competency:templatemanage',
2317
        'ajax'         => true,
2318
    ),
2319
    'core_competency_duplicate_template' => array(
2320
        'classname'    => 'core_competency\external',
2321
        'methodname'   => 'duplicate_template',
2322
        'classpath'    => '',
2323
        'description'  => 'Duplicate learning plan template.',
2324
        'type'         => 'write',
2325
        'capabilities' => 'moodle/competency:templatemanage',
2326
        'ajax'         => true,
2327
    ),
2328
    'core_competency_read_template' => array(
2329
        'classname'    => 'core_competency\external',
2330
        'methodname'   => 'read_template',
2331
        'classpath'    => '',
2332
        'description'  => 'Load a summary of a learning plan template.',
2333
        'type'         => 'read',
2334
        'capabilities' => 'moodle/competency:templateview',
2335
        'ajax'         => true,
2336
    ),
2337
    'core_competency_delete_template' => array(
2338
        'classname'    => 'core_competency\external',
2339
        'methodname'   => 'delete_template',
2340
        'classpath'    => '',
2341
        'description'  => 'Delete a learning plan template.',
2342
        'type'         => 'write',
2343
        'capabilities' => 'moodle/competency:templatemanage',
2344
        'ajax'         => true,
2345
    ),
2346
    'core_competency_update_template' => array(
2347
        'classname'    => 'core_competency\external',
2348
        'methodname'   => 'update_template',
2349
        'classpath'    => '',
2350
        'description'  => 'Update a learning plan template.',
2351
        'type'         => 'write',
2352
        'capabilities' => 'moodle/competency:templatemanage',
2353
        'ajax'         => true,
2354
    ),
2355
    'core_competency_list_templates' => array(
2356
        'classname'    => 'core_competency\external',
2357
        'methodname'   => 'list_templates',
2358
        'classpath'    => '',
2359
        'description'  => 'Load a list of a learning plan templates.',
2360
        'type'         => 'read',
2361
        'capabilities' => 'moodle/competency:templateview',
2362
        'ajax'         => true,
2363
    ),
2364
    'core_competency_list_templates_using_competency' => array(
2365
        'classname'    => 'core_competency\external',
2366
        'methodname'   => 'list_templates_using_competency',
2367
        'classpath'    => '',
2368
        'description'  => 'Load a list of a learning plan templates for a given competency.',
2369
        'type'         => 'read',
2370
        'capabilities' => 'moodle/competency:templateview',
2371
        'ajax'         => true,
2372
    ),
2373
    'core_competency_count_templates' => array(
2374
        'classname'    => 'core_competency\external',
2375
        'methodname'   => 'count_templates',
2376
        'classpath'    => '',
2377
        'description'  => 'Count a list of a learning plan templates.',
2378
        'type'         => 'read',
2379
        'capabilities' => 'moodle/competency:templateview',
2380
        'ajax'         => true,
2381
    ),
2382
    'core_competency_count_templates_using_competency' => array(
2383
        'classname'    => 'core_competency\external',
2384
        'methodname'   => 'count_templates_using_competency',
2385
        'classpath'    => '',
2386
        'description'  => 'Count a list of a learning plan templates for a given competency.',
2387
        'type'         => 'read',
2388
        'capabilities' => 'moodle/competency:templateview',
2389
        'ajax'         => true,
2390
    ),
2391
    'core_competency_create_plan' => array(
2392
        'classname'    => 'core_competency\external',
2393
        'methodname'   => 'create_plan',
2394
        'classpath'    => '',
2395
        'description'  => 'Creates a learning plan.',
2396
        'type'         => 'write',
2397
        'capabilities' => 'moodle/competency:planmanage',
2398
        'ajax'         => true,
2399
    ),
2400
    'core_competency_update_plan' => array(
2401
        'classname'    => 'core_competency\external',
2402
        'methodname'   => 'update_plan',
2403
        'classpath'    => '',
2404
        'description'  => 'Updates a learning plan.',
2405
        'type'         => 'write',
2406
        'capabilities' => 'moodle/competency:planmanage',
2407
        'ajax'         => true,
2408
    ),
2409
    'core_competency_complete_plan' => array(
2410
        'classname'    => 'core_competency\external',
2411
        'methodname'   => 'complete_plan',
2412
        'classpath'    => '',
2413
        'description'  => 'Complete learning plan.',
2414
        'type'         => 'write',
2415
        'capabilities' => 'moodle/competency:planmanage',
2416
        'ajax'         => true,
2417
    ),
2418
    'core_competency_reopen_plan' => array(
2419
        'classname'    => 'core_competency\external',
2420
        'methodname'   => 'reopen_plan',
2421
        'classpath'    => '',
2422
        'description'  => 'Reopen learning plan.',
2423
        'type'         => 'write',
2424
        'capabilities' => 'moodle/competency:planmanage',
2425
        'ajax'         => true,
2426
    ),
2427
    'core_competency_read_plan' => array(
2428
        'classname'    => 'core_competency\external',
2429
        'methodname'   => 'read_plan',
2430
        'classpath'    => '',
2431
        'description'  => 'Load a learning plan.',
2432
        'type'         => 'read',
2433
        'capabilities' => 'moodle/competency:planviewown',
2434
        'ajax'         => true,
2435
    ),
2436
    'core_competency_delete_plan' => array(
2437
        'classname'    => 'core_competency\external',
2438
        'methodname'   => 'delete_plan',
2439
        'classpath'    => '',
2440
        'description'  => 'Delete a learning plan.',
2441
        'type'         => 'write',
2442
        'capabilities' => 'moodle/competency:planmanage',
2443
        'ajax'         => true,
2444
    ),
2445
    'core_competency_list_user_plans' => array(
2446
        'classname'    => 'core_competency\external',
2447
        'methodname'   => 'list_user_plans',
2448
        'classpath'    => '',
2449
        'description'  => 'List a user\'s learning plans.',
2450
        'type'         => 'read',
2451
        'capabilities' => 'moodle/competency:planviewown',
2452
        'ajax'         => true,
2453
    ),
2454
    'core_competency_list_plan_competencies' => array(
2455
        'classname'    => 'core_competency\external',
2456
        'methodname'   => 'list_plan_competencies',
2457
        'classpath'    => '',
2458
        'description'  => 'List the competencies in a plan',
2459
        'type'         => 'read',
2460
        'capabilities' => 'moodle/competency:planviewown',
2461
        'ajax'         => true,
2462
    ),
2463
    'core_competency_add_competency_to_plan' => array(
2464
        'classname'    => 'core_competency\external',
2465
        'methodname'   => 'add_competency_to_plan',
2466
        'classpath'    => '',
2467
        'description'  => 'Add the competency to a learning plan',
2468
        'type'         => 'write',
2469
        'capabilities' => 'moodle/competency:planmanage',
2470
        'ajax'         => true,
2471
    ),
2472
    'core_competency_remove_competency_from_plan' => array(
2473
        'classname'    => 'core_competency\external',
2474
        'methodname'   => 'remove_competency_from_plan',
2475
        'classpath'    => '',
2476
        'description'  => 'Remove the competency from a learning plan',
2477
        'type'         => 'write',
2478
        'capabilities' => 'moodle/competency:planmanage',
2479
        'ajax'         => true,
2480
    ),
2481
    'core_competency_reorder_plan_competency' => array(
2482
        'classname'    => 'core_competency\external',
2483
        'methodname'   => 'reorder_plan_competency',
2484
        'classpath'    => '',
2485
        'description'  => 'Move a plan competency to a new relative sort order.',
2486
        'type'         => 'write',
2487
        'capabilities' => 'moodle/competency:planmanage',
2488
        'ajax'         => true,
2489
    ),
2490
    'core_competency_plan_request_review' => array(
2491
        'classname'    => 'core_competency\external',
2492
        'methodname'   => 'plan_request_review',
2493
        'classpath'    => '',
2494
        'description'  => 'Request for a plan to be reviewed.',
2495
        'type'         => 'write',
2496
        'capabilities' => 'moodle/competency:planmanagedraft',
2497
        'ajax'         => true,
2498
    ),
2499
    'core_competency_plan_start_review' => array(
2500
        'classname'    => 'core_competency\external',
2501
        'methodname'   => 'plan_start_review',
2502
        'classpath'    => '',
2503
        'description'  => 'Start the review of a plan.',
2504
        'type'         => 'write',
2505
        'capabilities' => 'moodle/competency:planmanage',
2506
        'ajax'         => true,
2507
    ),
2508
    'core_competency_plan_stop_review' => array(
2509
        'classname'    => 'core_competency\external',
2510
        'methodname'   => 'plan_stop_review',
2511
        'classpath'    => '',
2512
        'description'  => 'Stop the review of a plan.',
2513
        'type'         => 'write',
2514
        'capabilities' => 'moodle/competency:planmanage',
2515
        'ajax'         => true,
2516
    ),
2517
    'core_competency_plan_cancel_review_request' => array(
2518
        'classname'    => 'core_competency\external',
2519
        'methodname'   => 'plan_cancel_review_request',
2520
        'classpath'    => '',
2521
        'description'  => 'Cancel the review of a plan.',
2522
        'type'         => 'write',
2523
        'capabilities' => 'moodle/competency:planmanagedraft',
2524
        'ajax'         => true,
2525
    ),
2526
    'core_competency_approve_plan' => array(
2527
        'classname'    => 'core_competency\external',
2528
        'methodname'   => 'approve_plan',
2529
        'classpath'    => '',
2530
        'description'  => 'Approve a plan.',
2531
        'type'         => 'write',
2532
        'capabilities' => 'moodle/competency:planmanage',
2533
        'ajax'         => true,
2534
    ),
2535
    'core_competency_unapprove_plan' => array(
2536
        'classname'    => 'core_competency\external',
2537
        'methodname'   => 'unapprove_plan',
2538
        'classpath'    => '',
2539
        'description'  => 'Unapprove a plan.',
2540
        'type'         => 'write',
2541
        'capabilities' => 'moodle/competency:planmanage',
2542
        'ajax'         => true,
2543
    ),
2544
     'core_competency_template_has_related_data' => array(
2545
        'classname'    => 'core_competency\external',
2546
        'methodname'   => 'template_has_related_data',
2547
        'classpath'    => '',
2548
        'description'  => 'Check if a template has related data',
2549
        'type'         => 'read',
2550
        'capabilities' => 'moodle/competency:templateview',
2551
        'ajax'         => true,
2552
    ),
2553
    'core_competency_get_scale_values' => array(
2554
        'classname'    => 'core_competency\external',
2555
        'methodname'   => 'get_scale_values',
2556
        'classpath'    => '',
2557
        'description'  => 'Fetch the values for a specific scale',
2558
        'type'         => 'read',
2559
        'capabilities' => 'moodle/competency:competencymanage',
2560
        'ajax'         => true,
2561
        'services'     => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2562
    ),
2563
    'core_competency_add_related_competency' => array(
2564
        'classname'    => 'core_competency\external',
2565
        'methodname'   => 'add_related_competency',
2566
        'classpath'    => '',
2567
        'description'  => 'Adds a related competency',
2568
        'type'         => 'write',
2569
        'capabilities' => 'moodle/competency:competencymanage',
2570
        'ajax'         => true,
2571
    ),
2572
    'core_competency_remove_related_competency' => array(
2573
        'classname'    => 'core_competency\external',
2574
        'methodname'   => 'remove_related_competency',
2575
        'classpath'    => '',
2576
        'description'  => 'Remove a related competency',
2577
        'type'         => 'write',
2578
        'capabilities' => 'moodle/competency:competencymanage',
2579
        'ajax'         => true,
2580
    ),
2581
    'core_competency_read_user_evidence' => array(
2582
        'classname'    => 'core_competency\external',
2583
        'methodname'   => 'read_user_evidence',
2584
        'classpath'    => '',
2585
        'description'  => 'Read an evidence of prior learning.',
2586
        'type'         => 'read',
2587
        'capabilities' => 'moodle/competency:userevidenceview',
2588
        'ajax'         => true,
2589
    ),
2590
    'core_competency_delete_user_evidence' => array(
2591
        'classname'    => 'core_competency\external',
2592
        'methodname'   => 'delete_user_evidence',
2593
        'classpath'    => '',
2594
        'description'  => 'Delete an evidence of prior learning.',
2595
        'type'         => 'write',
2596
        'capabilities' => 'moodle/competency:userevidencemanageown',
2597
        'ajax'         => true,
2598
    ),
2599
    'core_competency_create_user_evidence_competency' => array(
2600
        'classname'    => 'core_competency\external',
2601
        'methodname'   => 'create_user_evidence_competency',
2602
        'classpath'    => '',
2603
        'description'  => 'Create an evidence of prior learning relationship with a competency.',
2604
        'type'         => 'read',
2605
        'capabilities' => 'moodle/competency:userevidencemanageown, moodle/competency:competencyview',
2606
        'ajax'         => true,
2607
    ),
2608
    'core_competency_delete_user_evidence_competency' => array(
2609
        'classname'    => 'core_competency\external',
2610
        'methodname'   => 'delete_user_evidence_competency',
2611
        'classpath'    => '',
2612
        'description'  => 'Delete an evidence of prior learning relationship with a competency.',
2613
        'type'         => 'write',
2614
        'capabilities' => 'moodle/competency:userevidencemanageown',
2615
        'ajax'         => true,
2616
    ),
2617
    'core_competency_user_competency_cancel_review_request' => array(
2618
        'classname'    => 'core_competency\external',
2619
        'methodname'   => 'user_competency_cancel_review_request',
2620
        'classpath'    => '',
2621
        'description'  => 'Cancel a review request.',
2622
        'type'         => 'write',
2623
        'capabilities' => 'moodle/competency:userevidencemanageown',
2624
        'ajax'         => true,
2625
    ),
2626
    'core_competency_user_competency_request_review' => array(
2627
        'classname'    => 'core_competency\external',
2628
        'methodname'   => 'user_competency_request_review',
2629
        'classpath'    => '',
2630
        'description'  => 'Request a review.',
2631
        'type'         => 'write',
2632
        'capabilities' => 'moodle/competency:userevidencemanageown',
2633
        'ajax'         => true,
2634
    ),
2635
    'core_competency_user_competency_start_review' => array(
2636
        'classname'    => 'core_competency\external',
2637
        'methodname'   => 'user_competency_start_review',
2638
        'classpath'    => '',
2639
        'description'  => 'Start a review.',
2640
        'type'         => 'write',
2641
        'capabilities' => 'moodle/competency:competencygrade',
2642
        'ajax'         => true,
2643
    ),
2644
    'core_competency_user_competency_stop_review' => array(
2645
        'classname'    => 'core_competency\external',
2646
        'methodname'   => 'user_competency_stop_review',
2647
        'classpath'    => '',
2648
        'description'  => 'Stop a review.',
2649
        'type'         => 'write',
2650
        'capabilities' => 'moodle/competency:competencygrade',
2651
        'ajax'         => true,
2652
    ),
2653
    'core_competency_user_competency_viewed' => array(
2654
        'classname'    => 'core_competency\external',
2655
        'methodname'   => 'user_competency_viewed',
2656
        'classpath'    => '',
2657
        'description'  => 'Log the user competency viewed event.',
2658
        'type'         => 'read',
2659
        'capabilities' => 'moodle/competency:usercompetencyview',
2660
        'ajax'         => true,
2661
        'services'     => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2662
    ),
2663
    'core_competency_user_competency_viewed_in_plan' => array(
2664
        'classname'    => 'core_competency\external',
2665
        'methodname'   => 'user_competency_viewed_in_plan',
2666
        'classpath'    => '',
2667
        'description'  => 'Log the user competency viewed in plan event.',
2668
        'type'         => 'read',
2669
        'capabilities' => 'moodle/competency:usercompetencyview',
2670
        'ajax'         => true,
2671
        'services'     => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2672
    ),
2673
    'core_competency_user_competency_viewed_in_course' => array(
2674
        'classname'    => 'core_competency\external',
2675
        'methodname'   => 'user_competency_viewed_in_course',
2676
        'classpath'    => '',
2677
        'description'  => 'Log the user competency viewed in course event',
2678
        'type'         => 'read',
2679
        'capabilities' => 'moodle/competency:usercompetencyview',
2680
        'ajax'         => true,
2681
        'services'     => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2682
    ),
2683
    'core_competency_user_competency_plan_viewed' => array(
2684
        'classname'    => 'core_competency\external',
2685
        'methodname'   => 'user_competency_plan_viewed',
2686
        'classpath'    => '',
2687
        'description'  => 'Log the user competency plan viewed event.',
2688
        'type'         => 'read',
2689
        'capabilities' => 'moodle/competency:usercompetencyview',
2690
        'ajax'         => true,
2691
        'services'     => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2692
    ),
2693
    'core_competency_grade_competency' => array(
2694
        'classname'    => 'core_competency\external',
2695
        'methodname'   => 'grade_competency',
2696
        'classpath'    => '',
2697
        'description'  => 'Grade a competency.',
2698
        'type'         => 'write',
2699
        'capabilities' => 'moodle/competency:competencygrade',
2700
        'ajax'         => true,
2701
    ),
2702
    'core_competency_grade_competency_in_plan' => array(
2703
        'classname'    => 'core_competency\external',
2704
        'methodname'   => 'grade_competency_in_plan',
2705
        'classpath'    => '',
2706
        'description'  => 'Grade a competency from the user plan page.',
2707
        'type'         => 'write',
2708
        'capabilities' => 'moodle/competency:competencygrade',
2709
        'ajax'         => true,
2710
    ),
2711
    'core_competency_grade_competency_in_course' => array(
2712
        'classname'    => 'core_competency\external',
2713
        'methodname'   => 'grade_competency_in_course',
2714
        'classpath'    => '',
2715
        'description'  => 'Grade a competency from the course page.',
2716
        'type'         => 'write',
2717
        'capabilities' => 'moodle/competency:competencygrade',
2718
        'ajax'         => true,
2719
        'services'     => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2720
    ),
2721
    'core_competency_unlink_plan_from_template' => array(
2722
        'classname'    => 'core_competency\external',
2723
        'methodname'   => 'unlink_plan_from_template',
2724
        'classpath'    => '',
2725
        'description'  => 'Unlink a plan form it template.',
2726
        'type'         => 'write',
2727
        'capabilities' => 'moodle/competency:planmanage',
2728
        'ajax'         => true,
2729
    ),
2730
    'core_competency_template_viewed' => array(
2731
        'classname'     => 'core_competency\external',
2732
        'methodname'    => 'template_viewed',
2733
        'classpath'     => '',
2734
        'description'   => 'Log event template viewed',
2735
        'type'          => 'read',
2736
        'capabilities'  => 'moodle/competency:templateview',
2737
        'ajax'          => true,
2738
    ),
2739
    'core_competency_request_review_of_user_evidence_linked_competencies' => array(
2740
        'classname'     => 'core_competency\external',
2741
        'methodname'    => 'request_review_of_user_evidence_linked_competencies',
2742
        'classpath'     => '',
2743
        'description'   => 'Send user evidence competencies in review',
2744
        'type'          => 'write',
2745
        'capabilities'  => 'moodle/competency:userevidencemanageown',
2746
        'ajax'          => true,
2747
    ),
2748
    'core_competency_update_course_competency_settings' => array(
2749
        'classname'     => 'core_competency\external',
2750
        'methodname'    => 'update_course_competency_settings',
2751
        'classpath'     => '',
2752
        'description'   => 'Update the course competency settings',
2753
        'type'          => 'write',
2754
        'capabilities'  => 'moodle/competency:coursecompetencyconfigure',
2755
        'ajax'          => true,
2756
    ),
2757
    'core_competency_delete_evidence' => array(
2758
        'classname'     => 'core_competency\external',
2759
        'methodname'    => 'delete_evidence',
2760
        'classpath'     => '',
2761
        'description'   => 'Delete an evidence',
2762
        'type'          => 'write',
2763
        'capabilities'  => 'moodle/competency:evidencedelete',
2764
        'ajax'          => true,
2765
        'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2766
    ),
2767
 
2768
    'core_webservice_get_site_info' => array(
2769
        'classname' => 'core_webservice_external',
2770
        'methodname' => 'get_site_info',
2771
        'classpath' => 'webservice/externallib.php',
2772
        'description' => 'Return some site info / user info / list web service functions',
2773
        'type' => 'read',
2774
        'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2775
    ),
2776
 
2777
    // Blocks functions.
2778
    'core_block_get_course_blocks' => array(
2779
        'classname'     => 'core_block_external',
2780
        'methodname'    => 'get_course_blocks',
2781
        'description'   => 'Returns blocks information for a course.',
2782
        'type'          => 'read',
2783
        'capabilities'  => '',
2784
        'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2785
    ),
2786
 
2787
    'core_block_get_dashboard_blocks' => array(
2788
        'classname'     => 'core_block_external',
2789
        'methodname'    => 'get_dashboard_blocks',
2790
        'description'   => 'Returns blocks information for the given user dashboard.',
2791
        'type'          => 'read',
2792
        'capabilities'  => '',
2793
        'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2794
    ),
2795
 
2796
    'core_block_fetch_addable_blocks' => array(
2797
        'classname'     => 'core_block\external\fetch_addable_blocks',
2798
        'description'   => 'Returns all addable blocks in a given page.',
2799
        'type'          => 'read',
2800
        'capabilities'  => 'moodle/site:manageblocks',
2801
        'ajax'          => true,
2802
        'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2803
    ),
2804
 
2805
    // Filters functions.
2806
    'core_filters_get_available_in_context' => array(
2807
        'classname'   => 'core_filters\external',
2808
        'methodname'  => 'get_available_in_context',
2809
        'description' => 'Returns the filters available in the given contexts.',
2810
        'type'        => 'read',
2811
        'services'    => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2812
    ),
2813
    'core_filters_get_all_states' => [
2814
        'classname'   => 'core_filters\external\get_all_states',
2815
        'description' => 'Retrieve all the filters and their states (including overridden ones in any context).',
2816
        'type'        => 'read',
2817
        'services'    => [MOODLE_OFFICIAL_MOBILE_SERVICE],
2818
    ],
2819
 
2820
    'core_customfield_delete_field' => array(
2821
        'classname'   => 'core_customfield_external',
2822
        'methodname'  => 'delete_field',
2823
        'classpath'   => 'customfield/externallib.php',
2824
        'description' => 'Deletes an entry',
2825
        'type'        => 'write',
2826
        'ajax'        => true,
2827
    ),
2828
    'core_customfield_reload_template' => array(
2829
        'classname'   => 'core_customfield_external',
2830
        'methodname'  => 'reload_template',
2831
        'classpath'   => 'customfield/externallib.php',
2832
        'description' => 'Reloads template',
2833
        'type'        => 'read',
2834
        'ajax'        => true,
2835
    ),
2836
    'core_customfield_create_category' => array(
2837
        'classname'   => 'core_customfield_external',
2838
        'methodname'  => 'create_category',
2839
        'classpath'   => 'customfield/externallib.php',
2840
        'description' => 'Creates a new category',
2841
        'type'        => 'write',
2842
        'ajax'        => true,
2843
    ),
2844
    'core_customfield_delete_category' => array(
2845
        'classname'   => 'core_customfield_external',
2846
        'methodname'  => 'delete_category',
2847
        'classpath'   => 'customfield/externallib.php',
2848
        'description' => 'Deletes a category',
2849
        'type'        => 'write',
2850
        'ajax'        => true,
2851
    ),
2852
    'core_customfield_move_field'   => array(
2853
        'classname'   => 'core_customfield_external',
2854
        'methodname'  => 'move_field',
2855
        'classpath'   => 'customfield/externallib.php',
2856
        'description' => 'Drag and drop',
2857
        'type'        => 'write',
2858
        'ajax'        => true,
2859
    ),
2860
    'core_customfield_move_category' => array(
2861
        'classname'   => 'core_customfield_external',
2862
        'methodname'  => 'move_category',
2863
        'classpath'   => 'customfield/externallib.php',
2864
        'description' => 'Drag and drop categories',
2865
        'type'        => 'write',
2866
        'ajax'        => true,
2867
    ),
2868
    'core_h5p_get_trusted_h5p_file' => [
2869
        'classname'     => 'core_h5p\external',
2870
        'methodname'    => 'get_trusted_h5p_file',
2871
        'classpath'     => '',
2872
        'description'   => 'Get the H5P file cleaned for Mobile App.',
2873
        'type'          => 'read',
2874
        'ajax'          => true,
2875
        'capabilities'  => '',
2876
        'services'      => [MOODLE_OFFICIAL_MOBILE_SERVICE],
2877
    ],
2878
    'core_table_get_dynamic_table_content' => [
2879
        'classname' => 'core_table\external\dynamic\get',
2880
        'description' => 'Get the dynamic table content raw html',
2881
        'type' => 'read',
2882
        'ajax' => true,
2883
        'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
2884
    ],
2885
    'core_xapi_statement_post' => [
2886
        'classname'     => 'core_xapi\external\post_statement',
2887
        'classpath'     => '',
2888
        'description'   => 'Post an xAPI statement.',
2889
        'type'          => 'write',
2890
        'ajax'          => true,
2891
        'capabilities'  => '',
2892
        'services'      => [MOODLE_OFFICIAL_MOBILE_SERVICE],
2893
    ],
2894
    'core_xapi_post_state' => [
2895
        'classname' => 'core_xapi\external\post_state',
2896
        'classpath' => '',
2897
        'description' => 'Post an xAPI state into an activityId.',
2898
        'type' => 'write',
2899
        'ajax' => true,
2900
        'capabilities' => '',
2901
        'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
2902
    ],
2903
    'core_xapi_get_state' => [
2904
        'classname' => 'core_xapi\external\get_state',
2905
        'classpath' => '',
2906
        'description' => 'Get an xAPI state data from an activityId.',
2907
        'type' => 'read',
2908
        'ajax' => true,
2909
        'capabilities' => '',
2910
        'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
2911
    ],
2912
    'core_xapi_get_states' => [
2913
        'classname' => 'core_xapi\external\get_states',
2914
        'description' => 'Get all state ID from an activityId.',
2915
        'type' => 'read',
2916
        'ajax' => true,
2917
        'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
2918
    ],
2919
    'core_xapi_delete_state' => [
2920
        'classname' => 'core_xapi\external\delete_state',
2921
        'classpath' => '',
2922
        'description' => 'Delete an xAPI state data from an activityId.',
2923
        'type' => 'write',
2924
        'ajax' => true,
2925
        'capabilities' => '',
2926
        'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
2927
    ],
2928
    'core_xapi_delete_states' => [
2929
        'classname' => 'core_xapi\external\delete_states',
2930
        'description' => 'Delete all xAPI state data from an activityId.',
2931
        'type' => 'write',
2932
        'ajax' => true,
2933
        'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
2934
    ],
2935
    'core_contentbank_delete_content' => [
2936
        'classname'     => 'core_contentbank\external\delete_content',
2937
        'classpath'     => '',
2938
        'description'   => 'Delete a content from the content bank.',
2939
        'type'          => 'write',
2940
        'ajax'          => true,
2941
        'capabilities'  => 'moodle/contentbank:deleteanycontent',
2942
    ],
2943
    'core_contentbank_rename_content' => [
2944
        'classname'     => 'core_contentbank\external\rename_content',
2945
        'classpath'     => '',
2946
        'description'   => 'Rename a content in the content bank.',
2947
        'type'          => 'write',
2948
        'ajax'          => true,
2949
        'capabilities'  => 'moodle/contentbank:manageowncontent',
2950
    ],
2951
    'core_contentbank_copy_content' => [
2952
        'classname'     => 'core_contentbank\external\copy_content',
2953
        'classpath'     => '',
2954
        'description'   => 'Copy a content in the content bank.',
2955
        'type'          => 'write',
2956
        'ajax'          => 'true',
2957
        'capabilities'  => 'moodle/contentbank:copycontent, moodle/contentbank:copyanycontent',
2958
    ],
2959
    'core_contentbank_set_content_visibility' => [
2960
        'classname'     => 'core_contentbank\external\set_content_visibility',
2961
        'classpath'     => '',
2962
        'description'   => 'Set the visibility of a content in the content bank.',
2963
        'type'          => 'write',
2964
        'ajax'          => true,
2965
        'capabilities'  => 'moodle/contentbank:manageowncontent',
2966
    ],
2967
    'core_create_userfeedback_action_record' => [
2968
        'classname'     => 'core\external\record_userfeedback_action',
2969
        'classpath'     => '',
2970
        'description'   => 'Record the action that the user takes in the user feedback notification for future use.',
2971
        'type'          => 'write',
2972
        'ajax'          => true,
2973
        'capabilities'  => '',
2974
    ],
2975
    'core_payment_get_available_gateways' => [
2976
        'classname'   => 'core_payment\external\get_available_gateways',
2977
        'description' => 'Get the list of payment gateways that support the given component/area',
2978
        'type'        => 'read',
2979
        'ajax'        => true,
2980
    ],
2981
    'core_reportbuilder_filters_reset' => [
2982
        'classname'   => 'core_reportbuilder\external\filters\reset',
2983
        'description' => 'Reset filters for given report',
2984
        'type'        => 'write',
2985
        'ajax'        => true,
2986
    ],
2987
    'core_reportbuilder_set_filters' => [
2988
        'classname'   => 'core_reportbuilder\external\filters\set',
2989
        'description' => 'Set filter values for given report',
2990
        'type'        => 'write',
2991
        'ajax'        => true,
2992
    ],
2993
    'core_dynamic_tabs_get_content' => [
2994
        'classname'   => 'core\external\dynamic_tabs_get_content',
2995
        'description' => 'Returns the content for a dynamic tab',
2996
        'type'        => 'read',
2997
        'ajax'        => true,
2998
    ],
2999
    'core_change_editmode' => [
3000
        'classname'   => 'core\external\editmode',
3001
        'methodname'   => 'change_editmode',
3002
        'description' => 'Change the editing mode',
3003
        'type'        => 'write',
3004
        'ajax'        => true,
3005
    ],
3006
    'core_reportbuilder_reports_delete' => [
3007
        'classname'   => 'core_reportbuilder\external\reports\delete',
3008
        'description' => 'Delete report',
3009
        'type'        => 'write',
3010
        'ajax'        => true,
3011
    ],
3012
    'core_reportbuilder_reports_get' => [
3013
        'classname'   => 'core_reportbuilder\external\reports\get',
3014
        'description' => 'Get custom report',
3015
        'type'        => 'read',
3016
        'ajax'        => true,
3017
    ],
3018
    'core_reportbuilder_list_reports' => [
3019
        'classname'   => 'core_reportbuilder\external\reports\listing',
3020
        'description' => 'List custom reports for current user',
3021
        'type'        => 'read',
3022
        'services'    => [MOODLE_OFFICIAL_MOBILE_SERVICE],
3023
    ],
3024
    'core_reportbuilder_retrieve_report' => [
3025
        'classname'   => 'core_reportbuilder\external\reports\retrieve',
3026
        'description' => 'Retrieve custom report content',
3027
        'type'        => 'read',
3028
        'services'    => [MOODLE_OFFICIAL_MOBILE_SERVICE],
3029
    ],
3030
    'core_reportbuilder_retrieve_system_report' => [
3031
        'classname'   => 'core_reportbuilder\external\systemreports\retrieve',
3032
        'description' => 'Retrieve system report content',
3033
        'type'        => 'read',
3034
        'services'    => [MOODLE_OFFICIAL_MOBILE_SERVICE],
3035
    ],
3036
    'core_reportbuilder_can_view_system_report' => [
3037
        'classname'   => 'core_reportbuilder\external\systemreports\can_view',
3038
        'description' => 'Determine access to a system report',
3039
        'type'        => 'read',
3040
        'services'    => [MOODLE_OFFICIAL_MOBILE_SERVICE],
3041
    ],
3042
    'core_reportbuilder_view_report' => [
3043
        'classname'   => 'core_reportbuilder\external\reports\view',
3044
        'description' => 'Trigger custom report viewed',
3045
        'type'        => 'write',
3046
        'services'    => [MOODLE_OFFICIAL_MOBILE_SERVICE],
3047
    ],
3048
    'core_reportbuilder_columns_add' => [
3049
        'classname'   => 'core_reportbuilder\external\columns\add',
3050
        'description' => 'Add column to report',
3051
        'type'        => 'write',
3052
        'ajax'        => true,
3053
    ],
3054
    'core_reportbuilder_columns_delete' => [
3055
        'classname'   => 'core_reportbuilder\external\columns\delete',
3056
        'description' => 'Delete column from report',
3057
        'type'        => 'write',
3058
        'ajax'        => true,
3059
    ],
3060
    'core_reportbuilder_columns_reorder' => [
3061
        'classname'   => 'core_reportbuilder\external\columns\reorder',
3062
        'description' => 'Re-order column within report',
3063
        'type'        => 'write',
3064
        'ajax'        => true,
3065
    ],
3066
    'core_reportbuilder_columns_sort_get' => [
3067
        'classname'   => 'core_reportbuilder\external\columns\sort\get',
3068
        'description' => 'Retrieve column sorting for report',
3069
        'type'        => 'read',
3070
        'ajax'        => true,
3071
    ],
3072
    'core_reportbuilder_columns_sort_reorder' => [
3073
        'classname'   => 'core_reportbuilder\external\columns\sort\reorder',
3074
        'description' => 'Re-order column sorting within report',
3075
        'type'        => 'write',
3076
        'ajax'        => true,
3077
    ],
3078
    'core_reportbuilder_columns_sort_toggle' => [
3079
        'classname'   => 'core_reportbuilder\external\columns\sort\toggle',
3080
        'description' => 'Toggle sorting of column within report',
3081
        'type'        => 'write',
3082
        'ajax'        => true,
3083
    ],
3084
    'core_reportbuilder_conditions_add' => [
3085
        'classname'   => 'core_reportbuilder\external\conditions\add',
3086
        'description' => 'Add condition to report',
3087
        'type'        => 'write',
3088
        'ajax'        => true,
3089
    ],
3090
    'core_reportbuilder_conditions_delete' => [
3091
        'classname'   => 'core_reportbuilder\external\conditions\delete',
3092
        'description' => 'Delete condition from report',
3093
        'type'        => 'write',
3094
        'ajax'        => true,
3095
    ],
3096
    'core_reportbuilder_conditions_reorder' => [
3097
        'classname'   => 'core_reportbuilder\external\conditions\reorder',
3098
        'description' => 'Re-order condition within report',
3099
        'type'        => 'write',
3100
        'ajax'        => true,
3101
    ],
3102
    'core_reportbuilder_conditions_reset' => [
3103
        'classname'   => 'core_reportbuilder\external\conditions\reset',
3104
        'description' => 'Reset conditions for given report',
3105
        'type'        => 'write',
3106
        'ajax'        => true,
3107
    ],
3108
    'core_reportbuilder_filters_add' => [
3109
        'classname'   => 'core_reportbuilder\external\filters\add',
3110
        'description' => 'Add filter to report',
3111
        'type'        => 'write',
3112
        'ajax'        => true,
3113
    ],
3114
    'core_reportbuilder_filters_delete' => [
3115
        'classname'   => 'core_reportbuilder\external\filters\delete',
3116
        'description' => 'Delete filter from report',
3117
        'type'        => 'write',
3118
        'ajax'        => true,
3119
    ],
3120
    'core_reportbuilder_filters_reorder' => [
3121
        'classname'   => 'core_reportbuilder\external\filters\reorder',
3122
        'description' => 'Re-order filter within report',
3123
        'type'        => 'write',
3124
        'ajax'        => true,
3125
    ],
3126
    'core_reportbuilder_audiences_delete' => [
3127
        'classname'   => 'core_reportbuilder\external\audiences\delete',
3128
        'description' => 'Delete audience from report',
3129
        'type'        => 'write',
3130
        'ajax'        => true,
3131
    ],
3132
    'core_reportbuilder_schedules_delete' => [
3133
        'classname'   => 'core_reportbuilder\external\schedules\delete',
3134
        'description' => 'Delete schedule from report',
3135
        'type'        => 'write',
3136
        'ajax'        => true,
3137
    ],
3138
    'core_reportbuilder_schedules_send' => [
3139
        'classname'   => 'core_reportbuilder\external\schedules\send',
3140
        'description' => 'Send report schedule',
3141
        'type'        => 'write',
3142
        'ajax'        => true,
3143
    ],
3144
    'core_reportbuilder_schedules_toggle' => [
3145
        'classname'   => 'core_reportbuilder\external\schedules\toggle',
3146
        'description' => 'Toggle state of report schedule',
3147
        'type'        => 'write',
3148
        'ajax'        => true,
3149
    ],
3150
    'core_admin_set_plugin_state' => [
3151
        'classname' => 'core_admin\external\set_plugin_state',
3152
        'description' => 'Set the state of a plugin',
3153
        'type' => 'write',
3154
        'ajax' => true,
3155
    ],
3156
    'core_admin_set_plugin_order' => [
3157
        'classname' => 'core_admin\external\set_plugin_order',
3158
        'description' => 'Set the order of a plugin',
3159
        'type' => 'write',
3160
        'ajax' => true,
3161
    ],
3162
    'core_admin_set_block_protection' => [
3163
        'classname' => 'core_admin\external\set_block_protection',
3164
        'description' => 'Set the protection state for a block plugin',
3165
        'type' => 'write',
3166
        'ajax' => true,
3167
    ],
3168
    'core_moodlenet_send_activity' => [
3169
        'classname'   => 'core\external\moodlenet_send_activity',
3170
        'description' => 'Send activity to MoodleNet',
3171
        'type'        => 'read',
3172
        'ajax'        => true,
3173
    ],
3174
    'core_moodlenet_get_share_info_activity' => [
3175
        'classname'   => 'core\external\moodlenet_get_share_info_activity',
3176
        'description' => 'Get information about an activity being shared',
3177
        'type'        => 'read',
3178
        'ajax'        => true,
3179
    ],
3180
    'core_moodlenet_auth_check' => [
3181
        'classname'   => 'core\external\moodlenet_auth_check',
3182
        'description' => 'Check a user has authorized for a given MoodleNet site',
3183
        'type'        => 'write',
3184
        'ajax'        => true,
3185
    ],
3186
    'core_moodlenet_get_shared_course_info' => [
3187
        'classname'   => 'core\external\moodlenet_get_shared_course_info',
3188
        'description' => 'Get information about an course being shared',
3189
        'type'        => 'read',
3190
        'ajax'        => true,
3191
    ],
3192
    'core_moodlenet_send_course' => [
3193
        'classname'   => 'core\external\moodlenet_send_course',
3194
        'description' => 'Send course to MoodleNet',
3195
        'type'        => 'read',
3196
        'ajax'        => true,
3197
    ],
3198
);
3199
 
3200
$services = array(
3201
   'Moodle mobile web service'  => array(
3202
        'functions' => array(), // Unused as we add the service in each function definition, third party services would use this.
3203
        'enabled' => 0,
3204
        'restrictedusers' => 0,
3205
        'shortname' => MOODLE_OFFICIAL_MOBILE_SERVICE,
3206
        'downloadfiles' => 1,
3207
        'uploadfiles' => 1
3208
    ),
3209
);