MDL-52429 mod_scorm: Fix SCORM completion checking in nested SCOs
authorJuan Leyva <juanleyvadelgado@gmail.com>
Mon, 7 Dec 2015 09:54:49 +0000 (10:54 +0100)
committerJuan Leyva <juanleyvadelgado@gmail.com>
Mon, 7 Dec 2015 10:28:22 +0000 (11:28 +0100)
mod/scorm/locallib.php

index 3a6f80a..7fb480f 100644 (file)
@@ -1755,6 +1755,9 @@ function scorm_format_toc_for_treeview($user, $scorm, $scoes, $usertracks, $cmid
                 $result->toc .= html_writer::start_tag('ul');
                 $childresult = scorm_format_toc_for_treeview($user, $scorm, $sco->children, $usertracks, $cmid,
                                                                 $toclink, $currentorg, $attempt, $play, $organizationsco, true);
+
+                // Is any of the children incomplete?
+                $sco->incomplete = $childresult->incomplete;
                 $result->toc .= $childresult->toc;
                 $result->toc .= html_writer::end_tag('ul');
                 $result->toc .= html_writer::end_tag('li');