Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.
   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   * SCORM external functions and service definitions.
  19   *
  20   * @package    mod_scorm
  21   * @category   external
  22   * @copyright  2015 Juan Leyva <juan@moodle.com>
  23   * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  24   * @since      Moodle 3.0
  25   */
  26  
  27  $functions = array(
  28  
  29      'mod_scorm_view_scorm' => array(
  30          'classname'     => 'mod_scorm_external',
  31          'methodname'    => 'view_scorm',
  32          'description'   => 'Trigger the course module viewed event.',
  33          'type'          => 'write',
  34          'capabilities'  => '',
  35          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
  36      ),
  37  
  38      'mod_scorm_get_scorm_attempt_count' => array(
  39          'classname'     => 'mod_scorm_external',
  40          'methodname'    => 'get_scorm_attempt_count',
  41          'description'   => 'Return the number of attempts done by a user in the given SCORM.',
  42          'type'          => 'read',
  43          'capabilities'  => '',
  44          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
  45      ),
  46  
  47      'mod_scorm_get_scorm_scoes' => array(
  48          'classname' => 'mod_scorm_external',
  49          'methodname' => 'get_scorm_scoes',
  50          'description' => 'Returns a list containing all the scoes data related to the given scorm id',
  51          'type' => 'read',
  52          'capabilities' => '',
  53          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
  54      ),
  55  
  56      'mod_scorm_get_scorm_user_data' => array(
  57          'classname' => 'mod_scorm_external',
  58          'methodname' => 'get_scorm_user_data',
  59          'description' => 'Retrieves user tracking and SCO data and default SCORM values',
  60          'type' => 'read',
  61          'capabilities' => '',
  62          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
  63      ),
  64  
  65      'mod_scorm_insert_scorm_tracks' => array(
  66          'classname' => 'mod_scorm_external',
  67          'methodname' => 'insert_scorm_tracks',
  68          'description' => 'Saves a scorm tracking record.
  69                            It will overwrite any existing tracking data for this attempt.
  70                            Validation should be performed before running the function to ensure the user will not lose any existing
  71                            attempt data.',
  72          'type' => 'write',
  73          'capabilities' => 'mod/scorm:savetrack',
  74          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
  75      ),
  76  
  77      'mod_scorm_get_scorm_sco_tracks' => array(
  78          'classname' => 'mod_scorm_external',
  79          'methodname' => 'get_scorm_sco_tracks',
  80          'description' => 'Retrieves SCO tracking data for the given user id and attempt number',
  81          'type' => 'read',
  82          'capabilities' => '',
  83          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
  84      ),
  85  
  86      'mod_scorm_get_scorms_by_courses' => array(
  87          'classname'     => 'mod_scorm_external',
  88          'methodname'    => 'get_scorms_by_courses',
  89          'description'   => 'Returns a list of scorm instances in a provided set of courses, if
  90                              no courses are provided then all the scorm instances the user has access to will be returned.',
  91          'type'          => 'read',
  92          'capabilities'  => '',
  93          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
  94      ),
  95  
  96      'mod_scorm_launch_sco' => array(
  97          'classname'     => 'mod_scorm_external',
  98          'methodname'    => 'launch_sco',
  99          'description'   => 'Trigger the SCO launched event.',
 100          'type'          => 'write',
 101          'capabilities'  => '',
 102          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
 103      ),
 104  
 105      'mod_scorm_get_scorm_access_information' => array(
 106          'classname'     => 'mod_scorm_external',
 107          'methodname'    => 'get_scorm_access_information',
 108          'description'   => 'Return capabilities information for a given scorm.',
 109          'type'          => 'read',
 110          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 111      ),
 112  );