Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-33938 SCORM use consistant naming for maxattempt setting - match …

…setting name with db field name to help when matching default settings
  • Loading branch information...
commit e0d90c54c040fc8d7e42a39aadf644f5fae93c36 1 parent f4a9bf6
@danmarsden danmarsden authored
View
13 mod/scorm/db/upgrade.php
@@ -60,6 +60,19 @@ function xmldb_scorm_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2012032101, 'scorm');
}
+ //rename config var from maxattempts to maxattempt
+ if ($oldversion < 2012061701) {
+ $maxattempts = get_config('scorm', 'maxattempts');
+ $maxattempts_adv = get_config('scorm', 'maxattempts_adv');
+ set_config('maxattempt', $maxattempts, 'scorm');
+ set_config('maxattempt_adv', $maxattempts_adv, 'scorm');
+
+ unset_config('maxattempts', 'scorm'); //remove old setting.
+ unset_config('maxattempts_adv', 'scorm'); //remove old setting.
+ upgrade_mod_savepoint(true, 2012061701, 'scorm');
+ }
+
+
return true;
}
View
4 mod/scorm/mod_form.php
@@ -177,8 +177,8 @@ function definition() {
// Max Attempts
$mform->addElement('select', 'maxattempt', get_string('maximumattempts', 'scorm'), scorm_get_attempts_array());
$mform->addHelpButton('maxattempt', 'maximumattempts', 'scorm');
- $mform->setDefault('maxattempt', $cfg_scorm->maxattempts);
- $mform->setAdvanced('maxattempt', $cfg_scorm->maxattempts_adv);
+ $mform->setDefault('maxattempt', $cfg_scorm->maxattempt);
+ $mform->setAdvanced('maxattempt', $cfg_scorm->maxattempt_adv);
// What Grade
$mform->addElement('select', 'whatgrade', get_string('whatgrade', 'scorm'), scorm_get_what_grade_array());
View
2  mod/scorm/settings.php
@@ -82,7 +82,7 @@
$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',
+ $settings->add(new admin_setting_configselect_with_advanced('scorm/maxattempt',
get_string('maximumattempts', 'scorm'), '',
array('value' => '0', 'adv' => false), scorm_get_attempts_array()));
View
2  mod/scorm/version.php
@@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die();
-$module->version = 2012061700; // The current module version (Date: YYYYMMDDXX)
+$module->version = 2012061701; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2012061700; // Requires this Moodle version
$module->component = 'mod_scorm'; // Full name of the plugin (used for diagnostics)
$module->cron = 300;
Please sign in to comment.
Something went wrong with that request. Please try again.