From b2fcb9d3a7a3a55fd94b59b4161113ad281f980e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Fern=C3=A1ndez=20Noriega?= Date: Sun, 10 Mar 2024 12:59:13 +0100 Subject: [PATCH] Corrected correctFlag not being stored --- questionservice/question-service.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/questionservice/question-service.js b/questionservice/question-service.js index aec6f7d..68306fd 100644 --- a/questionservice/question-service.js +++ b/questionservice/question-service.js @@ -67,7 +67,9 @@ class WIQ_API{ chosenNums = [] //Choose a random country of the chosen to make the question - const chosenCountry = countries[this.#getRandomNumNotInSetAndUpdate(numOfChosen,chosenNums)] + const chosenNum = this.#getRandomNumNotInSetAndUpdate(numOfChosen,chosenNums) + const chosenCountry = countries[chosenNum] + correctAnswerFlag = imgs[chosenNum] const questionAndFlags = { question: `Which of the following flags belongs to ${chosenCountry}?`,