MDL-52459 mod_scorm: Auto-update downloaded packages
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user