From b52259794e3c793fddb74ed6b0e27a6e65c38ed1 Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Mon, 30 Dec 2024 11:11:44 +0000 Subject: [PATCH] ENCOA-298 --- src/exams/Level/index.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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 ( <>
- +