forked from Tadrisino/MathApp_frontend
Quiz: draw the question figure under the prompt (Question.figure)
This commit is contained in:
@@ -149,6 +149,8 @@ export interface Question {
|
||||
type: string;
|
||||
prompt: string;
|
||||
options: QuestionOption[];
|
||||
/** شکلِ سوال (همان قالبِ شکلِ درسها)؛ null یعنی شکل ندارد. */
|
||||
figure?: DiagramSpec | null;
|
||||
}
|
||||
|
||||
export interface NodeQuizQuestion extends Question {
|
||||
|
||||
@@ -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
|
||||
</button>
|
||||
</div>
|
||||
<h2 className="whitespace-pre-line text-base font-bold leading-8 text-ink"><MathText text={question.prompt} /></h2>
|
||||
{question.figure ? <div className="mt-3"><Diagram spec={question.figure} /></div> : null}
|
||||
</div>
|
||||
|
||||
<div className={shortOptions ? 'grid grid-cols-2 gap-2.5' : 'flex flex-col gap-2.5'}>
|
||||
|
||||
Reference in New Issue
Block a user