mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 01:46:45 +02:00
MDL-41580 SCORM: allow imsmanifest.xml to be used in file system repos
This commit is contained in:
parent
7f3836d15a
commit
361a47d409
11 changed files with 153 additions and 14 deletions
|
@ -89,7 +89,7 @@ class mod_scorm_mod_form extends moodleform_mod {
|
|||
|
||||
// New local package upload.
|
||||
$filemanageroptions = array();
|
||||
$filemanageroptions['accepted_types'] = array('.zip');
|
||||
$filemanageroptions['accepted_types'] = array('.zip', '.xml');
|
||||
$filemanageroptions['maxbytes'] = 0;
|
||||
$filemanageroptions['maxfiles'] = 1;
|
||||
$filemanageroptions['subdirs'] = 0;
|
||||
|
@ -353,7 +353,21 @@ class mod_scorm_mod_form extends moodleform_mod {
|
|||
// Make sure updatefreq is not set if using normal local file.
|
||||
$errors['updatefreq'] = get_string('updatefreq_error', 'mod_scorm');
|
||||
}
|
||||
$errors = array_merge($errors, scorm_validate_package($file));
|
||||
if (strtolower($file->get_filename()) == 'imsmanifest.xml') {
|
||||
if (!$file->is_external_file()) {
|
||||
$errors['packagefile'] = get_string('aliasonly', 'mod_scorm');
|
||||
} else {
|
||||
$repository = repository::get_repository_by_id($file->get_repository_id(), CONTEXT_SYSTEM);
|
||||
if (!$repository->supports_relative_file()) {
|
||||
$errors['packagefile'] = get_string('repositorynotsupported', 'mod_scorm');
|
||||
}
|
||||
}
|
||||
} else if (strtolower(substr($file->get_filename(), -3)) == 'xml') {
|
||||
$errors['packagefile'] = get_string('invalidmanifestname', 'mod_scorm');
|
||||
} else {
|
||||
// Validate this SCORM package.
|
||||
$errors = array_merge($errors, scorm_validate_package($file));
|
||||
}
|
||||
}
|
||||
|
||||
} else if ($type === SCORM_TYPE_EXTERNAL) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue