Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
  • Loading branch information...
commit 6917eee804439f7ec1dffe6be44e49c0b1fe649f 1 parent e6402b5
@danmarsden danmarsden authored
Showing with 10 additions and 7 deletions.
  1. +5 −2 mod/scorm/locallib.php
  2. +5 −5 mod/scorm/module.js
View
7 mod/scorm/locallib.php
@@ -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.'&nbsp;'.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.'&amp;currentorg='.$currentorg.$modestr.'&amp;scoid='.$sco->id;
$result->toc .= $statusicon.'&nbsp;<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";
View
10 mod/scorm/module.js
@@ -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() {
Please sign in to comment.
Something went wrong with that request. Please try again.