Corrected location to put logic
This commit is contained in:
parent
c54294eb87
commit
6b1019eea6
2 changed files with 8 additions and 8 deletions
|
|
@ -126,14 +126,6 @@ export default {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
async forwardButtonAction() {
|
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) => ({
|
const questionAnswersArray = this.questionsData.map((glass) => ({
|
||||||
glassLocation: glass.glassLocation,
|
glassLocation: glass.glassLocation,
|
||||||
glassName: glass.glassName,
|
glassName: glass.glassName,
|
||||||
|
|
|
||||||
|
|
@ -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
|
// advance the currentGlassIndex
|
||||||
self.currentGlassIndex = index;
|
self.currentGlassIndex = index;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue