Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed a bug in AICC package importing

  • Loading branch information...
commit f4f18fb00cbacc64b67146a17d82ce59d97a0483 1 parent 9883027
bobopinna authored
Showing with 10 additions and 5 deletions.
  1. +10 −5 mod/scorm/locallib.php
View
15 mod/scorm/locallib.php
@@ -730,16 +730,21 @@ function scorm_forge_cols_regexp($columns,$remodule='(".*")?,') {
return $regexp;
}
-function scorm_parse_aicc($pkgdir,$scormid){
+function scorm_parse_aicc($pkgdir,$scormid) {
$version = 'AICC';
$ids = array();
$courses = array();
+ $extaiccfiles = array('crs','des','au','cst','ort','pre','cmp');
if ($handle = opendir($pkgdir)) {
while (($file = readdir($handle)) !== false) {
- $ext = substr($file,strrpos($file,'.'));
- $extension = strtolower(substr($ext,1));
- $id = strtolower(basename($file,$ext));
- $ids[$id]->$extension = $file;
+ if ($file[0] != '.') {
+ $ext = substr($file,strrpos($file,'.'));
+ $extension = strtolower(substr($ext,1));
+ if (in_array($extension,$extaiccfiles)) {
+ $id = strtolower(basename($file,$ext));
+ $ids[$id]->$extension = $file;
+ }
+ }
}
closedir($handle);
}
Please sign in to comment.
Something went wrong with that request. Please try again.