Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 310 and 402] [Versions 39 and 402]

   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   * H5P activity external functions and service definitions.
  19   *
  20   * @package    mod_h5pactivity
  21   * @since      Moodle 3.9
  22   * @copyright  2020 Carlos Escobedo <carlos@moodle.com>
  23   * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  24   */
  25  
  26  defined('MOODLE_INTERNAL') || die;
  27  
  28  $functions = [
  29      'mod_h5pactivity_get_h5pactivity_access_information' => [
  30          'classname'     => 'mod_h5pactivity\external\get_h5pactivity_access_information',
  31          'classpath'     => '',
  32          'description'   => 'Return access information for a given h5p activity.',
  33          'type'          => 'read',
  34          'capabilities'  => 'mod/h5pactivity:view',
  35          'services'      => [MOODLE_OFFICIAL_MOBILE_SERVICE],
  36      ],
  37      'mod_h5pactivity_view_h5pactivity' => [
  38          'classname'     => 'mod_h5pactivity\external\view_h5pactivity',
  39          'classpath'     => '',
  40          'description'   => 'Trigger the course module viewed event and update the module completion status.',
  41          'type'          => 'write',
  42          'capabilities'  => 'mod/h5pactivity:view',
  43          'services'      => [MOODLE_OFFICIAL_MOBILE_SERVICE],
  44      ],
  45      'mod_h5pactivity_get_attempts' => [
  46          'classname'     => 'mod_h5pactivity\external\get_attempts',
  47          'classpath'     => '',
  48          'description'   => 'Return the information needed to list a user attempts.',
  49          'type'          => 'read',
  50          'capabilities'  => 'mod/h5pactivity:view',
  51          'services'      => [MOODLE_OFFICIAL_MOBILE_SERVICE],
  52      ],
  53      'mod_h5pactivity_get_results' => [
  54          'classname'     => 'mod_h5pactivity\external\get_results',
  55          'classpath'     => '',
  56          'description'   => 'Return the information needed to list a user attempt results.',
  57          'type'          => 'read',
  58          'capabilities'  => 'mod/h5pactivity:view',
  59          'services'      => [MOODLE_OFFICIAL_MOBILE_SERVICE],
  60      ],
  61      'mod_h5pactivity_get_h5pactivities_by_courses' => [
  62          'classname'     => 'mod_h5pactivity\external\get_h5pactivities_by_courses',
  63          'classpath'     => '',
  64          'description'   => 'Returns a list of h5p activities in a list of
  65              provided courses, if no list is provided all h5p activities
  66              that the user can view will be returned.',
  67          'type'          => 'read',
  68          'capabilities'  => 'mod/h5pactivity:view',
  69          'services'      => [MOODLE_OFFICIAL_MOBILE_SERVICE],
  70      ],
  71      'mod_h5pactivity_log_report_viewed' => [
  72          'classname'     => 'mod_h5pactivity\external\log_report_viewed',
  73          'classpath'     => '',
  74          'description'   => 'Log that the h5pactivity was viewed.',
  75          'type'          => 'write',
  76          'services'      => [MOODLE_OFFICIAL_MOBILE_SERVICE],
  77      ],
  78      'mod_h5pactivity_get_user_attempts' => [
  79          'classname'     => 'mod_h5pactivity\external\get_user_attempts',
  80          'classpath'     => '',
  81          'description'   => 'Return the information needed to list all enrolled user attempts.',
  82          'type'          => 'read',
  83          'capabilities'  => 'mod/h5pactivity:reviewattempts',
  84          'services'      => [MOODLE_OFFICIAL_MOBILE_SERVICE],
  85      ],
  86  ];