feat: Calculer automatiquement les moyennes après chaque saisie de notes
Les enseignants ont besoin de moyennes à jour immédiatement après la publication ou modification des notes, sans attendre un batch nocturne. Le système recalcule via Domain Events synchrones : statistiques d'évaluation (min/max/moyenne/médiane), moyennes matières pondérées (normalisation /20), et moyenne générale par élève. Les résultats sont stockés dans des tables dénormalisées avec cache Redis (TTL 5 min). Trois endpoints API exposent les données avec contrôle d'accès par rôle. Une commande console permet le backfill des données historiques au déploiement.
This commit is contained in:
@@ -74,7 +74,7 @@ async function loginAsTeacher(page: import('@playwright/test').Page) {
|
||||
await page.locator('#email').fill(TEACHER_EMAIL);
|
||||
await page.locator('#password').fill(TEACHER_PASSWORD);
|
||||
await Promise.all([
|
||||
page.waitForURL(/\/dashboard/, { timeout: 30000 }),
|
||||
page.waitForURL(/\/dashboard/, { timeout: 60000 }),
|
||||
page.getByRole('button', { name: /se connecter/i }).click()
|
||||
]);
|
||||
}
|
||||
@@ -435,12 +435,14 @@ test.describe('Homework Management (Story 5.1)', () => {
|
||||
await editorVal.click();
|
||||
await editorVal.pressSequentially('Test validation');
|
||||
|
||||
// Set a past date — fill() works with Svelte 5 bind:value
|
||||
const yesterday = new Date();
|
||||
yesterday.setDate(yesterday.getDate() - 1);
|
||||
const y = yesterday.getFullYear();
|
||||
const m = String(yesterday.getMonth() + 1).padStart(2, '0');
|
||||
const d = String(yesterday.getDate()).padStart(2, '0');
|
||||
// Set a past weekday — must be Mon-Fri to avoid frontend weekend validation
|
||||
const pastDay = new Date();
|
||||
do {
|
||||
pastDay.setDate(pastDay.getDate() - 1);
|
||||
} while (pastDay.getDay() === 0 || pastDay.getDay() === 6);
|
||||
const y = pastDay.getFullYear();
|
||||
const m = String(pastDay.getMonth() + 1).padStart(2, '0');
|
||||
const d = String(pastDay.getDate()).padStart(2, '0');
|
||||
const pastDate = `${y}-${m}-${d}`;
|
||||
await page.locator('#hw-due-date').fill(pastDate);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user