getEducationStudent()->getAccess()->getOrganization()->getParameters()->getAverage(); return $this->calculNotationByAMaxNote($educationNotation, $noteMax); } /** * Fonction permettant de retrouver la note calculé par rapport à la note maximale du critère de notation possible définie par la structure * @param EducationNotation $educationNotation * @return float|null * @see EducationNotationUtilsTest::testGetNotationOriginal() */ public function getNotationOriginal(EducationNotation $educationNotation): ?float { if(!$educationNotation->getCriteriaNotation()) { return null; } $noteMax = $educationNotation->getCriteriaNotation()->getNoteMax(); return $this->calculNotationByAMaxNote($educationNotation, $noteMax); } /** * Recalcule une note sur 100 par rapport à la nouvelle note maximale passée en paramètre. * * Les notes sont toutes enregistrées sur 100 dans la DB, cette méthode permet de recalculer la note en fonction * de la note maximale de l'école. * * @param EducationNotation $educationNotation * @param float $noteMax * @return float|null */ protected function calculNotationByAMaxNote(EducationNotation $educationNotation, float $noteMax): ?float { if( is_null($educationNotation->getNote()) || !$educationNotation->getCriteriaNotation() || $educationNotation->getCriteriaNotation()->getType() !== TypeCriteriaEnum::WITH_NOTATION()->getValue() ) { return null; } $note = ($educationNotation->getNote() * $noteMax) / 100; return round ( (float)$note , 2 ); } }