Forgot to save TextComponent, and cleanup some warnings
This commit is contained in:
@@ -99,14 +99,17 @@ const TextComponent: React.FC<Props> = ({part, contextWord, setContextWordLine})
|
||||
});
|
||||
|
||||
if (textRef.current) {
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
resizeObserver.observe(textRef.current);
|
||||
}
|
||||
|
||||
return () => {
|
||||
if (textRef.current) {
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
resizeObserver.unobserve(textRef.current);
|
||||
}
|
||||
};
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [part.context, contextWord]);
|
||||
|
||||
/*if (typeof part.showContextLines === "undefined") {
|
||||
|
||||
@@ -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 = () => {
|
||||
|
||||
@@ -287,7 +287,7 @@ export default function ExamPage({page}: Props) {
|
||||
if(exam && exam.module === "level" && exam.parts[0].intro && !showSolutions) {
|
||||
setBgColor("bg-ielts-level-light");
|
||||
}
|
||||
}, [exam])
|
||||
}, [exam, showSolutions, setBgColor])
|
||||
|
||||
const checkIfStatsHaveBeenEvaluated = (ids: string[]) => {
|
||||
setTimeout(async () => {
|
||||
|
||||
Reference in New Issue
Block a user