Corrected location to put logic

This commit is contained in:
Kirkland Brown 2024-07-18 12:13:14 -04:00
parent c54294eb87
commit 6b1019eea6
2 changed files with 8 additions and 8 deletions

View file

@ -126,14 +126,6 @@ export default {
);
},
async forwardButtonAction() {
// match partQuestionAnswers to answerData
const questionNums = new Set(this.questionsData[0].answerData.answeredQuestions.map(obj => obj.questionNum));
this.questionsData[0].partQuestions.map(obj => {
if(!questionNums.has(obj.questionSequence)) {
delete obj.answerSelected
}
});
const questionAnswersArray = this.questionsData.map((glass) => ({
glassLocation: glass.glassLocation,
glassName: glass.glassName,

View file

@ -118,6 +118,14 @@ export default {
}
});
// remove any disabled dependent answers
const answerQuestionNums = new Set(alreadyAnsweredQuestions[alreadyAnsweredQuestions.length-1].answeredQuestions.map(q => q.questionNum));
glass.questions.map(q => {
if(!answerQuestionNums.has(q.questionSequence)) {
delete q.answerSelected
}
});
// advance the currentGlassIndex
self.currentGlassIndex = index;