From 5645139c74f78d9120eea30343cd7f784bc9592c Mon Sep 17 00:00:00 2001 From: Kirkland Brown Date: Mon, 8 Jul 2024 10:22:32 -0400 Subject: [PATCH] Updating QuestionData answer to match Question answer during deletion --- src/digital-components/question-chain/question-chain.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/digital-components/question-chain/question-chain.vue b/src/digital-components/question-chain/question-chain.vue index 5f72221f..217c6dcb 100644 --- a/src/digital-components/question-chain/question-chain.vue +++ b/src/digital-components/question-chain/question-chain.vue @@ -123,7 +123,7 @@ export default { const answeredQuestions = []; // TODO: This forEach could probably be converted into something more reactive - this.questions.forEach((q) => { + this.questions.forEach((q, index) => { // find this question and mark it as "answered" by populating answerSelected if (q.questionSequence === questionNum) { q.answerSelected = returnedAnswer; @@ -134,6 +134,7 @@ export default { // (needed in case user is changing previously answered questions) if (q.questionSequence > questionNum) { delete q.answerSelected; + delete this.questionData[index].answerSelected; } if (q.answerSelected) { answeredQuestions.push({