ADD SCHOOL YEAR MANAGEMENT
Tests / PHPUnit (push) Failing after 40s

This commit is contained in:
root
2026-07-12 02:21:39 -04:00
parent c7f67da9bf
commit e06ccc9cc0
36 changed files with 6722 additions and 327 deletions
@@ -730,18 +730,15 @@ class AdministratorController extends BaseController
->join('users u', 'u.id = tc.teacher_id', 'left')
->orderBy('cs.class_section_name', 'ASC');
$filteredQuery = clone $assignmentQuery;
// teacher_class assignments are scoped by school year only.
// The table has no semester column; semester filtering belongs on
// semester-specific records such as scores, comments, attendance,
// homework, and exam drafts.
if ($schoolYear !== '') {
$filteredQuery = $filteredQuery->where('tc.school_year', $schoolYear);
}
if (!empty($semesterCandidates)) {
$filteredQuery = $filteredQuery->whereIn('tc.semester', $semesterCandidates);
$assignmentQuery->where('tc.school_year', $schoolYear);
}
$assignmentRows = $filteredQuery->get()->getResultArray();
if (empty($assignmentRows) && ($schoolYear !== '' || $semester !== '')) {
$assignmentRows = $assignmentQuery->get()->getResultArray();
}
$assignmentRows = $assignmentQuery->get()->getResultArray();
$studentCounts = $this->studentClassModel->getStudentCountsBySection($schoolYear !== '' ? $schoolYear : null);
$sectionRows = $this->classSectionModel
@@ -873,14 +870,12 @@ class AdministratorController extends BaseController
continue;
}
$studentQuery = $this->studentClassModel
$studentEntries = $this->db->table('student_class')
->select('student_id')
->where('class_section_id', $classSectionId)
->where('school_year', $schoolYear);
if (!empty($semesterCandidates)) {
$studentQuery->whereIn('semester', $semesterCandidates);
}
$studentEntries = $studentQuery->findAll();
->where('school_year', $schoolYear)
->get()
->getResultArray();
if (empty($studentEntries)) {
$studentEntries = $this->studentClassModel
->select('student_id')