Quick fix related to the back button of the Listening Exam
This commit is contained in:
@@ -120,7 +120,7 @@ export default function Listening({ exam, showSolutions = false, preview = false
|
||||
}, [partIndex]);
|
||||
|
||||
useEffect(() => {
|
||||
if (showSolutions) return setExerciseIndex(-1);
|
||||
if (showSolutions) return setExerciseIndex(0);
|
||||
}, [setExerciseIndex, showSolutions]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -167,7 +167,16 @@ export default function Listening({ exam, showSolutions = false, preview = false
|
||||
]);
|
||||
};
|
||||
|
||||
const previousExercise = (solution?: UserSolution) => { };
|
||||
const previousExercise = (solution?: UserSolution) => {
|
||||
scrollToTop();
|
||||
if (solution)
|
||||
setUserSolutions([
|
||||
...userSolutions.filter((x) => x.exercise !== solution.exercise),
|
||||
{ ...solution, module: "listening", exam: exam.id }
|
||||
]);
|
||||
|
||||
setPartIndex(partIndex - 1)
|
||||
};
|
||||
|
||||
const nextPart = () => {
|
||||
scrollToTop()
|
||||
|
||||
Reference in New Issue
Block a user