Show percentages for original and corrected points

This commit is contained in:
Wojtek
2026-10-15 21:39:34 +02:00
parent 987373b565
commit 301f322017
7 changed files with 19 additions and 3 deletions
@@ -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,
];
}