Updating QuestionData answer to match Question answer during deletion
This commit is contained in:
parent
a484af7982
commit
5645139c74
1 changed files with 2 additions and 1 deletions
|
|
@ -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({
|
||||
|
|
|
|||
Loading…
Reference in a new issue