From 17c9cf905ad20f581325a1014a844b482c089af3 Mon Sep 17 00:00:00 2001 From: alanmcilwaine Date: Tue, 30 Sep 2025 12:01:08 +1300 Subject: [PATCH] fix(questionview): Player shouldn't be able to go back to previously answered question with arrows --- frontend/src/types/InactivityChecker.ts | 2 +- frontend/src/views/QuestionView.vue | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) 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 30734ec..e01915e 100644 --- a/frontend/src/views/QuestionView.vue +++ b/frontend/src/views/QuestionView.vue @@ -122,14 +122,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()) { @@ -151,12 +146,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); }