Made it so the timer is more dynamic

This commit is contained in:
Tiago Ribeiro
2023-07-27 20:25:57 +01:00
parent d38ca76182
commit d879f4afab
7 changed files with 88 additions and 11 deletions

View File

@@ -87,6 +87,12 @@ export default function Reading({exam, showSolutions = false, onFinish}: Props)
const [hasExamEnded, setHasExamEnded] = useExamStore((state) => [state.hasExamEnded, state.setHasExamEnded]);
useEffect(() => {
if (hasExamEnded && exerciseIndex === -1) {
setExerciseIndex((prev) => prev + 1);
}
}, [hasExamEnded, exerciseIndex]);
const confirmFinishModule = (keepGoing?: boolean) => {
if (!keepGoing) {
setShowBlankModal(false);