Added listening import, part divider was showing between questions because it was with exerciseIndex instead of partIndex, fixed a reorder bug when deleting questions

This commit is contained in:
Carlos-Mesquita
2024-11-15 02:51:27 +00:00
parent a18bdfcef6
commit e9b7bd14cc
3 changed files with 21 additions and 50 deletions

View File

@@ -79,7 +79,7 @@ export default function Level({ exam, showSolutions = false, onFinish, preview =
useEffect(() => {
if (!showSolutions && exam.parts[partIndex]?.intro !== undefined && exam.parts[partIndex]?.intro !== "" && !seenParts.has(exerciseIndex)) {
if (!showSolutions && exam.parts[partIndex]?.intro !== undefined && exam.parts[partIndex]?.intro !== "" && !seenParts.has(partIndex)) {
setShowPartDivider(true);
setBgColor(levelBgColor);
}
@@ -173,8 +173,6 @@ export default function Level({ exam, showSolutions = false, onFinish, preview =
setBgColor(levelBgColor);
}
setSeenParts(prev => new Set(prev).add(partIndex + 1));
if (partIndex < exam.parts.length - 1 && exam.parts[partIndex + 1].context && !textRenderDisabled) {
setTextRender(true);
}
@@ -223,7 +221,6 @@ export default function Level({ exam, showSolutions = false, onFinish, preview =
setBgColor(levelBgColor);
setShowPartDivider(true);
setQuestionIndex(0);
setSeenParts(prev => new Set(prev).add(partIndex - 1));
return;
}
@@ -520,7 +517,7 @@ export default function Level({ exam, showSolutions = false, onFinish, preview =
defaultTitle="Placement Test"
section={exam.parts[partIndex]}
sectionIndex={partIndex}
onNext={() => { setShowPartDivider(false); setStartNow(false); setBgColor("bg-white"); }}
onNext={() => { setShowPartDivider(false); setStartNow(false); setBgColor("bg-white"); setSeenParts(prev => new Set(prev).add(partIndex)); }}
/> : (
<>
{exam.parts[0].intro && (