recreate project

This commit is contained in:
root
2026-02-10 22:11:06 -05:00
commit 663c0cdbda
10149 changed files with 1379710 additions and 0 deletions
@@ -0,0 +1,32 @@
<?php
namespace App\Services\Calculators;
use App\Interfaces\ScoreCalculatorInterface;
use App\Models\ProjectModel;
class ProjectCalculator implements ScoreCalculatorInterface
{
private $projectModel;
public function __construct(ProjectModel $projectModel)
{
$this->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];
}
}