fix(report): aligner types sur backend — note→score, exercices string[], supprimer Exercice
This commit is contained in:
parent
ef86da85d7
commit
fb3de2865f
2 changed files with 8 additions and 14 deletions
|
|
@ -18,15 +18,10 @@
|
||||||
|
|
||||||
export interface Critere {
|
export interface Critere {
|
||||||
nom: string
|
nom: string
|
||||||
note: number
|
score: number
|
||||||
commentaire: string
|
commentaire: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Exercice {
|
|
||||||
titre: string
|
|
||||||
contenu: string
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rapport de correction renvoyé par `POST /corrections/ee` ou `POST /corrections/eo`.
|
* Rapport de correction renvoyé par `POST /corrections/ee` ou `POST /corrections/eo`.
|
||||||
* Timeout 30 s (DeepSeek/Gemini — cf. api.ts).
|
* Timeout 30 s (DeepSeek/Gemini — cf. api.ts).
|
||||||
|
|
@ -40,7 +35,7 @@ export interface Report {
|
||||||
erreurs: string[] // feature : detailed_report
|
erreurs: string[] // feature : detailed_report
|
||||||
modele: string // feature : tips — 1re phrase visible pour Free
|
modele: string // feature : tips — 1re phrase visible pour Free
|
||||||
idees: string[] // feature : tips — 1er item visible pour Free
|
idees: string[] // feature : tips — 1er item visible pour Free
|
||||||
exercices: Exercice[] // feature : tips — titre visible pour Free
|
exercices: string[] // feature : tips — 1er item visible pour Free
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Corps de `POST /corrections/ee`. */
|
/** Corps de `POST /corrections/ee`. */
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ import { useRapport } from '../hooks/useRapport'
|
||||||
import { Card } from '@/shared/ui/Card'
|
import { Card } from '@/shared/ui/Card'
|
||||||
import { Badge } from '@/shared/ui/Badge'
|
import { Badge } from '@/shared/ui/Badge'
|
||||||
import { Button } from '@/shared/ui/Button'
|
import { Button } from '@/shared/ui/Button'
|
||||||
import type { Critere, Exercice } from '@/entities/report/types'
|
import type { Critere } from '@/entities/report/types'
|
||||||
|
|
||||||
// ── Composants internes ──────────────────────────────────────────────────────
|
// ── Composants internes ──────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
|
@ -73,7 +73,7 @@ function CritereRow({ critere }: { critere: Critere }) {
|
||||||
<li className="flex flex-col gap-1.5 rounded-lg border border-line bg-canvas-2 p-3">
|
<li className="flex flex-col gap-1.5 rounded-lg border border-line bg-canvas-2 p-3">
|
||||||
<div className="flex items-center justify-between gap-2">
|
<div className="flex items-center justify-between gap-2">
|
||||||
<span className="text-sm font-semibold text-ink-1">{critere.nom}</span>
|
<span className="text-sm font-semibold text-ink-1">{critere.nom}</span>
|
||||||
<Badge variant="neutral">{critere.note}</Badge>
|
<Badge variant="neutral">{critere.score}</Badge>
|
||||||
</div>
|
</div>
|
||||||
<div className="text-sm text-ink-3">
|
<div className="text-sm text-ink-3">
|
||||||
<ReactMarkdown
|
<ReactMarkdown
|
||||||
|
|
@ -87,13 +87,12 @@ function CritereRow({ critere }: { critere: Critere }) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function ExerciceCard({ exercice }: { exercice: Exercice }) {
|
function ExerciceCard({ exercice }: { exercice: string }) {
|
||||||
return (
|
return (
|
||||||
<li className="rounded-lg border border-line bg-canvas-2 p-4">
|
<li className="rounded-lg border border-line bg-canvas-2 p-4">
|
||||||
<p className="mb-2 text-sm font-semibold text-ink-1">{exercice.titre}</p>
|
|
||||||
<div className="text-sm leading-relaxed text-ink-3">
|
<div className="text-sm leading-relaxed text-ink-3">
|
||||||
<ReactMarkdown disallowedElements={['script', 'iframe']}>
|
<ReactMarkdown disallowedElements={['script', 'iframe']}>
|
||||||
{exercice.contenu}
|
{exercice}
|
||||||
</ReactMarkdown>
|
</ReactMarkdown>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
@ -278,8 +277,8 @@ export function RapportPage() {
|
||||||
onUpgrade={onUpgrade}
|
onUpgrade={onUpgrade}
|
||||||
>
|
>
|
||||||
<ul className="space-y-3">
|
<ul className="space-y-3">
|
||||||
{rapport.exercices.map((ex) => (
|
{rapport.exercices.map((ex, i) => (
|
||||||
<ExerciceCard key={ex.titre} exercice={ex} />
|
<ExerciceCard key={i} exercice={ex} />
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
</BlurredSection>
|
</BlurredSection>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue