diff --git a/src/exams/Level/index.tsx b/src/exams/Level/index.tsx index bfd8d739..eb535c80 100644 --- a/src/exams/Level/index.tsx +++ b/src/exams/Level/index.tsx @@ -25,6 +25,7 @@ import ProgressButtons from "../components/ProgressButtons"; import useExamNavigation from "../Navigation/useExamNavigation"; import { calculateExerciseIndex } from "../utils/calculateExerciseIndex"; import { defaultExamUserSolutions } from "@/utils/exams"; +import PracticeModal from "@/components/PracticeModal"; const Level: React.FC> = ({ exam, showSolutions = false, preview = false }) => { @@ -66,6 +67,12 @@ const Level: React.FC> = ({ exam, showSolutions = false, pr const [continueAnyways, setContinueAnyways] = useState(false); const [textRender, setTextRender] = useState(false); + const hasPractice = useMemo(() => { + if (partIndex > -1 && partIndex < exam.parts.length) { + return exam.parts[partIndex].exercises.some(e => e.isPractice) + } + return false + }, [partIndex, exam.parts]) const [questionModalKwargs, setQuestionModalKwargs] = useState<{ type?: "module" | "blankQuestions" | "submit"; unanswered?: boolean | undefined; onClose: (next?: boolean) => void | undefined; @@ -337,6 +344,7 @@ const Level: React.FC> = ({ exam, showSolutions = false, pr return ( <>
+ > = ({ exam, showSolutions = false, pr (!showPartDivider && !startNow) && } - {(showPartDivider || (startNow && partIndex === 0)) ? + {(showPartDivider || (startNow && partIndex === 0)) ?