Accessibility: MDL-17705: Thanks Tim
This commit is contained in:
@@ -210,7 +210,7 @@ function scorm_parse_aicc($scorm) {
|
||||
//print_r($courses);
|
||||
|
||||
$oldscoes = $DB->get_records('scorm_scoes', array('scorm'=>$scorm->id));
|
||||
|
||||
|
||||
$launch = 0;
|
||||
if (isset($courses)) {
|
||||
foreach ($courses as $course) {
|
||||
@@ -242,7 +242,7 @@ function scorm_parse_aicc($scorm) {
|
||||
$sco->scorm = $scorm->id;
|
||||
$sco->organization = $course->id;
|
||||
$sco->title = $element->title;
|
||||
|
||||
|
||||
if (!isset($element->parent) || strtolower($element->parent) == 'root') {
|
||||
$sco->parent = '/';
|
||||
} else {
|
||||
@@ -320,20 +320,20 @@ function scorm_parse_aicc($scorm) {
|
||||
|
||||
function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='normal',$attempt='',$play=false) {
|
||||
global $CFG, $DB;
|
||||
|
||||
|
||||
$strexpand = get_string('expcoll','scorm');
|
||||
$modestr = '';
|
||||
if ($mode == 'browse') {
|
||||
$modestr = '&mode='.$mode;
|
||||
}
|
||||
}
|
||||
$scormpixdir = $CFG->modpixpath.'/scorm/pix';
|
||||
|
||||
|
||||
$result = new stdClass();
|
||||
$result->toc = "<ul id='s0' class='$liststyle'>\n";
|
||||
$tocmenus = array();
|
||||
$result->prerequisites = true;
|
||||
$incomplete = false;
|
||||
|
||||
|
||||
//
|
||||
// Get the current organization infos
|
||||
//
|
||||
@@ -353,7 +353,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
|
||||
if ($scoes = scorm_get_scoes($scorm->id, $currentorg)){
|
||||
//
|
||||
// Retrieve user tracking data for each learning object
|
||||
//
|
||||
//
|
||||
$usertracks = array();
|
||||
foreach ($scoes as $sco) {
|
||||
if (!empty($sco->launch)) {
|
||||
@@ -372,7 +372,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
|
||||
$nextid = 0;
|
||||
$findnext = false;
|
||||
$parents[$level]='/';
|
||||
|
||||
|
||||
foreach ($scoes as $pos => $sco) {
|
||||
$isvisible = false;
|
||||
$sco->title = $sco->title;
|
||||
@@ -426,7 +426,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
|
||||
}
|
||||
$result->toc .= '<a href="javascript:expandCollide(\'img'.$sublist.'\',\'s'.$sublist.'\','.$nextsco->id.');"><img id="img'.$sublist.'" src="'.$scormpixdir.'/'.$icon.'.gif" alt="'.$strexpand.'" title="'.$strexpand.'"/></a>';
|
||||
} else if ($isvisible) {
|
||||
$result->toc .= '<img src="'.$scormpixdir.'/spacer.gif" alt="spacer" />';
|
||||
$result->toc .= '<img src="'.$scormpixdir.'/spacer.gif" alt="" />';
|
||||
}
|
||||
if (empty($sco->title)) {
|
||||
$sco->title = $sco->identifier;
|
||||
@@ -447,7 +447,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
|
||||
} else {
|
||||
$statusicon = '<img src="'.$scormpixdir.'/assetc.gif" alt="'.get_string('assetlaunched','scorm').'" title="'.get_string('assetlaunched','scorm').'" />';
|
||||
}
|
||||
|
||||
|
||||
if (($usertrack->status == 'notattempted') || ($usertrack->status == 'incomplete') || ($usertrack->status == 'browsed')) {
|
||||
$incomplete = true;
|
||||
if ($play && empty($scoid)) {
|
||||
@@ -479,7 +479,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
|
||||
$shownext = isset($sco->next) ? $sco->next : 0;
|
||||
$showprev = isset($sco->previous) ? $sco->previous : 0;
|
||||
}
|
||||
|
||||
|
||||
if (($nextid == 0) && (scorm_count_launchable($scorm->id,$currentorg) > 1) && ($nextsco!==false) && (!$findnext)) {
|
||||
if (!empty($sco->launch)) {
|
||||
$previd = $sco->id;
|
||||
@@ -511,7 +511,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
|
||||
for ($i=0;$i<$level;$i++) {
|
||||
$result->toc .= "\t\t</ul></li>\n";
|
||||
}
|
||||
|
||||
|
||||
if ($play) {
|
||||
$sco = scorm_get_sco($scoid);
|
||||
$sco->previd = $previd;
|
||||
@@ -544,7 +544,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
|
||||
//]]>
|
||||
</script>'."\n";
|
||||
}
|
||||
|
||||
|
||||
$url = $CFG->wwwroot.'/mod/scorm/player.php?a='.$scorm->id.'&currentorg='.$currentorg.$modestr.'&scoid=';
|
||||
$result->tocmenu = popup_form($url,$tocmenus, "tocmenu", $sco->id, '', '', '', true);
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
* @return boolean
|
||||
*/
|
||||
function scorm_eval_prerequisites($prerequisites, $usertracks) {
|
||||
|
||||
// this is really a little language parser - AICC_SCRIPT is the reference
|
||||
|
||||
// this is really a little language parser - AICC_SCRIPT is the reference
|
||||
// see 2.3.2.5.1. Sequencing/Navigation Today - from the SCORM 1.2 spec
|
||||
$element = '';
|
||||
$stack = array();
|
||||
@@ -28,7 +28,7 @@ function scorm_eval_prerequisites($prerequisites, $usertracks) {
|
||||
'b' => 'browsed',
|
||||
'n' => 'notattempted'
|
||||
);
|
||||
$i=0;
|
||||
$i=0;
|
||||
|
||||
// expand the amp entities
|
||||
$prerequisites = preg_replace('/&/', '&', $prerequisites);
|
||||
@@ -50,7 +50,7 @@ function scorm_eval_prerequisites($prerequisites, $usertracks) {
|
||||
if (!preg_match('/^(&&|\|\||\(|\))$/', $element)) {
|
||||
// create each individual expression
|
||||
// search for ~ = <> X*{}
|
||||
|
||||
|
||||
// sets like 3*{S34, S36, S37, S39}
|
||||
if (preg_match('/^(\d+)\*\{(.+)\}$/', $element, $matches)) {
|
||||
$repeat = $matches[1];
|
||||
@@ -67,11 +67,11 @@ function scorm_eval_prerequisites($prerequisites, $usertracks) {
|
||||
} else {
|
||||
$element = 'false';
|
||||
}
|
||||
|
||||
|
||||
// ~ Not
|
||||
} else if ($element == '~') {
|
||||
$element = '!';
|
||||
|
||||
|
||||
// = | <>
|
||||
} else if (preg_match('/^(.+)(\=|\<\>)(.+)$/', $element, $matches)) {
|
||||
$element = trim($matches[1]);
|
||||
@@ -89,7 +89,7 @@ function scorm_eval_prerequisites($prerequisites, $usertracks) {
|
||||
} else {
|
||||
$element = 'false';
|
||||
}
|
||||
|
||||
|
||||
// everything else must be an element defined like S45 ...
|
||||
} else {
|
||||
if (isset($usertracks[$element]) &&
|
||||
@@ -99,7 +99,7 @@ function scorm_eval_prerequisites($prerequisites, $usertracks) {
|
||||
$element = 'false';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
$stack []= ' '.$element.' ';
|
||||
}
|
||||
@@ -108,20 +108,20 @@ function scorm_eval_prerequisites($prerequisites, $usertracks) {
|
||||
|
||||
function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='normal',$attempt='',$play=false) {
|
||||
global $CFG, $DB;
|
||||
|
||||
|
||||
$strexpand = get_string('expcoll','scorm');
|
||||
$modestr = '';
|
||||
if ($mode == 'browse') {
|
||||
$modestr = '&mode='.$mode;
|
||||
}
|
||||
}
|
||||
$scormpixdir = $CFG->modpixpath.'/scorm/pix';
|
||||
|
||||
|
||||
$result = new stdClass();
|
||||
$result->toc = "<ul id='s0' class='$liststyle'>\n";
|
||||
$tocmenus = array();
|
||||
$result->prerequisites = true;
|
||||
$incomplete = false;
|
||||
|
||||
|
||||
//
|
||||
// Get the current organization infos
|
||||
//
|
||||
@@ -161,7 +161,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
|
||||
$nextid = 0;
|
||||
$findnext = false;
|
||||
$parents[$level]='/';
|
||||
|
||||
|
||||
foreach ($scoes as $pos => $sco) {
|
||||
$isvisible = false;
|
||||
$sco->title = $sco->title;
|
||||
@@ -215,7 +215,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
|
||||
}
|
||||
$result->toc .= '<a href="javascript:expandCollide(\'img'.$sublist.'\',\'s'.$sublist.'\','.$nextsco->id.');"><img id="img'.$sublist.'" src="'.$scormpixdir.'/'.$icon.'.gif" alt="'.$strexpand.'" title="'.$strexpand.'"/></a>';
|
||||
} else if ($isvisible) {
|
||||
$result->toc .= '<img src="'.$scormpixdir.'/spacer.gif" alt="spacer" />';
|
||||
$result->toc .= '<img src="'.$scormpixdir.'/spacer.gif" alt="" />';
|
||||
}
|
||||
if (empty($sco->title)) {
|
||||
$sco->title = $sco->identifier;
|
||||
@@ -236,7 +236,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
|
||||
} else {
|
||||
$statusicon = '<img src="'.$scormpixdir.'/assetc.gif" alt="'.get_string('assetlaunched','scorm').'" title="'.get_string('assetlaunched','scorm').'" />';
|
||||
}
|
||||
|
||||
|
||||
if (($usertrack->status == 'notattempted') || ($usertrack->status == 'incomplete') || ($usertrack->status == 'browsed')) {
|
||||
$incomplete = true;
|
||||
if ($play && empty($scoid)) {
|
||||
@@ -270,7 +270,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
|
||||
$shownext = isset($sco->next) ? $sco->next : 0;
|
||||
$showprev = isset($sco->previous) ? $sco->previous : 0;
|
||||
}
|
||||
|
||||
|
||||
if (($nextid == 0) && (scorm_count_launchable($scorm->id,$currentorg) > 1) && ($nextsco!==false) && (!$findnext)) {
|
||||
if (!empty($sco->launch)) {
|
||||
$previd = $sco->id;
|
||||
@@ -302,7 +302,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
|
||||
for ($i=0;$i<$level;$i++) {
|
||||
$result->toc .= "\t\t</ul></li>\n";
|
||||
}
|
||||
|
||||
|
||||
if ($play) {
|
||||
// it is possible that scoid is still not set, in this case we dont want an empty object
|
||||
if ($scoid) {
|
||||
@@ -338,7 +338,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
|
||||
//]]>
|
||||
</script>'."\n";
|
||||
}
|
||||
|
||||
|
||||
$url = $CFG->wwwroot.'/mod/scorm/player.php?a='.$scorm->id.'&currentorg='.$currentorg.$modestr.'&scoid=';
|
||||
$result->tocmenu = popup_form($url,$tocmenus, "tocmenu", $sco->id, '', '', '', true);
|
||||
|
||||
|
||||
@@ -7,15 +7,15 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
|
||||
$modestr = '';
|
||||
if ($mode == 'browse') {
|
||||
$modestr = '&mode='.$mode;
|
||||
}
|
||||
}
|
||||
$scormpixdir = $CFG->modpixpath.'/scorm/pix';
|
||||
|
||||
|
||||
$result = new stdClass();
|
||||
$result->toc = "<ul id='s0' class='$liststyle'>\n";
|
||||
$tocmenus = array();
|
||||
$result->prerequisites = true;
|
||||
$incomplete = false;
|
||||
|
||||
|
||||
//
|
||||
// Get the current organization infos
|
||||
//
|
||||
@@ -35,8 +35,8 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
|
||||
if ($scoes = scorm_get_scoes($scorm->id, $currentorg)){
|
||||
//
|
||||
// Retrieve user tracking data for each learning object
|
||||
//
|
||||
|
||||
//
|
||||
|
||||
$usertracks = array();
|
||||
foreach ($scoes as $sco) {
|
||||
if (!empty($sco->launch)) {
|
||||
@@ -97,7 +97,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
|
||||
if (!isset($nextsco->isvisible) || (isset($nextsco->isvisible) && ($nextsco->isvisible == 'true'))) {
|
||||
$nextisvisible = true;
|
||||
}
|
||||
if ($nextisvisible && ($nextsco !== false) && ($sco->parent != $nextsco->parent) &&
|
||||
if ($nextisvisible && ($nextsco !== false) && ($sco->parent != $nextsco->parent) &&
|
||||
(($level==0) || (($level>0) && ($nextsco->parent == $sco->identifier)))) {
|
||||
$sublist++;
|
||||
$icon = 'minus';
|
||||
@@ -107,7 +107,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
|
||||
$result->toc .= "\t\t".'<li><a href="javascript:expandCollide(\'img'.$sublist.'\',\'s'.$sublist.'\','.$nextsco->id.');">'.
|
||||
'<img id="img'.$sublist.'" src="'.$scormpixdir.'/'.$icon.'.gif" alt="'.$strexpand.'" title="'.$strexpand.'"/></a>';
|
||||
} else if ($isvisible) {
|
||||
$result->toc .= "\t\t".'<li><img src="'.$scormpixdir.'/spacer.gif" alt="spacer" />';
|
||||
$result->toc .= "\t\t".'<li><img src="'.$scormpixdir.'/spacer.gif" alt="" />';
|
||||
}
|
||||
if (empty($sco->title)) {
|
||||
$sco->title = $sco->identifier;
|
||||
@@ -128,7 +128,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
|
||||
} else {
|
||||
$statusicon = '<img src="'.$scormpixdir.'/assetc.gif" alt="'.get_string('assetlaunched','scorm').'" title="'.get_string('assetlaunched','scorm').'" />';
|
||||
}
|
||||
|
||||
|
||||
if (($usertrack->status == 'notattempted') || ($usertrack->status == 'incomplete') || ($usertrack->status == 'browsed')) {
|
||||
$incomplete = true;
|
||||
if ($play && empty($scoid)) {
|
||||
@@ -163,7 +163,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
|
||||
$shownext = isset($sco->next) ? $sco->next : 0;
|
||||
$showprev = isset($sco->prev) ? $sco->prev : 0;
|
||||
}
|
||||
|
||||
|
||||
if (($nextid == 0) && (scorm_count_launchable($scorm->id,$currentorg) > 1) && ($nextsco!==false) && (!$findnext)) {
|
||||
if (!empty($sco->launch)) {
|
||||
$previd = $sco->id;
|
||||
@@ -196,7 +196,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
|
||||
for ($i=0;$i<$level;$i++) {
|
||||
$result->toc .= "\t\t</ul></li>\n";
|
||||
}
|
||||
|
||||
|
||||
if ($play) {
|
||||
$sco = $DB->get_record('scorm_scoes', array('id'=>$scoid));
|
||||
$sco->previd = $previd;
|
||||
@@ -229,7 +229,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
|
||||
//]]>
|
||||
</script>'."\n";
|
||||
}
|
||||
|
||||
|
||||
$url = $CFG->wwwroot.'/mod/scorm/player.php?a='.$scorm->id.'&currentorg='.$currentorg.$modestr.'&scoid=';
|
||||
$result->tocmenu = popup_form($url,$tocmenus, "tocmenu", $sco->id, '', '', '', true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user