Made it so the timer is more dynamic
This commit is contained in:
@@ -53,10 +53,6 @@ export default function Finish({user, scores, modules, isLoading, onViewResults}
|
||||
},
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
console.log({selectedScore, selectedModule, scores});
|
||||
}, [scores, selectedModule, selectedScore]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="w-full min-h-full h-fit flex flex-col items-center justify-between gap-8">
|
||||
|
||||
@@ -27,6 +27,12 @@ export default function Listening({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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user