Permalink
Browse files

SCORM MDL-20122 badly formatted restore values - thanks to Michael Av…

…elar for the fix merged from HEAD
  • Loading branch information...
1 parent d2f35f4 commit 7cf74b7002a28a64be0eda790147f8363cc1c988 @danmarsden danmarsden committed Dec 18, 2009
Showing with 4 additions and 16 deletions.
  1. +4 −16 mod/scorm/restorelib.php
View
@@ -49,22 +49,10 @@ function scorm_restore_mods($mod,$restore) {
$scorm->reference = backup_todb($info['MOD']['#']['REFERENCE']['0']['#']);
$scorm->version = backup_todb($info['MOD']['#']['VERSION']['0']['#']);
$scorm->md5hash = backup_todb($info['MOD']['#']['MD5HASH']['0']['#']);
- $scorm->maxgrade = backup_todb($info['MOD']['#']['MAXGRADE']['0']['#']);
- if (!is_int($scorm->maxgrade)) {
- $scorm->maxgrade = 0;
- }
- $scorm->updatefreq = backup_todb($info['MOD']['#']['UPDATEFREQ']['0']['#']);
- if (!is_int($scorm->updatefreq)) {
- $scorm->updatefreq = 0;
- }
- $scorm->maxattempt = backup_todb($info['MOD']['#']['MAXATTEMPT']['0']['#']);
- if (!is_int($scorm->maxattempt)) {
- $scorm->maxattempt = 0;
- }
- $scorm->grademethod = backup_todb($info['MOD']['#']['GRADEMETHOD']['0']['#']);
- if (!is_int($scorm->grademethod)) {
- $scorm->grademethod = 0;
- }
+ $scorm->maxgrade = (double)backup_todb($info['MOD']['#']['MAXGRADE']['0']['#']);
+ $scorm->updatefreq = (int)backup_todb($info['MOD']['#']['UPDATEFREQ']['0']['#']);
+ $scorm->maxattempt = (int)backup_todb($info['MOD']['#']['MAXATTEMPT']['0']['#']);
+ $scorm->grademethod = (int)backup_todb($info['MOD']['#']['GRADEMETHOD']['0']['#']);
if ($restore->backup_version < 2005041500) {
$scorm->datadir = substr(backup_todb($info['MOD']['#']['DATADIR']['0']['#']),1);
} else {

0 comments on commit 7cf74b7

Please sign in to comment.