MDL-46805 SCORM: AICC restricts allowed characters in the username
[moodle.git] / mod / scorm / settings.php
CommitLineData
e5dd8e3b 1<?php
f7b5c6aa
DM
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/>.
38d044fc 16
dbf9e4ba 17defined('MOODLE_INTERNAL') || die;
220a90c5 18
dbf9e4ba
PS
19if ($ADMIN->fulltree) {
20 require_once($CFG->dirroot . '/mod/scorm/locallib.php');
21 $yesno = array(0 => get_string('no'),
22 1 => get_string('yes'));
30fc6e2d 23
4cb25b36 24 // Default display settings.
3c0b04c4
DM
25 $settings->add(new admin_setting_heading('scorm/displaysettings', get_string('defaultdisplaysettings', 'scorm'), ''));
26
0ffaa76b
DM
27 $settings->add(new admin_setting_configselect_with_advanced('scorm/displaycoursestructure',
28 get_string('displaycoursestructure', 'scorm'), get_string('displaycoursestructuredesc', 'scorm'),
29 array('value' => 0, 'adv' => false), $yesno));
30fc6e2d 30
0ffaa76b
DM
31 $settings->add(new admin_setting_configselect_with_advanced('scorm/popup',
32 get_string('display', 'scorm'), get_string('displaydesc', 'scorm'),
33 array('value' => 0, 'adv' => false), scorm_get_popup_display_array()));
30fc6e2d 34
74d2a9df
JC
35 $settings->add(new admin_setting_configcheckbox('scorm/displayactivityname',
36 get_string('displayactivityname', 'scorm'), get_string('displayactivityname_help', 'scorm'), 1));
37
0ffaa76b
DM
38 $settings->add(new admin_setting_configtext_with_advanced('scorm/framewidth',
39 get_string('width', 'scorm'), get_string('framewidth', 'scorm'),
40 array('value' => '100', 'adv' => true)));
41
42 $settings->add(new admin_setting_configtext_with_advanced('scorm/frameheight',
43 get_string('height', 'scorm'), get_string('frameheight', 'scorm'),
44 array('value' => '500', 'adv' => true)));
45
46 $settings->add(new admin_setting_configcheckbox('scorm/winoptgrp_adv',
47 get_string('optionsadv', 'scorm'), get_string('optionsadv_desc', 'scorm'), 1));
38d044fc 48
f7b5c6aa 49 foreach (scorm_get_popup_options_array() as $key => $value) {
0ffaa76b
DM
50 $settings->add(new admin_setting_configcheckbox('scorm/'.$key,
51 get_string($key, 'scorm'), '', $value));
dbf9e4ba 52 }
30fc6e2d 53
0ffaa76b
DM
54 $settings->add(new admin_setting_configselect_with_advanced('scorm/skipview',
55 get_string('skipview', 'scorm'), get_string('skipviewdesc', 'scorm'),
56 array('value' => 0, 'adv' => true), scorm_get_skip_view_array()));
38d044fc 57
0ffaa76b
DM
58 $settings->add(new admin_setting_configselect_with_advanced('scorm/hidebrowse',
59 get_string('hidebrowse', 'scorm'), get_string('hidebrowsedesc', 'scorm'),
60 array('value' => 0, 'adv' => true), $yesno));
30fc6e2d 61
0ffaa76b
DM
62 $settings->add(new admin_setting_configselect_with_advanced('scorm/hidetoc',
63 get_string('hidetoc', 'scorm'), get_string('hidetocdesc', 'scorm'),
64 array('value' => 0, 'adv' => true), scorm_get_hidetoc_array()));
30fc6e2d 65
df5c7086
MG
66 $settings->add(new admin_setting_configselect_with_advanced('scorm/nav',
67 get_string('nav', 'scorm'), get_string('navdesc', 'scorm'),
68 array('value' => SCORM_NAV_UNDER_CONTENT, 'adv' => true), scorm_get_navigation_display_array()));
69
70 $settings->add(new admin_setting_configtext_with_advanced('scorm/navpositionleft',
71 get_string('fromleft', 'scorm'), get_string('navpositionleft', 'scorm'),
72 array('value' => -100, 'adv' => true)));
73
74 $settings->add(new admin_setting_configtext_with_advanced('scorm/navpositiontop',
75 get_string('fromtop', 'scorm'), get_string('navpositiontop', 'scorm'),
76 array('value' => -100, 'adv' => true)));
77
78 $settings->add(new admin_setting_configtext_with_advanced('scorm/collapsetocwinsize',
79 get_string('collapsetocwinsize', 'scorm'), get_string('collapsetocwinsizedesc', 'scorm'),
80 array('value' => 767, 'adv' => true)));
9528568b 81
9fba8698
FM
82 $settings->add(new admin_setting_configselect_with_advanced('scorm/displayattemptstatus',
83 get_string('displayattemptstatus', 'scorm'), get_string('displayattemptstatusdesc', 'scorm'),
84 array('value' => 1, 'adv' => false), $yesno));
3c0b04c4 85
4cb25b36 86 // Default grade settings.
3c0b04c4 87 $settings->add(new admin_setting_heading('scorm/gradesettings', get_string('defaultgradesettings', 'scorm'), ''));
9fba8698 88 $settings->add(new admin_setting_configselect('scorm/grademethod',
3c0b04c4 89 get_string('grademethod', 'scorm'), get_string('grademethoddesc', 'scorm'),
9fba8698 90 GRADEHIGHEST, scorm_get_grade_method_array()));
3c0b04c4 91
27b8872c 92 for ($i = 0; $i <= 100; $i++) {
3c0b04c4
DM
93 $grades[$i] = "$i";
94 }
95
9fba8698
FM
96 $settings->add(new admin_setting_configselect('scorm/maxgrade',
97 get_string('maximumgrade'), get_string('maximumgradedesc', 'scorm'), 100, $grades));
3c0b04c4
DM
98
99 $settings->add(new admin_setting_heading('scorm/othersettings', get_string('defaultothersettings', 'scorm'), ''));
100
4cb25b36 101 // Default attempts settings.
9fba8698
FM
102 $settings->add(new admin_setting_configselect('scorm/maxattempt',
103 get_string('maximumattempts', 'scorm'), '', '0', scorm_get_attempts_array()));
3c0b04c4 104
9fba8698
FM
105 $settings->add(new admin_setting_configselect('scorm/whatgrade',
106 get_string('whatgrade', 'scorm'), get_string('whatgradedesc', 'scorm'), HIGHESTATTEMPT, scorm_get_what_grade_array()));
3c0b04c4 107
9fba8698
FM
108 $settings->add(new admin_setting_configselect('scorm/forcecompleted',
109 get_string('forcecompleted', 'scorm'), get_string('forcecompleteddesc', 'scorm'), 0, $yesno));
3c0b04c4 110
9fba8698
FM
111 $settings->add(new admin_setting_configselect('scorm/forcenewattempt',
112 get_string('forcenewattempt', 'scorm'), get_string('forcenewattemptdesc', 'scorm'), 0, $yesno));
3c0b04c4 113
6a6709ec
N
114 $settings->add(new admin_setting_configselect('scorm/autocommit',
115 get_string('autocommit', 'scorm'), get_string('autocommitdesc', 'scorm'), 0, $yesno));
116
9fba8698
FM
117 $settings->add(new admin_setting_configselect('scorm/lastattemptlock',
118 get_string('lastattemptlock', 'scorm'), get_string('lastattemptlockdesc', 'scorm'), 0, $yesno));
3c0b04c4 119
9fba8698
FM
120 $settings->add(new admin_setting_configselect('scorm/auto',
121 get_string('autocontinue', 'scorm'), get_string('autocontinuedesc', 'scorm'), 0, $yesno));
15f5036a 122
9fba8698
FM
123 $settings->add(new admin_setting_configselect('scorm/updatefreq',
124 get_string('updatefreq', 'scorm'), get_string('updatefreqdesc', 'scorm'), 0, scorm_get_updatefreq_array()));
9528568b 125
4cb25b36 126 // Admin level settings.
3c0b04c4
DM
127 $settings->add(new admin_setting_heading('scorm/adminsettings', get_string('adminsettings', 'scorm'), ''));
128
4cb25b36 129 $settings->add(new admin_setting_configcheckbox('scorm/scorm12standard', get_string('scorm12standard', 'scorm'),
130 get_string('scorm12standarddesc', 'scorm'), 1));
e3528983 131
dbf9e4ba 132 $settings->add(new admin_setting_configcheckbox('scorm/allowtypeexternal', get_string('allowtypeexternal', 'scorm'), '', 0));
9528568b 133
dbf9e4ba 134 $settings->add(new admin_setting_configcheckbox('scorm/allowtypelocalsync', get_string('allowtypelocalsync', 'scorm'), '', 0));
9528568b 135
27b8872c
N
136 $settings->add(new admin_setting_configcheckbox('scorm/allowtypeexternalaicc',
137 get_string('allowtypeexternalaicc', 'scorm'), get_string('allowtypeexternalaicc_desc', 'scorm'), 0));
4388bd45 138
4cb25b36 139 $settings->add(new admin_setting_configcheckbox('scorm/allowaicchacp', get_string('allowtypeaicchacp', 'scorm'),
140 get_string('allowtypeaicchacp_desc', 'scorm'), 0));
ba0e91a2
DM
141
142 $settings->add(new admin_setting_configtext('scorm/aicchacptimeout',
143 get_string('aicchacptimeout', 'scorm'), get_string('aicchacptimeout_desc', 'scorm'),
144 30, PARAM_INT));
145
146 $settings->add(new admin_setting_configtext('scorm/aicchacpkeepsessiondata',
147 get_string('aicchacpkeepsessiondata', 'scorm'), get_string('aicchacpkeepsessiondata_desc', 'scorm'),
148 1, PARAM_INT));
149
ef88aa29
DM
150 $settings->add(new admin_setting_configcheckbox('scorm/aiccuserid', get_string('aiccuserid', 'scorm'),
151 get_string('aiccuserid_desc', 'scorm'), 1));
152
4cb25b36 153 $settings->add(new admin_setting_configcheckbox('scorm/forcejavascript', get_string('forcejavascript', 'scorm'),
154 get_string('forcejavascript_desc', 'scorm'), 1));
30bce58e 155
dbf9e4ba 156 $settings->add(new admin_setting_configcheckbox('scorm/allowapidebug', get_string('allowapidebug', 'scorm'), '', 0));
e5dd8e3b 157
0872dbdc 158 $settings->add(new admin_setting_configtext('scorm/apidebugmask', get_string('apidebugmask', 'scorm'), '', '.*'));
dbf9e4ba
PS
159
160}