MDL-28937 SCORM 2004 ADL TEST CM-01 MDL-28740 first part of check for hidecontinue param in SCO - prevent next item in TOC from being selectable and disable buttons in navbar if links don't exist in TOC
This commit is contained in:
@@ -1306,6 +1306,7 @@ function scorm_get_toc($user,$scorm,$cmid,$toclink=TOCJSLINK,$currentorg='',$sco
|
||||
$nextid = 0;
|
||||
$findnext = false;
|
||||
$parents[$level]='/';
|
||||
$prevsco = '';
|
||||
foreach ($scoes as $pos => $sco) {
|
||||
$isvisible = false;
|
||||
$sco->title = $sco->title;
|
||||
@@ -1421,8 +1422,9 @@ function scorm_get_toc($user,$scorm,$cmid,$toclink=TOCJSLINK,$currentorg='',$sco
|
||||
if ($sco->id == $scoid) {
|
||||
$result->prerequisites = true;
|
||||
}
|
||||
|
||||
if ($toclink == TOCFULLURL) { //display toc with urls for structure page
|
||||
if (!empty($prevsco) && scorm_version_check($scorm->version, SCORM_13) && !empty($prevsco->hidecontinue)) {
|
||||
$result->toc .= '<span>'.$statusicon.' '.format_string($sco->title).'</span>';
|
||||
} else if ($toclink == TOCFULLURL) { //display toc with urls for structure page
|
||||
$url = $CFG->wwwroot.'/mod/scorm/player.php?a='.$scorm->id.'&currentorg='.$currentorg.$modestr.'&scoid='.$sco->id;
|
||||
$result->toc .= $statusicon.' <a href="'.$url.'">'.format_string($sco->title).'</a>'.$score."\n";
|
||||
} else { //display toc for inside scorm player
|
||||
@@ -1457,6 +1459,7 @@ function scorm_get_toc($user,$scorm,$cmid,$toclink=TOCJSLINK,$currentorg='',$sco
|
||||
$nextid = $nextsco->id;
|
||||
}
|
||||
}
|
||||
$prevsco = $sco;
|
||||
}
|
||||
for ($i=0;$i<$level;$i++) {
|
||||
$result->toc .= "\t\t</ul></li>\n";
|
||||
|
||||
+5
-5
@@ -146,11 +146,11 @@ M.mod_scorm.init = function(Y, hide_nav, hide_toc, toc_title, window_name, launc
|
||||
* @return void
|
||||
*/
|
||||
var scorm_fixnav = function() {
|
||||
scorm_buttons[0].set('disabled', (scorm_skipprev(scorm_current_node) == null));
|
||||
scorm_buttons[1].set('disabled', (scorm_prev(scorm_current_node) == null));
|
||||
scorm_buttons[2].set('disabled', (scorm_up(scorm_current_node) == null));
|
||||
scorm_buttons[3].set('disabled', (scorm_next(scorm_current_node) == null));
|
||||
scorm_buttons[4].set('disabled', (scorm_skipnext(scorm_current_node) == null));
|
||||
scorm_buttons[0].set('disabled', (scorm_skipprev(scorm_current_node) == null || scorm_skipprev(scorm_current_node).title == null));
|
||||
scorm_buttons[1].set('disabled', (scorm_prev(scorm_current_node) == null || scorm_prev(scorm_current_node).title == null));
|
||||
scorm_buttons[2].set('disabled', (scorm_up(scorm_current_node) == null) || scorm_up(scorm_current_node).title == null);
|
||||
scorm_buttons[3].set('disabled', (scorm_next(scorm_current_node) == null) || scorm_next(scorm_current_node).title == null);
|
||||
scorm_buttons[4].set('disabled', (scorm_skipnext(scorm_current_node) == null || scorm_skipnext(scorm_current_node).title == null));
|
||||
};
|
||||
|
||||
var scorm_resize_parent = function() {
|
||||
|
||||
Reference in New Issue
Block a user