Quiz: draw the question figure under the prompt (Question.figure)
This commit is contained in:
@@ -149,6 +149,8 @@ export interface Question {
|
|||||||
type: string;
|
type: string;
|
||||||
prompt: string;
|
prompt: string;
|
||||||
options: QuestionOption[];
|
options: QuestionOption[];
|
||||||
|
/** شکلِ سوال (همان قالبِ شکلِ درسها)؛ null یعنی شکل ندارد. */
|
||||||
|
figure?: DiagramSpec | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface NodeQuizQuestion extends Question {
|
export interface NodeQuizQuestion extends Question {
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import { ErrorState, InlineError, LoadingState, PrimaryButton, SecondaryButton,
|
|||||||
import { friendlyError } from '@/lib/errors';
|
import { friendlyError } from '@/lib/errors';
|
||||||
import { toFa } from '@/lib/format';
|
import { toFa } from '@/lib/format';
|
||||||
import { MathText } from '@/lib/MathText';
|
import { MathText } from '@/lib/MathText';
|
||||||
|
import { Diagram } from '@/diagram';
|
||||||
import { sounds } from '@/lib/sound';
|
import { sounds } from '@/lib/sound';
|
||||||
import { useGateHold } from '@/lib/useAsync';
|
import { useGateHold } from '@/lib/useAsync';
|
||||||
import { StreakCelebration, StreakFlame } from '@/components/StreakFlame';
|
import { StreakCelebration, StreakFlame } from '@/components/StreakFlame';
|
||||||
@@ -348,6 +349,7 @@ export function QuizScreen({ lessonId, nodeId }: { lessonId?: number; nodeId?: s
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<h2 className="whitespace-pre-line text-base font-bold leading-8 text-ink"><MathText text={question.prompt} /></h2>
|
<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>
|
||||||
|
|
||||||
<div className={shortOptions ? 'grid grid-cols-2 gap-2.5' : 'flex flex-col gap-2.5'}>
|
<div className={shortOptions ? 'grid grid-cols-2 gap-2.5' : 'flex flex-col gap-2.5'}>
|
||||||
|
|||||||
Reference in New Issue
Block a user