Show percentages for original and corrected points
This commit is contained in:
@@ -85,6 +85,9 @@ class HtmlView extends BaseHtmlView
|
||||
'items' => $results,
|
||||
'correct' => $correct,
|
||||
'total' => count($items),
|
||||
'points_total' => array_sum(array_map(static function ($item) {
|
||||
return (int) ($item->points ?? 0);
|
||||
}, $items)),
|
||||
'percentage' => count($items) ? round(($correct / count($items)) * 100, 2) : 0,
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user