Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-28109 - allow admin to decide which scorm settings are advanced, …

…tidy up order of settings
  • Loading branch information...
commit 3c0b04c440a5a1c1b8a531faff143c1be29d2da1 1 parent 0ffaa76
@danmarsden danmarsden authored
View
8 mod/scorm/lang/en/scorm.php
@@ -27,6 +27,7 @@
$string['activation'] = 'Activation';
$string['activityloading'] = 'You will be automatically redirected to the activity in';
$string['activitypleasewait'] = 'Activity loading, please wait ...';
+$string['adminsettings'] = 'Admin settings';
$string['advanced'] = 'Parameters';
$string['allowapidebug'] = 'Activate API debug and tracing (set the capture mask with apidebugmask)';
$string['allowtypeexternal'] = 'Enable external package type';
@@ -60,6 +61,9 @@
$string['coursestruct'] = 'Course structure';
$string['currentwindow'] = 'Current window';
$string['datadir'] = 'Filesystem error: Can\'t create course data directory';
+$string['defaultdisplaysettings'] = 'Default display settings';
+$string['defaultgradesettings'] = 'Default grade settings';
+$string['defaultothersettings'] = 'Other default settings';
$string['deleteattemptcheck'] = 'Are you absolutely sure you want to completely delete these attempts?';
$string['deleteallattempts'] = 'Delete all SCORM attempts';
$string['details'] = 'Track details';
@@ -72,6 +76,7 @@
$string['displaycoursestructure_help'] = 'If enabled, the table of contents is displayed on the SCORM outline page.';
$string['displaycoursestructuredesc'] = 'This preference sets the default value for the display course structure on entry page setting';
$string['displaydesc'] = 'This preference sets the default of whether to display the package or not for an activity';
+$string['displaysettings'] = 'Display Settings';
$string['domxml'] = 'DOMXML external library';
$string['duedate'] = 'Due date';
$string['element'] = 'Element';
@@ -118,6 +123,7 @@
* Sum grade - The sum of all the scores';
$string['grademethoddesc'] = 'This preference sets the default grade method for an activity';
$string['gradereported'] = 'Grade reported';
+$string['gradesettings'] = 'Grade settings';
$string['gradescoes'] = 'Learning objects';
$string['gradesum'] = 'Sum grade';
$string['height'] = 'Height';
@@ -183,7 +189,7 @@
$string['optnoattemptsonly'] = 'users with no attempts only';
$string['options'] = 'Options (Prevented by some browsers)';
$string['optionsadv'] = 'Options (Advanced)';
-$string['optionsadv_desc'] = 'If checked the window options below will be set as advanced options in the form';
+$string['optionsadv_desc'] = 'If checked the window options will be set as advanced options in the form';
$string['organization'] = 'Organization';
$string['organizations'] = 'Organizations';
$string['othersettings'] = 'Additional settings';
View
6 mod/scorm/mod_form.php
@@ -93,7 +93,7 @@ function definition() {
$mform->addElement('date_time_selector', 'timeclose', get_string("scormclose", "scorm"), array('optional' => true));
//-------------------------------------------------------------------------------
// display Settings
- $mform->addElement('header', 'advanced', get_string('displaysettings', 'scorm'));
+ $mform->addElement('header', 'displaysettings', get_string('displaysettings', 'scorm'));
// Framed / Popup Window
$mform->addElement('select', 'popup', get_string('display', 'scorm'), scorm_get_popup_display_array());
$mform->setDefault('popup', $cfg_scorm->popup);
@@ -154,7 +154,7 @@ function definition() {
//-------------------------------------------------------------------------------
// grade Settings
- $mform->addElement('header', 'advanced', get_string('gradesettings', 'scorm'));
+ $mform->addElement('header', 'gradesettings', get_string('gradesettings', 'scorm'));
// Grade Method
$mform->addElement('select', 'grademethod', get_string('grademethod', 'scorm'), scorm_get_grade_method_array());
@@ -171,7 +171,7 @@ function definition() {
$mform->disabledIf('maxgrade', 'grademethod', 'eq', GRADESCOES);
$mform->setAdvanced('maxgrade', $cfg_scorm->maxgrade_adv);
- $mform->addElement('header', 'advanced', get_string('othersettings', 'scorm'));
+ $mform->addElement('header', 'othersettings', get_string('othersettings', 'scorm'));
// Max Attempts
$mform->addElement('select', 'maxattempt', get_string('maximumattempts', 'scorm'), scorm_get_attempts_array());
View
84 mod/scorm/settings.php
@@ -21,45 +21,9 @@
$yesno = array(0 => get_string('no'),
1 => get_string('yes'));
- //default grade settings
- $settings->add(new admin_setting_configselect_with_advanced('scorm/grademethod',
- get_string('grademethod', 'scorm'), get_string('grademethoddesc', 'scorm'),
- array('value' => GRADEHIGHEST, 'adv' => false), scorm_get_grade_method_array()));
-
- for ($i=0; $i<=100; $i++) {
- $grades[$i] = "$i";
- }
-
- $settings->add(new admin_setting_configselect_with_advanced('scorm/maxgrade',
- get_string('maximumgrade'), get_string('maximumgradedesc', 'scorm'),
- array('value' => 100, 'adv' => false), $grades));
-
- //default attempts settings.
- $settings->add(new admin_setting_configselect_with_advanced('scorm/maxattempts',
- get_string('maximumattempts', 'scorm'), '',
- array('value' => '0', 'adv' => false), scorm_get_attempts_array()));
-
- $settings->add(new admin_setting_configselect_with_advanced('scorm/whatgrade',
- get_string('whatgrade', 'scorm'), get_string('whatgradedesc', 'scorm'),
- array('value' => HIGHESTATTEMPT, 'adv' => false), scorm_get_what_grade_array()));
-
- $settings->add(new admin_setting_configselect_with_advanced('scorm/displayattemptstatus',
- get_string('displayattemptstatus', 'scorm'), get_string('displayattemptstatusdesc', 'scorm'),
- array('value' => 1, 'adv' => false), $yesno));
-
- $settings->add(new admin_setting_configselect_with_advanced('scorm/forcecompleted',
- get_string('forcecompleted', 'scorm'), get_string('forcecompleteddesc', 'scorm'),
- array('value' => 0, 'adv' => true), $yesno));
-
- $settings->add(new admin_setting_configselect_with_advanced('scorm/forcenewattempt',
- get_string('forcenewattempt', 'scorm'), get_string('forcenewattemptdesc', 'scorm'),
- array('value' => 0, 'adv' => true), $yesno));
-
- $settings->add(new admin_setting_configselect_with_advanced('scorm/lastattemptlock',
- get_string('lastattemptlock', 'scorm'), get_string('lastattemptlockdesc', 'scorm'),
- array('value' => 0, 'adv' => true), $yesno));
-
//default display settings
+ $settings->add(new admin_setting_heading('scorm/displaysettings', get_string('defaultdisplaysettings', 'scorm'), ''));
+
$settings->add(new admin_setting_configselect_with_advanced('scorm/displaycoursestructure',
get_string('displaycoursestructure', 'scorm'), get_string('displaycoursestructuredesc', 'scorm'),
array('value' => 0, 'adv' => false), $yesno));
@@ -100,6 +64,48 @@
get_string('hidenav', 'scorm'), get_string('hidenavdesc', 'scorm'),
array('value' => 0, 'adv' => false), $yesno));
+
+ //default grade settings
+ $settings->add(new admin_setting_heading('scorm/gradesettings', get_string('defaultgradesettings', 'scorm'), ''));
+ $settings->add(new admin_setting_configselect_with_advanced('scorm/grademethod',
+ get_string('grademethod', 'scorm'), get_string('grademethoddesc', 'scorm'),
+ array('value' => GRADEHIGHEST, 'adv' => false), scorm_get_grade_method_array()));
+
+ for ($i=0; $i<=100; $i++) {
+ $grades[$i] = "$i";
+ }
+
+ $settings->add(new admin_setting_configselect_with_advanced('scorm/maxgrade',
+ get_string('maximumgrade'), get_string('maximumgradedesc', 'scorm'),
+ array('value' => 100, 'adv' => false), $grades));
+
+ $settings->add(new admin_setting_heading('scorm/othersettings', get_string('defaultothersettings', 'scorm'), ''));
+
+ //default attempts settings.
+ $settings->add(new admin_setting_configselect_with_advanced('scorm/maxattempts',
+ get_string('maximumattempts', 'scorm'), '',
+ array('value' => '0', 'adv' => false), scorm_get_attempts_array()));
+
+ $settings->add(new admin_setting_configselect_with_advanced('scorm/whatgrade',
+ get_string('whatgrade', 'scorm'), get_string('whatgradedesc', 'scorm'),
+ array('value' => HIGHESTATTEMPT, 'adv' => false), scorm_get_what_grade_array()));
+
+ $settings->add(new admin_setting_configselect_with_advanced('scorm/displayattemptstatus',
+ get_string('displayattemptstatus', 'scorm'), get_string('displayattemptstatusdesc', 'scorm'),
+ array('value' => 1, 'adv' => false), $yesno));
+
+ $settings->add(new admin_setting_configselect_with_advanced('scorm/forcecompleted',
+ get_string('forcecompleted', 'scorm'), get_string('forcecompleteddesc', 'scorm'),
+ array('value' => 0, 'adv' => true), $yesno));
+
+ $settings->add(new admin_setting_configselect_with_advanced('scorm/forcenewattempt',
+ get_string('forcenewattempt', 'scorm'), get_string('forcenewattemptdesc', 'scorm'),
+ array('value' => 0, 'adv' => true), $yesno));
+
+ $settings->add(new admin_setting_configselect_with_advanced('scorm/lastattemptlock',
+ get_string('lastattemptlock', 'scorm'), get_string('lastattemptlockdesc', 'scorm'),
+ array('value' => 0, 'adv' => true), $yesno));
+
$settings->add(new admin_setting_configselect_with_advanced('scorm/auto',
get_string('autocontinue', 'scorm'), get_string('autocontinuedesc', 'scorm'),
array('value' => 0, 'adv' => true), $yesno));
@@ -109,6 +115,8 @@
array('value' => 0, 'adv' => true), scorm_get_updatefreq_array()));
//admin level settings.
+ $settings->add(new admin_setting_heading('scorm/adminsettings', get_string('adminsettings', 'scorm'), ''));
+
$settings->add(new admin_setting_configtext('scorm/updatetime', get_string('updatetime', 'scorm'), '', 2, PARAM_INT));
$settings->add(new admin_setting_configcheckbox('scorm/allowtypeexternal', get_string('allowtypeexternal', 'scorm'), '', 0));

0 comments on commit 3c0b04c

Please sign in to comment.
Something went wrong with that request. Please try again.