From 417d004cadd52c45db6d1e56235a78523cd2bfc8 Mon Sep 17 00:00:00 2001 From: Matteo Scaramuccia Date: Tue, 5 Mar 2013 23:39:24 +0100 Subject: [PATCH] MDL-38336 SCORM: incorrect TOC bulding when 'Display course structure' is on --- mod/scorm/locallib.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/mod/scorm/locallib.php b/mod/scorm/locallib.php index 2fb5dcd88042a..1e41d5db73f94 100644 --- a/mod/scorm/locallib.php +++ b/mod/scorm/locallib.php @@ -1625,13 +1625,21 @@ function scorm_format_toc_for_treeview($user, $scorm, $scoes, $usertracks, $cmid } } else if ($toclink == TOCFULLURL) { $url = $CFG->wwwroot.'/mod/scorm/player.php?'.$sco->url; - if ($sco->scormtype == 'sco') { - $result->toc .= $sco->statusicon.' '.format_string($sco->title).''.$score."\n"; + if (!empty($sco->launch)) { + if ($sco->scormtype == 'sco') { + $result->toc .= $sco->statusicon.' '.format_string($sco->title).''.$score."\n"; + } else { + $result->toc .= ' '.format_string($sco->title).''.$score."\n"; + } } else { - $result->toc .= ' '.format_string($sco->title).''.$score."\n"; + if ($sco->scormtype == 'sco') { + $result->toc .= $sco->statusicon.' '.format_string($sco->title).$score."\n"; + } else { + $result->toc .= ' '.format_string($sco->title).$score."\n"; + } } } else { - if ($sco->launch) { + if (!empty($sco->launch)) { if ($sco->scormtype == 'sco') { $result->toc .= ''.$sco->statusicon.' '.format_string($sco->title).' '.$score.''; } else {