2 // This file is part of Moodle - http://moodle.org/
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.
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.
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/>.
18 * Lesson external functions and service definitions.
22 * @copyright 2017 Juan Leyva <juan@moodle.com>
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
27 defined('MOODLE_INTERNAL') || die;
30 'mod_lesson_get_lessons_by_courses' => array(
31 'classname' => 'mod_lesson_external',
32 'methodname' => 'get_lessons_by_courses',
33 'description' => 'Returns a list of lessons in a provided list of courses,
34 if no list is provided all lessons that the user can view will be returned.',
36 'capabilities' => 'mod/lesson:view',
37 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
39 'mod_lesson_get_lesson_access_information' => array(
40 'classname' => 'mod_lesson_external',
41 'methodname' => 'get_lesson_access_information',
42 'description' => 'Return access information for a given lesson.',
44 'capabilities' => 'mod/lesson:view',
45 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
47 'mod_lesson_view_lesson' => array(
48 'classname' => 'mod_lesson_external',
49 'methodname' => 'view_lesson',
50 'description' => 'Trigger the course module viewed event and update the module completion status.',
52 'capabilities' => 'mod/lesson:view',
53 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
55 'mod_lesson_get_questions_attempts' => array(
56 'classname' => 'mod_lesson_external',
57 'methodname' => 'get_questions_attempts',
58 'description' => 'Return the list of questions attempts in a given lesson.',
60 'capabilities' => 'mod/lesson:view',
61 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
63 'mod_lesson_get_user_grade' => array(
64 'classname' => 'mod_lesson_external',
65 'methodname' => 'get_user_grade',
66 'description' => 'Return the final grade in the lesson for the given user.',
68 'capabilities' => 'mod/lesson:view',
69 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
71 'mod_lesson_get_user_attempt_grade' => array(
72 'classname' => 'mod_lesson_external',
73 'methodname' => 'get_user_attempt_grade',
74 'description' => 'Return grade information in the attempt for a given user.',
76 'capabilities' => 'mod/lesson:view',
77 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
79 'mod_lesson_get_content_pages_viewed' => array(
80 'classname' => 'mod_lesson_external',
81 'methodname' => 'get_content_pages_viewed',
82 'description' => 'Return the list of content pages viewed by a user during a lesson attempt.',
84 'capabilities' => 'mod/lesson:view',
85 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)