Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…incomplete param
  • Loading branch information...
commit d83566565c52b37fddce31812a537716d01ffd7e 1 parent 995e322
Dan Marsden danmarsden authored

Showing 1 changed file with 5 additions and 5 deletions. Show diff stats Hide diff stats

  1. +5 5 mod/scorm/locallib.php
10 mod/scorm/locallib.php
@@ -1545,11 +1545,10 @@ function scorm_get_toc_get_parent_child(&$result) {
1545 1545 if (empty($prevparent)) {
1546 1546 $prevparent = $ident;
1547 1547 }
1548   -
  1548 + if (!isset($final[$i][$prevparent]->children)) {
  1549 + $final[$i][$prevparent]->children = array();
  1550 + }
1549 1551 if ($sco->parent == $prevparent) {
1550   - if (!isset($final[$i][$prevparent]->children)) {
1551   - $final[$i][$prevparent]->children = array();
1552   - }
1553 1552 $final[$i][$prevparent]->children[] = $sco;
1554 1553 $prevparent = $ident;
1555 1554 } else {
@@ -1572,7 +1571,7 @@ function scorm_get_toc_get_parent_child(&$result) {
1572 1571 $keys = array_keys($final[$i]);
1573 1572 $results[] = $final[$i][$keys[0]];
1574 1573 }
1575   -
  1574 +
1576 1575 return $results;
1577 1576 }
1578 1577
@@ -1581,6 +1580,7 @@ function scorm_format_toc_for_treeview($user, $scorm, $scoes, $usertracks, $cmid
1581 1580
1582 1581 $result = new stdClass();
1583 1582 $result->prerequisites = true;
  1583 + $result->incomplete = true;
1584 1584
1585 1585 if (!$children) {
1586 1586 $result->attemptleft = $scorm->maxattempt == 0 ? 1 : $scorm->maxattempt - $attempt;

0 comments on commit d835665

Please sign in to comment.
Something went wrong with that request. Please try again.