3 // This file is part of Moodle - http://moodle.org/
5 // Moodle is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
10 // Moodle is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
19 * Settings used by the lesson module, were moved from mod_edit
23 * @copyright 2009 Sam Hemelryk
24 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or late
27 defined('MOODLE_INTERNAL') ||
die;
29 if ($ADMIN->fulltree
) {
30 require_once($CFG->dirroot
.'/mod/lesson/locallib.php');
32 /** Slideshow settings */
33 $settings->add(new admin_setting_configtext('lesson_slideshowwidth', get_string('slideshowwidth', 'lesson'),
34 get_string('configslideshowwidth', 'lesson'), 640, PARAM_INT
));
36 $settings->add(new admin_setting_configtext('lesson_slideshowheight', get_string('slideshowheight', 'lesson'),
37 get_string('configslideshowheight', 'lesson'), 480, PARAM_INT
));
39 $settings->add(new admin_setting_configtext('lesson_slideshowbgcolor', get_string('slideshowbgcolor', 'lesson'),
40 get_string('configslideshowbgcolor', 'lesson'), '#FFFFFF', PARAM_TEXT
));
42 /** Media file popup settings */
43 $settings->add(new admin_setting_configtext('lesson_mediawidth', get_string('mediawidth', 'lesson'),
44 get_string('configmediawidth', 'lesson'), 640, PARAM_INT
));
46 $settings->add(new admin_setting_configtext('lesson_mediaheight', get_string('mediaheight', 'lesson'),
47 get_string('configmediaheight', 'lesson'), 480, PARAM_INT
));
49 $settings->add(new admin_setting_configcheckbox('lesson_mediaclose', get_string('mediaclose', 'lesson'),
50 get_string('configmediaclose', 'lesson'), false, PARAM_TEXT
));
52 /** Misc lesson settings */
53 $settings->add(new admin_setting_configtext('lesson_maxhighscores', get_string('maxhighscores', 'lesson'),
54 get_string('configmaxhighscores','lesson'), 10, PARAM_INT
));
56 /** Default lesson settings */
58 for ($i=20; $i>1; $i--) {
61 $settings->add(new admin_setting_configselect('lesson_maxanswers', get_string('maximumnumberofanswersbranches','lesson'),
62 get_string('configmaxanswers', 'lesson'), 4, $numbers));
64 $defaultnextpages = array();
65 $defaultnextpages[0] = get_string("normal", "lesson");
66 $defaultnextpages[LESSON_UNSEENPAGE
] = get_string("showanunseenpage", "lesson");
67 $defaultnextpages[LESSON_UNANSWEREDPAGE
] = get_string("showanunansweredpage", "lesson");
68 $settings->add(new admin_setting_configselect('lesson_defaultnextpage', get_string('actionaftercorrectanswer','lesson'),
69 get_string('configactionaftercorrectanswer', 'lesson'), 0, $defaultnextpages));