apply the school year concept
Tests / PHPUnit (push) Failing after 1m19s

This commit is contained in:
root
2026-07-14 00:59:00 -04:00
parent 504c3bc9f9
commit feb1b29a32
73 changed files with 4288 additions and 620 deletions
@@ -54,6 +54,11 @@ class CompetitionWinnersController extends BaseController
public function index()
{
$competitionModel = new CompetitionModel();
$schoolYear = $this->currentCompetitionSchoolYear();
if ($schoolYear !== '') {
$competitionModel->where('school_year', $schoolYear);
}
$competitions = $competitionModel
->orderBy('id', 'DESC')
@@ -62,12 +67,13 @@ class CompetitionWinnersController extends BaseController
return view('admin/competition_winners/index', [
'competitions' => $competitions,
'sectionMap' => $this->getClassSectionMap(),
'schoolYear' => $schoolYear,
]);
}
public function create()
{
$schoolYear = $this->configModel->getConfig('school_year');
$schoolYear = $this->currentCompetitionSchoolYear();
$classCounts = $this->getClassStudentCounts($schoolYear);
$classSections = $this->classSectionModel
->orderBy('class_section_name', 'ASC')
@@ -1088,6 +1094,11 @@ class CompetitionWinnersController extends BaseController
return $questionCounts;
}
private function currentCompetitionSchoolYear(): string
{
return $this->currentSchoolYearName((string) ($this->configModel->getConfig('school_year') ?? ''));
}
private function getClassSectionMap(): array
{
$sections = $this->classSectionModel