[FIX] current correct answers recorded incorrectly

This commit is contained in:
2021-11-27 20:36:07 +00:00
parent 42787c13f9
commit 99e68d848f

View File

@@ -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) {