MDL-68448 mod_h5pactivity: Add new ws get_h5pactivities_by_courses
[moodle.git] / mod / h5pactivity / db / services.php
CommitLineData
feae0965 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
26defined('MOODLE_INTERNAL') || die;
27
28$functions = [
29 'mod_h5pactivity_get_h5pactivity_access_information' => [
30 'classname' => 'mod_h5pactivity\external\get_h5pactivity_access_information',
31 'methodname' => 'execute',
32 'classpath' => '',
33 'description' => 'Return access information for a given h5p activity.',
34 'type' => 'read',
35 'capabilities' => 'mod/h5pactivity:view',
36 'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
149b60f2 37 ],
a9ed34a9 38 'mod_h5pactivity_view_h5pactivity' => [
39 'classname' => 'mod_h5pactivity\external\view_h5pactivity',
40 'methodname' => 'execute',
41 'classpath' => '',
42 'description' => 'Trigger the course module viewed event and update the module completion status.',
43 'type' => 'write',
44 'capabilities' => 'mod/h5pactivity:view',
45 'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
149b60f2 46 ],
c09bc8d8
FR
47 'mod_h5pactivity_get_attempts' => [
48 'classname' => 'mod_h5pactivity\external\get_attempts',
49 'methodname' => 'execute',
50 'classpath' => '',
51 'description' => 'Return the information needed to list a user attempts.',
52 'type' => 'read',
53 'capabilities' => 'mod/h5pactivity:view',
54 'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
55 ],
9fa0e253 56 'mod_h5pactivity_get_h5pactivities_by_courses' => [
57 'classname' => 'mod_h5pactivity\external\get_h5pactivities_by_courses',
58 'methodname' => 'execute',
59 'classpath' => '',
60 'description' => 'Returns a list of h5p activities in a list of
61 provided courses, if no list is provided all h5p activities
62 that the user can view will be returned.',
63 'type' => 'read',
64 'capabilities' => 'mod/h5pactivity:view',
65 'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
66 ],
a9ed34a9 67];