fix teacher submissions

This commit is contained in:
root
2026-03-30 18:46:04 -04:00
parent b2026812d5
commit b52475ff0b
8 changed files with 1012 additions and 70 deletions
@@ -111,6 +111,23 @@ class AdminProgressController extends BaseController
);
$sectionStats = $this->buildSectionSubmissionStats($rows, $activeDatesSet, $expectedDays);
$sectionSubjectCounts = $this->buildSectionSubjectCounts($rows);
$lowProgressSectionIds = [];
if ($expectedDays > 0) {
foreach ($filteredSections as $section) {
$sectionId = (int) ($section['class_section_id'] ?? 0);
if ($sectionId === 0) {
continue;
}
$stat = $sectionStats[$sectionId] ?? null;
$percent = $stat['percent'] ?? 0;
if ($stat === null) {
$percent = 0;
}
if ($percent < 50) {
$lowProgressSectionIds[] = $sectionId;
}
}
}
return view('admin/class_progress_list', [
'reportGroupsBySection' => $reportGroupsBySection,
@@ -121,6 +138,7 @@ class AdminProgressController extends BaseController
'sectionStats' => $sectionStats,
'sectionSubjectCounts' => $sectionSubjectCounts,
'expectedDays' => $expectedDays,
'lowProgressSectionIds' => $lowProgressSectionIds,
]);
}