generated from muhtadeetaron/nextjs-template
fix(ui): fix timer reappearing after exam submission
This commit is contained in:
@ -27,8 +27,9 @@ export default function ExamPage() {
|
||||
if (fetchedTest?.metadata.time_limit_minutes) {
|
||||
resetTimer(fetchedTest.metadata.time_limit_minutes * 60, () => {
|
||||
// Timer ended → auto-submit exam
|
||||
stopTimer();
|
||||
submitExam(type);
|
||||
router.push(`/categories/${type}s`);
|
||||
router.push(`/exam/results`);
|
||||
});
|
||||
}
|
||||
});
|
||||
@ -56,6 +57,7 @@ export default function ExamPage() {
|
||||
|
||||
const handleSubmitExam = async (type: string) => {
|
||||
try {
|
||||
stopTimer();
|
||||
setIsSubmitting(true);
|
||||
await submitExam(type);
|
||||
router.push(`/exam/results`);
|
||||
|
||||
Reference in New Issue
Block a user