Skip to content

Commit

Permalink
Merge branch 'MDL-56688-master' of https://github.com/nwp90/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
David Monllao committed Feb 12, 2018
2 parents f40d707 + 2843746 commit 755310c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion grade/lib.php
Expand Up @@ -2127,7 +2127,12 @@ public function flatten(&$element, $category_grade_last, $nooutcomes) {
}
unset($element['children']);

if ($category_grade_last and count($children) > 1) {
if ($category_grade_last and count($children) > 1 and
(
$children[0]['type'] === 'courseitem' or
$children[0]['type'] === 'categoryitem'
)
) {
$cat_item = array_shift($children);
array_push($children, $cat_item);
}
Expand Down

0 comments on commit 755310c

Please sign in to comment.