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]);
|
}, [partIndex]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (showSolutions) return setExerciseIndex(-1);
|
if (showSolutions) return setExerciseIndex(0);
|
||||||
}, [setExerciseIndex, showSolutions]);
|
}, [setExerciseIndex, showSolutions]);
|
||||||
|
|
||||||
useEffect(() => {
|
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 = () => {
|
const nextPart = () => {
|
||||||
scrollToTop()
|
scrollToTop()
|
||||||
|
|||||||
Reference in New Issue
Block a user