Student Decisions — All Students
= esc($schoolYear ?? '') ?>
Saved
Not yet generated
getFlashdata('status'))): ?>
= esc(session()->getFlashdata('status')) ?>
getFlashdata('error'))): ?>
= esc(session()->getFlashdata('error')) ?>
No semester scores found for this school year.
'success',
'Repeat Class' => 'danger',
'Make-up exam in fall' => 'info',
'Deferred decision' => 'info',
'Expel' => 'danger',
'Withdrawn' => 'secondary',
];
$sourceBadge = [
'auto' => ['bg-success-subtle text-success-emphasis', 'Auto'],
'manual' => ['bg-primary-subtle text-primary-emphasis', 'Manual'],
'pending' => ['bg-warning-subtle text-warning-emphasis', 'Pending'],
];
$stats = ['Pass' => 0, 'Other' => 0, 'Pending' => 0];
foreach ($rows as $r) {
if ($r['decision'] === 'Pass') $stats['Pass']++;
elseif ($r['decision'] === '' || $r['source'] === 'pending') $stats['Pending']++;
else $stats['Other']++;
}
$pct = static function (int $count, int $total): string {
return $total > 0 ? number_format(($count / $total) * 100, 1) . '%' : '0.0%';
};
$genderKey = static function (?string $gender): string {
$value = strtolower(trim((string)$gender));
return match (true) {
in_array($value, ['male', 'm', 'boy', 'boys'], true) => 'boys',
in_array($value, ['female', 'f', 'girl', 'girls'], true) => 'girls',
default => 'other',
};
};
$genderStats = static function (array $items) use ($genderKey): array {
$stats = ['boys' => 0, 'girls' => 0, 'other' => 0];
foreach ($items as $item) {
$stats[$genderKey($item['gender'] ?? '')]++;
}
return $stats;
};
$totalStudents = count($rows);
$passRows = array_values(array_filter($rows, static fn (array $row): bool => (string)($row['decision'] ?? '') === 'Pass'));
$trophyRows = array_values(array_filter($rows, static fn (array $row): bool => !empty($row['is_trophy'])));
$allGenderStats = $genderStats($rows);
$passGenderStats = $genderStats($passRows);
$trophyGenderStats = $genderStats($trophyRows);
?>
= $stats['Other'] ?>
Other decision
= $stats['Pending'] ?>
Pending
Student Decisions Summary — = esc($schoolYear ?? '') ?>
Trophy counts use the same year-score rule as the trophy final page.
Print Stats
| Metric |
Count |
Percent |
Boys |
Boys % |
Girls |
Girls % |
| Total Students |
= $totalStudents ?> |
100.0% |
= $allGenderStats['boys'] ?> |
= $pct($allGenderStats['boys'], $totalStudents) ?> |
= $allGenderStats['girls'] ?> |
= $pct($allGenderStats['girls'], $totalStudents) ?> |
| Pass |
= count($passRows) ?> |
= $pct(count($passRows), $totalStudents) ?> |
= $passGenderStats['boys'] ?> |
= $pct($passGenderStats['boys'], count($passRows)) ?> |
= $passGenderStats['girls'] ?> |
= $pct($passGenderStats['girls'], count($passRows)) ?> |
| Trophies |
= count($trophyRows) ?> |
= $pct(count($trophyRows), $totalStudents) ?> |
= $trophyGenderStats['boys'] ?> |
= $pct($trophyGenderStats['boys'], count($trophyRows)) ?> |
= $trophyGenderStats['girls'] ?> |
= $pct($trophyGenderStats['girls'], count($trophyRows)) ?> |
| Student Name |
Section |
Fall Score |
Spring Score |
Year Score |
Decision |
Source |
Notes |
is_numeric($v) ? number_format((float)$v, 2) : '—';
?>
| = esc($studentName ?: 'N/A') ?> |
= esc($row['class_section_name'] ?? '—') ?> |
= esc($fmt($row['fall_score'] ?? null)) ?> |
= esc($fmt($row['spring_score'] ?? null)) ?> |
= esc($fmt($yearVal)) ?>
|
= esc($decision) ?>
= esc($decision) ?>
—
|
= esc($srcLabel) ?>
|
= nl2br(esc((string)($row['notes'] ?? ''))) ?> |
$color): ?>
= esc($label) ?>
— decision colour key