From e96cb4feaa52ff1682ba7eb8169c0da4ce9bc048 Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Thu, 26 Jul 2007 08:49:53 +0000 Subject: [PATCH] MDL-10550 Fixed small bugs --- grade/report/outcomes/index.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/grade/report/outcomes/index.php b/grade/report/outcomes/index.php index 17c0d86ef..b6ceb859f 100644 --- a/grade/report/outcomes/index.php +++ b/grade/report/outcomes/index.php @@ -65,9 +65,18 @@ foreach ($outcomes as $outcomeid => $outcome) { WHERE itemid = $itemid GROUP BY itemid"; $info = get_records_sql($sql); - $info = reset($info); - $report_info[$outcomeid]['items'][$itemid]->avg = round($info->avg, 2); - $report_info[$outcomeid]['items'][$itemid]->count = $info->count; + + if (!$info) { + unset($report_info[$outcomeid]['items'][$itemid]); + continue; + } else { + $info = reset($info); + $avg = round($info->avg, 2); + $count = $info->count; + } + + $report_info[$outcomeid]['items'][$itemid]->avg = $avg; + $report_info[$outcomeid]['items'][$itemid]->count = $count; } } } -- 2.11.4.GIT