AVP-78 Feature to check if parents looked at report card

This commit is contained in:
root
2026-02-27 01:21:39 -05:00
parent fe7b99581d
commit 3cc5546733
37 changed files with 743 additions and 107 deletions
+4
View File
@@ -75,6 +75,7 @@
$subjectSections = $subjectSections ?? [];
$classSections = $classSections ?? [];
$sectionStats = $sectionStats ?? [];
$sectionSubjectCounts = $sectionSubjectCounts ?? [];
$expectedDays = (int) ($expectedDays ?? 0);
?>
<?php if (empty($classSections)): ?>
@@ -90,6 +91,7 @@
$collapseId = 'progress-section-' . $sectionId;
$headingId = 'progress-heading-' . $sectionId;
$stat = $sectionStats[$sectionId] ?? null;
$subjectCount = (int) ($sectionSubjectCounts[$sectionId] ?? 0);
if (! $stat) {
if ($expectedDays === 0) {
$stat = [
@@ -113,12 +115,14 @@
$submissionLabel = $expectedDays > 0
? ('Submitted: ' . (int) $stat['submitted'] . ' / ' . (int) $expectedDays . ' (' . $percentLabel . ')')
: 'Submitted: N/A';
$subjectLabel = 'Subjects: ' . $subjectCount;
?>
<div class="accordion-item mb-2">
<h2 class="accordion-header" id="<?= esc($headingId) ?>">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#<?= esc($collapseId) ?>" aria-expanded="false" aria-controls="<?= esc($collapseId) ?>">
<?= esc($sectionName) ?>
<span class="badge <?= esc($stat['badgeClass']) ?> ms-2"><?= esc($submissionLabel) ?></span>
<span class="badge bg-info text-dark ms-2"><?= esc($subjectLabel) ?></span>
<?php if ($hasReports): ?>
<span class="badge bg-secondary ms-2"><?= count($sectionGroups) ?> weeks</span>
<?php endif; ?>