Merge branch 'MDL-35971-master' of git://github.com/junpataleta/moodle
[moodle.git] / mod / scorm / db / services.php
CommitLineData
e9bf3011
JL
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',
0ca559a1
JL
34 'capabilities' => '',
35 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
e9bf3011 36 ),
22de67f4
JL
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',
0ca559a1
JL
43 'capabilities' => '',
44 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
22de67f4 45 ),
dfe927c8
JL
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',
0ca559a1
JL
52 'capabilities' => '',
53 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
dfe927c8 54 ),
822e9df7
JL
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',
0ca559a1
JL
61 'capabilities' => '',
62 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
822e9df7 63 ),
6b4ceb24
JL
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',
0ca559a1
JL
73 'capabilities' => 'mod/scorm:savetrack',
74 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
6b4ceb24 75 ),
6b5e69eb
JL
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',
0ca559a1
JL
82 'capabilities' => '',
83 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
6b5e69eb 84 ),
91ea3678
JL
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',
0ca559a1
JL
92 'capabilities' => '',
93 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
98fff78d
JL
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',
0ca559a1
JL
101 'capabilities' => '',
102 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
98fff78d 103 ),
b0cf7af4
JL
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 ),
e9bf3011 112);