mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 04:52:36 +02:00
MDL-33938 SCORM use consistant naming for maxattempt setting - match setting name with db field name to help when matching default settings
This commit is contained in:
parent
f4a9bf65da
commit
e0d90c54c0
@ -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;
|
||||
}
|
||||
|
||||
|
@ -177,8 +177,8 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
// 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());
|
||||
|
@ -82,7 +82,7 @@ if ($ADMIN->fulltree) {
|
||||
$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()));
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user