Forgot to save TextComponent, and cleanup some warnings
This commit is contained in:
@@ -53,7 +53,7 @@ export default function Level({ exam, showSolutions = false, onFinish, editing =
|
||||
if (showSolutions && exerciseIndex && userSolutions[exerciseIndex].shuffleMaps) {
|
||||
setShuffleMaps(userSolutions[exerciseIndex].shuffleMaps as ShuffleMap[])
|
||||
}
|
||||
}, [showSolutions])
|
||||
}, [showSolutions, exerciseIndex, setShuffleMaps, userSolutions])
|
||||
|
||||
useEffect(() => {
|
||||
if (hasExamEnded && exerciseIndex === -1) {
|
||||
@@ -99,6 +99,7 @@ export default function Level({ exam, showSolutions = false, onFinish, editing =
|
||||
|
||||
setShuffleMaps(newShuffleMaps);
|
||||
} else {
|
||||
console.log("retrieving shuffles");
|
||||
exercise.questions = exercise.questions.map(question => {
|
||||
const questionShuffleMap = shuffleMaps.find(map => map.id === question.id);
|
||||
if (questionShuffleMap) {
|
||||
@@ -148,6 +149,7 @@ export default function Level({ exam, showSolutions = false, onFinish, editing =
|
||||
if (exerciseIndex !== -1) {
|
||||
setCurrentExercise(getExercise());
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [partIndex, exerciseIndex, shuffleMaps, exam.parts[partIndex].context]);
|
||||
|
||||
|
||||
@@ -173,6 +175,7 @@ export default function Level({ exam, showSolutions = false, onFinish, editing =
|
||||
setContextWord(undefined);
|
||||
}
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [currentExercise, storeQuestionIndex]);
|
||||
|
||||
const nextExercise = (solution?: UserSolution) => {
|
||||
@@ -269,6 +272,7 @@ export default function Level({ exam, showSolutions = false, onFinish, editing =
|
||||
if (exerciseIndex === -1) {
|
||||
nextExercise()
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [exerciseIndex])
|
||||
|
||||
const calculateExerciseIndex = () => {
|
||||
|
||||
Reference in New Issue
Block a user