Fixed a storic problem with & in prerequisites definition
Now finally Moodle has a complete aicc_script conformity with SCORM 1.2
This commit is contained in:
@@ -81,7 +81,7 @@ function scorm_eval_prerequisites($prerequisites,$usertracks) {
|
||||
$setelements = explode(',', substr($prerequisites, $open+1, $close-($open+1)-1));
|
||||
$settrue = 0;
|
||||
foreach ($setelements as $setelement) {
|
||||
if (eval_prerequisites($setelement,$usertracks)) {
|
||||
if (scorm_eval_prerequisites($setelement,$usertracks)) {
|
||||
$settrue++;
|
||||
}
|
||||
}
|
||||
@@ -288,10 +288,10 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
|
||||
$scoid = $sco->id;
|
||||
}
|
||||
if ($sco->scormtype == 'sco') {
|
||||
$statusicon= '<img src="'.$scormpixdir.'/notattempted.gif" alt="'.get_string('notattempted','scorm').'" title="'.get_string('notattempted','scorm').'" />';
|
||||
$statusicon = '<img src="'.$scormpixdir.'/notattempted.gif" alt="'.get_string('notattempted','scorm').'" title="'.get_string('notattempted','scorm').'" />';
|
||||
$incomplete = true;
|
||||
} else {
|
||||
$statusicon .= '<img src="'.$scormpixdir.'/asset.gif" alt="'.get_string('asset','scorm').'" title="'.get_string('asset','scorm').'" />';
|
||||
$statusicon = '<img src="'.$scormpixdir.'/asset.gif" alt="'.get_string('asset','scorm').'" title="'.get_string('asset','scorm').'" />';
|
||||
}
|
||||
}
|
||||
if ($sco->id == $scoid) {
|
||||
@@ -318,7 +318,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
|
||||
if ($sco->id == $scoid) {
|
||||
$result->prerequisites = false;
|
||||
}
|
||||
$result->toc .= ' '.$sco->title."</li>\n";
|
||||
$result->toc .= $statusicon.' '.$sco->title."</li>\n";
|
||||
}
|
||||
} else {
|
||||
$result->toc .= ' '.$sco->title."</li>\n";
|
||||
|
||||
@@ -31,7 +31,11 @@ function scorm_get_manifest($blocks,$scoes) {
|
||||
if (isset($metadata['tagData']) && (preg_match("/^(1\.2)$|^(CAM )?(1\.3)$/",$metadata['tagData'],$matches))) {
|
||||
$scoes->version = 'SCORM_'.$matches[count($matches)-1];
|
||||
} else {
|
||||
$scoes->version = 'SCORM_1.2';
|
||||
if (isset($metadata['tagData']) && (preg_match("/^2004 3rd Edition$/",$metadata['tagData'],$matches))) {
|
||||
$scoes->version = 'SCORM_1.3';
|
||||
} else {
|
||||
$scoes->version = 'SCORM_1.2';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -187,9 +191,14 @@ function scorm_parse_scorm($pkgdir,$scormid) {
|
||||
|
||||
if (is_file($manifestfile)) {
|
||||
|
||||
$xmlstring = file_get_contents($manifestfile);
|
||||
$xmltext = file_get_contents($manifestfile);
|
||||
|
||||
$pattern = '/&(?!\w{2,6};)/';
|
||||
$replacement = '&';
|
||||
$xmltext = preg_replace($pattern, $replacement, $xmltext);
|
||||
|
||||
$objXML = new xml2Array();
|
||||
$manifests = $objXML->parse($xmlstring);
|
||||
$manifests = $objXML->parse($xmltext);
|
||||
//print_r($manifests);
|
||||
$scoes = new stdClass();
|
||||
$scoes->version = '';
|
||||
|
||||
Reference in New Issue
Block a user