Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed backup bad data archive

  • Loading branch information...
commit f04a5d36e4eb15fee1ef88b46c39aa14b78253cb 1 parent 73673f9
bobopinna authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 mod/scorm/restorelib.php
View
12 mod/scorm/restorelib.php
@@ -49,12 +49,24 @@ function scorm_restore_mods($mod,$restore) {
$scorm->reference = backup_todb($info['MOD']['#']['REFERENCE']['0']['#']);
$scorm->version = backup_todb($info['MOD']['#']['VERSION']['0']['#']);
$scorm->maxgrade = backup_todb($info['MOD']['#']['MAXGRADE']['0']['#']);
+ if (!is_int($scorm->maxgrade)) {
+ $scorm->maxgrade = 0;
+ }
$scorm->grademethod = backup_todb($info['MOD']['#']['GRADEMETHOD']['0']['#']);
+ if (!is_int($scorm->grademethod)) {
+ $scorm->grademethod = 0;
+ }
$scorm->launch = backup_todb($info['MOD']['#']['LAUNCH']['0']['#']);
$scorm->summary = backup_todb($info['MOD']['#']['SUMMARY']['0']['#']);
$scorm->auto = backup_todb($info['MOD']['#']['AUTO']['0']['#']);
$scorm->width = backup_todb($info['MOD']['#']['WIDTH']['0']['#']);
+ if ($scorm->width == 0) {
+ $scorm->width = 800;
+ }
$scorm->height = backup_todb($info['MOD']['#']['HEIGHT']['0']['#']);
+ if ($scorm->height == 0) {
+ $scorm->height = 600;
+ }
$scorm->timemodified = time();
//The structure is equal to the db, so insert the scorm
Please sign in to comment.
Something went wrong with that request. Please try again.