diff --git a/frontend/src/types/InactivityChecker.ts b/frontend/src/types/InactivityChecker.ts index 7622b1b..8ee629d 100644 --- a/frontend/src/types/InactivityChecker.ts +++ b/frontend/src/types/InactivityChecker.ts @@ -35,7 +35,7 @@ export class InactivityChecker { /** Increments the inactivity timer and checks for inactivity */ private incrementTimer() { - this.currentTime += 0; + this.currentTime += 1000; if (this.currentTime >= this.inactivityThreshold) { this.handleInactivity(); } diff --git a/frontend/src/views/QuestionView.vue b/frontend/src/views/QuestionView.vue index 0b56fa0..3e7213a 100644 --- a/frontend/src/views/QuestionView.vue +++ b/frontend/src/views/QuestionView.vue @@ -124,14 +124,9 @@ const initializeQuestion = async () => { console.log("Questions:", questions.value); gameTimer.value = session.value.getGameTimer(); hasAnswered.value = await hasAnsweredQuestion(props.questionIndex); - - if (hasAnswered.value) { - goToNextRelevantQuestion(props.questionIndex); - return; - } - selectedOrder.value = new Map(); answerDisabled.value = await answeredAllQuestions(); + if (hasAnswered.value) { result.value = session.value.getAnswers()[props.questionIndex] ?? false; if (await answeredAllQuestions()) { @@ -153,12 +148,13 @@ const handleGameEnded = (data: any) => { }; onMounted(async () => { + // Listen for game end event + const session = await APIManager.getInstance().getSession(); + initializeQuestion(); // Add window resize listener for responsive scaling window.addEventListener('resize', calculateTreeScale); - // Listen for game end event - const session = await APIManager.getInstance().getSession(); if (session) { session.addEventListener("GAME_ENDED", handleGameEnded); }