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 {
|
||||
nom: string
|
||||
note: number
|
||||
score: number
|
||||
commentaire: string
|
||||
}
|
||||
|
||||
export interface Exercice {
|
||||
titre: string
|
||||
contenu: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Rapport de correction renvoyé par `POST /corrections/ee` ou `POST /corrections/eo`.
|
||||
* Timeout 30 s (DeepSeek/Gemini — cf. api.ts).
|
||||
|
|
@ -40,7 +35,7 @@ export interface Report {
|
|||
erreurs: string[] // feature : detailed_report
|
||||
modele: string // feature : tips — 1re phrase 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`. */
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import { useRapport } from '../hooks/useRapport'
|
|||
import { Card } from '@/shared/ui/Card'
|
||||
import { Badge } from '@/shared/ui/Badge'
|
||||
import { Button } from '@/shared/ui/Button'
|
||||
import type { Critere, Exercice } from '@/entities/report/types'
|
||||
import type { Critere } from '@/entities/report/types'
|
||||
|
||||
// ── 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">
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<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 className="text-sm text-ink-3">
|
||||
<ReactMarkdown
|
||||
|
|
@ -87,13 +87,12 @@ function CritereRow({ critere }: { critere: Critere }) {
|
|||
)
|
||||
}
|
||||
|
||||
function ExerciceCard({ exercice }: { exercice: Exercice }) {
|
||||
function ExerciceCard({ exercice }: { exercice: string }) {
|
||||
return (
|
||||
<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">
|
||||
<ReactMarkdown disallowedElements={['script', 'iframe']}>
|
||||
{exercice.contenu}
|
||||
{exercice}
|
||||
</ReactMarkdown>
|
||||
</div>
|
||||
</li>
|
||||
|
|
@ -278,8 +277,8 @@ export function RapportPage() {
|
|||
onUpgrade={onUpgrade}
|
||||
>
|
||||
<ul className="space-y-3">
|
||||
{rapport.exercices.map((ex) => (
|
||||
<ExerciceCard key={ex.titre} exercice={ex} />
|
||||
{rapport.exercices.map((ex, i) => (
|
||||
<ExerciceCard key={i} exercice={ex} />
|
||||
))}
|
||||
</ul>
|
||||
</BlurredSection>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue