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:
bobopinna
2006-11-02 15:15:06 +00:00
parent 7eb1d32847
commit 23f0f6f72d
2 changed files with 16 additions and 7 deletions
+4 -4
View File
@@ -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 .= '&nbsp;'.$sco->title."</li>\n";
$result->toc .= $statusicon.'&nbsp;'.$sco->title."</li>\n";
}
} else {
$result->toc .= '&nbsp;'.$sco->title."</li>\n";
+12 -3
View File
@@ -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 = '&amp;';
$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 = '';