MDL-51123 mod_scorm: Do not display SCO with invisible = false

This commit is contained in:
Juan Leyva 2015-12-29 17:25:25 +01:00
parent ea3ebbf20e
commit 7f28e8a58f

View file

@ -1444,7 +1444,7 @@ function scorm_get_toc_object($user, $scorm, $currentorg='', $scoid='', $mode='n
if (!empty($organizationsco)) {
$result[0] = $organizationsco;
$result[0]->isvisible = true;
$result[0]->isvisible = 'true';
$result[0]->statusicon = '';
$result[0]->url = '';
}
@ -1464,7 +1464,7 @@ function scorm_get_toc_object($user, $scorm, $currentorg='', $scoid='', $mode='n
}
foreach ($scoes as $sco) {
if (!isset($sco->isvisible)) {
$sco->isvisible = true;
$sco->isvisible = 'true';
}
if (empty($sco->title)) {
@ -1477,7 +1477,7 @@ function scorm_get_toc_object($user, $scorm, $currentorg='', $scoid='', $mode='n
$sco->prereq = empty($sco->prerequisites) || scorm_eval_prerequisites($sco->prerequisites, $usertracks);
}
if ($sco->isvisible) {
if ($sco->isvisible === 'true') {
if (!empty($sco->launch)) {
if (empty($scoid) && ($mode != 'normal')) {
$scoid = $sco->id;
@ -1667,12 +1667,14 @@ function scorm_format_toc_for_treeview($user, $scorm, $scoes, $usertracks, $cmid
$prevsco = '';
if (!empty($scoes)) {
foreach ($scoes as $sco) {
if ($sco->isvisible === 'false') {
continue;
}
$result->toc .= html_writer::start_tag('li');
$scoid = $sco->id;
$sco->isvisible = true;
if ($sco->isvisible) {
$score = '';
if (isset($usertracks[$sco->identifier])) {
@ -1747,10 +1749,6 @@ function scorm_format_toc_for_treeview($user, $scorm, $scoes, $usertracks, $cmid
}
}
} else {
$result->toc .= " ".format_string($sco->title);
}
if (!empty($sco->children)) {
$result->toc .= html_writer::start_tag('ul');
$childresult = scorm_format_toc_for_treeview($user, $scorm, $sco->children, $usertracks, $cmid,