diff --git a/grade/report/outcomes/index.php b/grade/report/outcomes/index.php index a35254f909e..4052aea3041 100644 --- a/grade/report/outcomes/index.php +++ b/grade/report/outcomes/index.php @@ -95,6 +95,11 @@ $html .= '' . get_string('numberofgrades', 'gr $row = 0; foreach ($report_info as $outcomeid => $outcomedata) { $rowspan = count($outcomedata['items']); + // If there are no items for this outcome, rowspan will equal 0, which is not good + if ($rowspan == 0) { + $rowspan = 1; + } + $shortname_html = '' . $outcomedata['outcome']->shortname . "\n"; $sitewide = get_string('no'); @@ -110,7 +115,7 @@ foreach ($report_info as $outcomeid => $outcomedata) { $print_tr = false; $items_html = ''; - if (is_array($outcomedata['items'])) { + if (!empty($outcomedata['items'])) { foreach ($outcomedata['items'] as $itemid => $item) { if ($print_tr) { $row++;