From 99e68d848fe8fe89c22f7bcd733fcb988888a8f7 Mon Sep 17 00:00:00 2001 From: Matthew Grove Date: Sat, 27 Nov 2021 20:36:07 +0000 Subject: [PATCH] [FIX] current correct answers recorded incorrectly --- functions/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/functions/index.js b/functions/index.js index 55349b3..bd4dbea 100644 --- a/functions/index.js +++ b/functions/index.js @@ -611,10 +611,9 @@ exports.processAnswer = functions.https.onCall((data, context) => { } if (!prevCorrect) { - docData.current_correct = [splitCorrectAnswers[correctAnswerIndex]]; - // } else if (!prevCorrect.includes(splitCorrectAnswers[correctAnswerIndex])) { + docData.current_correct = [notDoneSplitCorrectAnswers[correctAnswerIndex]]; } else if (correctAnswerIndex < notDoneSplitCorrectAnswers.length) { - docData.current_correct.push(splitCorrectAnswers[correctAnswerIndex]); + docData.current_correct.push(notDoneSplitCorrectAnswers[correctAnswerIndex]); } if (docData.current_correct.length === splitCorrectAnswers.length) {