Skip to content

Commit

Permalink
SCORM MDL-21568 fix regression
Browse files Browse the repository at this point in the history
  • Loading branch information
danmarsden committed Jul 17, 2010
1 parent 39e1948 commit 9d49a14
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions mod/scorm/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ function xmldb_scorm_upgrade($oldversion) {
if (empty($whatgradefixed)) {
/// fix bad usage of whatgrade/grading method.
$scorms = $DB->get_records('scorm');
foreach ($scorms as $scorm) {
$scorm->whatgrade = $scorm->grademethod/10;
$DB->update_record('scorm', $scorm);
if (!empty($scorm)) {
foreach ($scorms as $scorm) {
$scorm->whatgrade = $scorm->grademethod/10;
$DB->update_record('scorm', $scorm);
}
}
}
} else {
Expand Down Expand Up @@ -473,9 +475,11 @@ function scorm_migrate_content_files($context, $base, $path) {
if (empty($grademethodfixed)) {
/// fix bad usage of whatgrade/grading method.
$scorms = $DB->get_records('scorm');
foreach ($scorms as $scorm) {
$scorm->grademethod = $scorm->grademethod%10;
$DB->update_record('scorm', $scorm);
if (!empty($scorm)) {
foreach ($scorms as $scorm) {
$scorm->grademethod = $scorm->grademethod%10;
$DB->update_record('scorm', $scorm);
}
}
} else {
//dump this config var as it isn't needed anymore.
Expand Down

0 comments on commit 9d49a14

Please sign in to comment.