feat: Configuration du mode de notation par établissement
Les établissements scolaires utilisent des systèmes d'évaluation variés (notes /20, /10, lettres, compétences, sans notes). Jusqu'ici l'application imposait implicitement le mode notes /20, ce qui ne correspondait pas à la réalité pédagogique de nombreuses écoles. Cette configuration permet à chaque établissement de choisir son mode de notation par année scolaire, avec verrouillage automatique dès que des notes ont été saisies pour éviter les incohérences. Le Score Sérénité adapte ses pondérations selon le mode choisi (les compétences sont converties via un mapping, le mode sans notes exclut la composante notes).
This commit is contained in:
@@ -14,6 +14,7 @@ use App\Administration\Domain\Exception\PeriodsOverlapException;
|
||||
use App\Administration\Domain\Model\AcademicYear\DefaultPeriods;
|
||||
use App\Administration\Domain\Model\AcademicYear\PeriodType;
|
||||
use App\Administration\Domain\Model\SchoolClass\AcademicYearId;
|
||||
use App\Administration\Domain\Model\SchoolClass\SchoolId;
|
||||
use App\Administration\Infrastructure\Persistence\InMemory\InMemoryPeriodConfigurationRepository;
|
||||
use App\Administration\Infrastructure\Service\NoOpGradeExistenceChecker;
|
||||
use App\Shared\Domain\Clock;
|
||||
@@ -54,7 +55,7 @@ final class UpdatePeriodHandlerTest extends TestCase
|
||||
}
|
||||
|
||||
#[Test]
|
||||
public function itUpdatesPeriodDates(): void
|
||||
public function itRejectsOverlappingPeriodDates(): void
|
||||
{
|
||||
$this->seedTrimesterConfig();
|
||||
|
||||
@@ -124,13 +125,7 @@ final class UpdatePeriodHandlerTest extends TestCase
|
||||
{
|
||||
$this->seedTrimesterConfig();
|
||||
|
||||
$gradeChecker = new class implements GradeExistenceChecker {
|
||||
#[Override]
|
||||
public function hasGradesInPeriod(TenantId $tenantId, AcademicYearId $academicYearId, int $periodSequence): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
};
|
||||
$gradeChecker = $this->createGradeCheckerWithGrades();
|
||||
|
||||
$handler = new UpdatePeriodHandler($this->repository, $gradeChecker, $this->clock, $this->eventBus);
|
||||
|
||||
@@ -150,13 +145,7 @@ final class UpdatePeriodHandlerTest extends TestCase
|
||||
{
|
||||
$this->seedTrimesterConfig();
|
||||
|
||||
$gradeChecker = new class implements GradeExistenceChecker {
|
||||
#[Override]
|
||||
public function hasGradesInPeriod(TenantId $tenantId, AcademicYearId $academicYearId, int $periodSequence): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
};
|
||||
$gradeChecker = $this->createGradeCheckerWithGrades();
|
||||
|
||||
$handler = new UpdatePeriodHandler($this->repository, $gradeChecker, $this->clock, $this->eventBus);
|
||||
|
||||
@@ -172,6 +161,23 @@ final class UpdatePeriodHandlerTest extends TestCase
|
||||
self::assertSame('2025-09-02', $config->periods[0]->startDate->format('Y-m-d'));
|
||||
}
|
||||
|
||||
private function createGradeCheckerWithGrades(): GradeExistenceChecker
|
||||
{
|
||||
return new class implements GradeExistenceChecker {
|
||||
#[Override]
|
||||
public function hasGradesInPeriod(TenantId $tenantId, AcademicYearId $academicYearId, int $periodSequence): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#[Override]
|
||||
public function hasGradesForYear(TenantId $tenantId, SchoolId $schoolId, AcademicYearId $academicYearId): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private function seedTrimesterConfig(): void
|
||||
{
|
||||
$config = DefaultPeriods::forType(PeriodType::TRIMESTER, 2025);
|
||||
|
||||
Reference in New Issue
Block a user