Patched part divider, forgot to check if the exam had field intro
This commit is contained in:
@@ -70,7 +70,8 @@ export default function Level({ exam, showSolutions = false, onFinish, editing =
|
|||||||
userSolutions: userSolutions.find((x) => x.exercise === exercise.id)?.solutions || [],
|
userSolutions: userSolutions.find((x) => x.exercise === exercise.id)?.solutions || [],
|
||||||
};
|
};
|
||||||
|
|
||||||
if (exam.shuffle && exercise.type === "multipleChoice") {
|
if (exam.shuffle && exercise.type === "multipleChoice" && !showSolutions) {
|
||||||
|
console.log("Shuffling");
|
||||||
const exerciseShuffles = userSolutions[exerciseIndex].shuffleMaps;
|
const exerciseShuffles = userSolutions[exerciseIndex].shuffleMaps;
|
||||||
if (exerciseShuffles && exerciseShuffles.length == 0) {
|
if (exerciseShuffles && exerciseShuffles.length == 0) {
|
||||||
const newShuffleMaps: ShuffleMap[] = [];
|
const newShuffleMaps: ShuffleMap[] = [];
|
||||||
@@ -112,7 +113,7 @@ export default function Level({ exam, showSolutions = false, onFinish, editing =
|
|||||||
return question;
|
return question;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (exam.shuffle && exercise.type === "fillBlanks" && typeCheckWordsMC(exercise.words)) {
|
} else if (exam.shuffle && exercise.type === "fillBlanks" && typeCheckWordsMC(exercise.words) && !showSolutions) {
|
||||||
if (shuffleMaps.length === 0 && !showSolutions) {
|
if (shuffleMaps.length === 0 && !showSolutions) {
|
||||||
const newShuffleMaps: ShuffleMap[] = [];
|
const newShuffleMaps: ShuffleMap[] = [];
|
||||||
|
|
||||||
@@ -194,7 +195,7 @@ export default function Level({ exam, showSolutions = false, onFinish, editing =
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (partIndex + 1 < exam.parts.length && !hasExamEnded && (showQuestionsModal || showSolutions)) {
|
if (partIndex + 1 < exam.parts.length && !hasExamEnded && (showQuestionsModal || showSolutions)) {
|
||||||
if (!showSolutions) {
|
if (!showSolutions && exam.parts[0].intro) {
|
||||||
setShowPartDivider(true);
|
setShowPartDivider(true);
|
||||||
setBgColor(levelBgColor);
|
setBgColor(levelBgColor);
|
||||||
}
|
}
|
||||||
@@ -353,7 +354,7 @@ export default function Level({ exam, showSolutions = false, onFinish, editing =
|
|||||||
!(partIndex === 0 && storeQuestionIndex === 0 && showPartDivider) &&
|
!(partIndex === 0 && storeQuestionIndex === 0 && showPartDivider) &&
|
||||||
<Timer minTimer={exam.minTimer} disableTimer={showSolutions} standalone={true} />
|
<Timer minTimer={exam.minTimer} disableTimer={showSolutions} standalone={true} />
|
||||||
}
|
}
|
||||||
{showPartDivider ? <PartDivider part={exam.parts[partIndex]} partIndex={partIndex} onNext={() => { setShowPartDivider(false); setBgColor("bg-white") }} /> : (
|
{exam.parts[0].intro && showPartDivider ? <PartDivider part={exam.parts[partIndex]} partIndex={partIndex} onNext={() => { setShowPartDivider(false); setBgColor("bg-white") }} /> : (
|
||||||
<>
|
<>
|
||||||
<ModuleTitle
|
<ModuleTitle
|
||||||
partLabel={partLabel()}
|
partLabel={partLabel()}
|
||||||
|
|||||||
Reference in New Issue
Block a user