Permalink
Browse files

Fixed a bug in AICC package importing

  • Loading branch information...
bobopinna
bobopinna committed Aug 8, 2006
1 parent 9883027 commit f4f18fb00cbacc64b67146a17d82ce59d97a0483
Showing with 10 additions and 5 deletions.
  1. +10 −5 mod/scorm/locallib.php
View
@@ -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);
}

0 comments on commit f4f18fb

Please sign in to comment.