I think I solved a bit of the time ended

This commit is contained in:
Tiago Ribeiro
2024-11-01 10:38:10 +00:00
parent f29daa0d94
commit ce353f34c7
2 changed files with 12 additions and 0 deletions

View File

@@ -27,6 +27,12 @@ export default function Speaking({exam, showSolutions = false, onFinish}: Props)
const {hasExamEnded, setHasExamEnded} = useExamStore((state) => state);
const {exerciseIndex, setExerciseIndex} = useExamStore((state) => state);
useEffect(() => {
if (hasExamEnded && exerciseIndex === -1) {
setExerciseIndex(exerciseIndex + 1);
}
}, [hasExamEnded, exerciseIndex, setExerciseIndex]);
const scrollToTop = () => Array.from(document.getElementsByTagName("body")).forEach((body) => body.scrollTo(0, 0));
const nextExercise = (solution?: UserSolution) => {