From cf2a3251ddd372c4df78d3efcbfb30248e09e5a5 Mon Sep 17 00:00:00 2001 From: AliReza Date: Mon, 12 Oct 2026 11:58:42 +0330 Subject: [PATCH] Quiz: draw the question figure under the prompt (Question.figure) --- src/api/types.ts | 2 ++ src/screens/QuizScreen.tsx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/api/types.ts b/src/api/types.ts index 3927e4a..a6a7d2d 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -149,6 +149,8 @@ export interface Question { type: string; prompt: string; options: QuestionOption[]; + /** شکلِ سوال (همان قالبِ شکلِ درس‌ها)؛ null یعنی شکل ندارد. */ + figure?: DiagramSpec | null; } export interface NodeQuizQuestion extends Question { diff --git a/src/screens/QuizScreen.tsx b/src/screens/QuizScreen.tsx index ac69c40..916e4b0 100644 --- a/src/screens/QuizScreen.tsx +++ b/src/screens/QuizScreen.tsx @@ -16,6 +16,7 @@ import { ErrorState, InlineError, LoadingState, PrimaryButton, SecondaryButton, import { friendlyError } from '@/lib/errors'; import { toFa } from '@/lib/format'; import { MathText } from '@/lib/MathText'; +import { Diagram } from '@/diagram'; import { sounds } from '@/lib/sound'; import { useGateHold } from '@/lib/useAsync'; import { StreakCelebration, StreakFlame } from '@/components/StreakFlame'; @@ -348,6 +349,7 @@ export function QuizScreen({ lessonId, nodeId }: { lessonId?: number; nodeId?: s

+ {question.figure ?
: null}