Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

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