projectModel = $projectModel; } /** * Calculate the average project score for a student * * @param int $studentId * @param string $semester * @param string $schoolYear * @return array Returns ['project_avg' => float|null] * @throws \RuntimeException If no project scores are found */ public function calculate(int $studentId, string $semester, string $schoolYear, ?int $classSectionId = null): array { $average = $this->projectModel->getAverageProjectScore($studentId, $semester, $schoolYear, $classSectionId); return ['project_avg' => $average !== null ? (float) $average : null]; } }