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
22 * @copyright 2009 Sam Hemelryk
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or late
26 require_once($CFG->dirroot
.'/mod/lesson/locallib.php');
28 /** Slideshow settings */
29 $settings->add(new admin_setting_configtext('lesson_slideshowwidth', get_string('slideshowwidth', 'lesson'),
30 get_string('configslideshowwidth', 'lesson'), 640, PARAM_INT
));
32 $settings->add(new admin_setting_configtext('lesson_slideshowheight', get_string('slideshowheight', 'lesson'),
33 get_string('configslideshowheight', 'lesson'), 480, PARAM_INT
));
35 $settings->add(new admin_setting_configtext('lesson_slideshowbgcolor', get_string('slideshowbgcolor', 'lesson'),
36 get_string('configslideshowbgcolor', 'lesson'), '#FFFFFF', PARAM_TEXT
));
38 /** Media file popup settings */
39 $settings->add(new admin_setting_configtext('lesson_mediawidth', get_string('mediawidth', 'lesson'),
40 get_string('configmediawidth', 'lesson'), 640, PARAM_INT
));
42 $settings->add(new admin_setting_configtext('lesson_mediaheight', get_string('mediaheight', 'lesson'),
43 get_string('configmediaheight', 'lesson'), 480, PARAM_INT
));
45 $settings->add(new admin_setting_configcheckbox('lesson_mediaclose', get_string('mediaclose', 'lesson'),
46 get_string('configmediaclose', 'lesson'), false, PARAM_TEXT
));
48 /** Misc lesson settings */
49 $settings->add(new admin_setting_configtext('lesson_maxhighscores', get_string('maxhighscores', 'lesson'),
50 get_string('configmaxhighscores','lesson'), 10, PARAM_INT
));
52 /** Default lesson settings */
54 for ($i=20; $i>1; $i--) {
57 $settings->add(new admin_setting_configselect('lesson_maxanswers', get_string('maximumnumberofanswersbranches','lesson'),
58 get_string('configmaxanswers', 'lesson'), 4, $numbers));
60 $defaultnextpages = array();
61 $defaultnextpages[0] = get_string("normal", "lesson");
62 $defaultnextpages[LESSON_UNSEENPAGE
] = get_string("showanunseenpage", "lesson");
63 $defaultnextpages[LESSON_UNANSWEREDPAGE
] = get_string("showanunansweredpage", "lesson");
64 $settings->add(new admin_setting_configselect('lesson_defaultnextpage', get_string('actionaftercorrectanswer','lesson'),
65 get_string('configactionaftercorrectanswer', 'lesson'), 0, $defaultnextpages));