MDL-50353 scorm: New Web Service mod_scorm_insert_scorm_tracks
[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',
34 'capabilities' => ''
35 ),
22de67f4
JL
36
37 'mod_scorm_get_scorm_attempt_count' => array(
38 'classname' => 'mod_scorm_external',
39 'methodname' => 'get_scorm_attempt_count',
40 'description' => 'Return the number of attempts done by a user in the given SCORM.',
41 'type' => 'read',
42 'capabilities' => ''
43 ),
dfe927c8
JL
44
45 'mod_scorm_get_scorm_scoes' => array(
46 'classname' => 'mod_scorm_external',
47 'methodname' => 'get_scorm_scoes',
48 'description' => 'Returns a list containing all the scoes data related to the given scorm id',
49 'type' => 'read',
50 'capabilities' => ''
51 ),
822e9df7
JL
52
53 'mod_scorm_get_scorm_user_data' => array(
54 'classname' => 'mod_scorm_external',
55 'methodname' => 'get_scorm_user_data',
56 'description' => 'Retrieves user tracking and SCO data and default SCORM values',
57 'type' => 'read',
58 'capabilities' => ''
59 ),
6b4ceb24
JL
60
61 'mod_scorm_insert_scorm_tracks' => array(
62 'classname' => 'mod_scorm_external',
63 'methodname' => 'insert_scorm_tracks',
64 'description' => 'Saves a scorm tracking record.
65 It will overwrite any existing tracking data for this attempt.
66 Validation should be performed before running the function to ensure the user will not lose any existing
67 attempt data.',
68 'type' => 'write',
69 'capabilities' => 'mod/scorm:savetrack'
70 ),
e9bf3011 71);