Permalink
Browse files

Merge branch 'master_MDL-33938' of git://github.com/danmarsden/moodle…

… into MOODLE_23_STABLE

Conflicts:
	mod/scorm/db/upgrade.php
  • Loading branch information...
danpoltawski committed Jul 3, 2012
2 parents a1a00ae + e0d90c5 commit 741543e9a7fb6936f769c2d967b16c9a250dbe73
Showing with 15 additions and 4 deletions.
  1. +11 −0 mod/scorm/db/upgrade.php
  2. +2 −2 mod/scorm/mod_form.php
  3. +1 −1 mod/scorm/settings.php
  4. +1 −1 mod/scorm/version.php
View
@@ -63,6 +63,17 @@ function xmldb_scorm_upgrade($oldversion) {
// Moodle v2.3.0 release upgrade line
// Put any upgrade step following this
+ //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
@@ -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
@@ -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
@@ -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;

0 comments on commit 741543e

Please sign in to comment.