Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-35418 SCORM: always set children param even if empty. Always set …

…incomplete param
  • Loading branch information...
commit d83566565c52b37fddce31812a537716d01ffd7e 1 parent 995e322
@danmarsden danmarsden authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 mod/scorm/locallib.php
View
10 mod/scorm/locallib.php
@@ -1545,11 +1545,10 @@ function scorm_get_toc_get_parent_child(&$result) {
if (empty($prevparent)) {
$prevparent = $ident;
}
-
+ if (!isset($final[$i][$prevparent]->children)) {
+ $final[$i][$prevparent]->children = array();
+ }
if ($sco->parent == $prevparent) {
- if (!isset($final[$i][$prevparent]->children)) {
- $final[$i][$prevparent]->children = array();
- }
$final[$i][$prevparent]->children[] = $sco;
$prevparent = $ident;
} else {
@@ -1572,7 +1571,7 @@ function scorm_get_toc_get_parent_child(&$result) {
$keys = array_keys($final[$i]);
$results[] = $final[$i][$keys[0]];
}
-
+
return $results;
}
@@ -1581,6 +1580,7 @@ function scorm_format_toc_for_treeview($user, $scorm, $scoes, $usertracks, $cmid
$result = new stdClass();
$result->prerequisites = true;
+ $result->incomplete = true;
if (!$children) {
$result->attemptleft = $scorm->maxattempt == 0 ? 1 : $scorm->maxattempt - $attempt;
Please sign in to comment.
Something went wrong with that request. Please try again.