diff --git a/mod/scorm/locallib.php b/mod/scorm/locallib.php index 3a6f80a63db..2049e5540ce 100644 --- a/mod/scorm/locallib.php +++ b/mod/scorm/locallib.php @@ -237,12 +237,12 @@ function scorm_parse($scorm, $full) { // Sorry - localsync disabled. return; } - if ($scorm->reference !== '' and (!$full or $scorm->sha1hash !== sha1($scorm->reference))) { + if ($scorm->reference !== '') { $fs->delete_area_files($context->id, 'mod_scorm', 'package'); $filerecord = array('contextid' => $context->id, 'component' => 'mod_scorm', 'filearea' => 'package', 'itemid' => 0, 'filepath' => '/'); - if ($packagefile = $fs->create_file_from_url($filerecord, $scorm->reference, array('calctimeout' => true))) { - $newhash = sha1($scorm->reference); + if ($packagefile = $fs->create_file_from_url($filerecord, $scorm->reference, array('calctimeout' => true), true)) { + $newhash = $packagefile->get_contenthash(); } else { $newhash = null; }