diff --git a/src/exams/Level/index.tsx b/src/exams/Level/index.tsx index eb535c80..008897ae 100644 --- a/src/exams/Level/index.tsx +++ b/src/exams/Level/index.tsx @@ -67,13 +67,6 @@ 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; }>({ @@ -108,6 +101,14 @@ const Level: React.FC> = ({ exam, showSolutions = false, pr } ); + const hasPractice = useMemo(() => { + if (partIndex > -1 && partIndex < exam.parts.length && !showPartDivider) { + console.log(exam.parts[partIndex].exercises.some(e => e.isPractice)) + return exam.parts[partIndex].exercises.some(e => e.isPractice) + } + return false + }, [partIndex, showPartDivider, exam.parts]) + const registerSolution = useCallback((updateSolution: () => UserSolution) => { userSolutionRef.current = updateSolution; setSolutionWasUpdated(true); @@ -344,7 +345,7 @@ const Level: React.FC> = ({ exam, showSolutions = false, pr return ( <>
- +