mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-10550 Fixed small bugs
This commit is contained in:
parent
41b477217d
commit
e96cb4feaa
1 changed files with 12 additions and 3 deletions
|
@ -65,9 +65,18 @@ foreach ($outcomes as $outcomeid => $outcome) {
|
||||||
WHERE itemid = $itemid
|
WHERE itemid = $itemid
|
||||||
GROUP BY itemid";
|
GROUP BY itemid";
|
||||||
$info = get_records_sql($sql);
|
$info = get_records_sql($sql);
|
||||||
$info = reset($info);
|
|
||||||
$report_info[$outcomeid]['items'][$itemid]->avg = round($info->avg, 2);
|
if (!$info) {
|
||||||
$report_info[$outcomeid]['items'][$itemid]->count = $info->count;
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue