mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
SCORM MDL-21568 - provide a way for checking to see if these fixes were made on the 1.9 branch already.
This commit is contained in:
parent
c5c0d2ff98
commit
b326c85a36
1 changed files with 20 additions and 6 deletions
|
@ -36,12 +36,18 @@ function xmldb_scorm_upgrade($oldversion) {
|
||||||
/// Launch add field whatgrade
|
/// Launch add field whatgrade
|
||||||
if (!$dbman->field_exists($table,$field)) {
|
if (!$dbman->field_exists($table,$field)) {
|
||||||
$dbman->add_field($table, $field);
|
$dbman->add_field($table, $field);
|
||||||
/// fix bad usage of whatgrade/grading method.
|
$whatgradefixed = get_config('scorm', 'whatgradefixed');
|
||||||
$scorms = $DB->get_records('scorm');
|
if (empty($whatgradefixed)) {
|
||||||
foreach ($scorms as $scorm) {
|
/// fix bad usage of whatgrade/grading method.
|
||||||
$scorm->whatgrade = $scorm->grademethod/10;
|
$scorms = $DB->get_records('scorm');
|
||||||
$DB->update_record('scorm', $scorm);
|
foreach ($scorms as $scorm) {
|
||||||
|
$scorm->whatgrade = $scorm->grademethod/10;
|
||||||
|
$DB->update_record('scorm', $scorm);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
//dump this config var as it isn't needed anymore.
|
||||||
|
unset_config('whatgradefixed', 'scorm');
|
||||||
}
|
}
|
||||||
|
|
||||||
upgrade_mod_savepoint(true, 2008073000, 'scorm');
|
upgrade_mod_savepoint(true, 2008073000, 'scorm');
|
||||||
|
@ -448,12 +454,20 @@ function xmldb_scorm_upgrade($oldversion) {
|
||||||
upgrade_mod_savepoint(true, 2009042002, 'scorm');
|
upgrade_mod_savepoint(true, 2009042002, 'scorm');
|
||||||
}
|
}
|
||||||
if ($oldversion < 2010070800) {
|
if ($oldversion < 2010070800) {
|
||||||
/// fix bad usage of whatgrade/grading method. - I hope this works in all dbs
|
//check to see if this has already been tidied up by a 1.9 upgrade.
|
||||||
|
$grademethodfixed = get_config('scorm', 'grademethodfixed');
|
||||||
|
if (empty($grademethodfixed)) {
|
||||||
|
/// fix bad usage of whatgrade/grading method.
|
||||||
$scorms = $DB->get_records('scorm');
|
$scorms = $DB->get_records('scorm');
|
||||||
foreach ($scorms as $scorm) {
|
foreach ($scorms as $scorm) {
|
||||||
$scorm->grademethod = $scorm->grademethod%10;
|
$scorm->grademethod = $scorm->grademethod%10;
|
||||||
$DB->update_record('scorm', $scorm);
|
$DB->update_record('scorm', $scorm);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
//dump this config var as it isn't needed anymore.
|
||||||
|
unset_config('grademethodfixed', 'scorm');
|
||||||
|
}
|
||||||
|
|
||||||
/// scorm savepoint reached
|
/// scorm savepoint reached
|
||||||
upgrade_mod_savepoint(true, 2010070800, 'scorm');
|
upgrade_mod_savepoint(true, 2010070800, 'scorm');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue