CSR-803: correction and tweaking of names
This commit is contained in:
parent
e6b27f2098
commit
9d38856241
6 changed files with 32 additions and 32 deletions
|
|
@ -7,7 +7,7 @@
|
||||||
:class="q.questionSequence === currentQuestionNum && 'current-question'"
|
:class="q.questionSequence === currentQuestionNum && 'current-question'"
|
||||||
:questionText="q.questionText"
|
:questionText="q.questionText"
|
||||||
:answers="q.answers"
|
:answers="q.answers"
|
||||||
:groupName="`question-${glassIndex}-${q.questionSequence}`"
|
:groupName="`question-${glassPieceIndex}-${q.questionSequence}`"
|
||||||
:modelValue="q.answerSelected"
|
:modelValue="q.answerSelected"
|
||||||
@update:modelValue="handleAnswer(q, $event)"
|
@update:modelValue="handleAnswer(q, $event)"
|
||||||
isRequired
|
isRequired
|
||||||
|
|
@ -32,7 +32,7 @@ export default {
|
||||||
questionData: Object,
|
questionData: Object,
|
||||||
validationRules: String,
|
validationRules: String,
|
||||||
modelValue: Object,
|
modelValue: Object,
|
||||||
glassIndex: Number,
|
glassPieceIndex: Number,
|
||||||
answerKey: String,
|
answerKey: String,
|
||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
|
|
@ -155,7 +155,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
answerResult: questionAnswer,
|
answerResult: questionAnswer,
|
||||||
answeredQuestions: answeredQuestions,
|
answeredQuestions: answeredQuestions,
|
||||||
glassIndex: this.glassIndex,
|
glassPieceIndex: this.glassPieceIndex,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -13,14 +13,14 @@
|
||||||
:manualHeadline="alertFewMoreQuestionsHeader"
|
:manualHeadline="alertFewMoreQuestionsHeader"
|
||||||
:manualCopy="alertFewMoreQuestionsCopy"
|
:manualCopy="alertFewMoreQuestionsCopy"
|
||||||
v-bind:isDismissible="false" />
|
v-bind:isDismissible="false" />
|
||||||
<div v-for="(glass, i) in questionsData" :key="glass.key">
|
<div v-for="(questionDatum, i) in questionsData" :key="questionDatum.key">
|
||||||
<questionChain
|
<questionChain
|
||||||
ref="questionChain"
|
ref="questionChain"
|
||||||
v-model="qPselectedAnswers2[glass.answerKey]"
|
v-model="selectedAnswers[questionDatum.answerKey]"
|
||||||
:questionData="glass.questions"
|
:questionData="questionDatum.questions"
|
||||||
:glassIndex="i"
|
:glassPieceIndex="i"
|
||||||
v-if="showThisQuestionChain(glass, i)"
|
v-if="showThisQuestionChain(questionDatum, i)"
|
||||||
:answerKey="glass.answerKey"
|
:answerKey="questionDatum.answerKey"
|
||||||
:validationRules="validationRules" />
|
:validationRules="validationRules" />
|
||||||
</div>
|
</div>
|
||||||
<funnel-footer
|
<funnel-footer
|
||||||
|
|
@ -55,7 +55,7 @@ export default {
|
||||||
currentGlassPieceIndex: Number,
|
currentGlassPieceIndex: Number,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
qPselectedAnswers2: {
|
selectedAnswers: {
|
||||||
get() {
|
get() {
|
||||||
return this.modelValue;
|
return this.modelValue;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
:alertFewMoreQuestionsCopy="AlertFewMoreQuestionsCopy"
|
:alertFewMoreQuestionsCopy="AlertFewMoreQuestionsCopy"
|
||||||
:questionsData="questionsData"
|
:questionsData="questionsData"
|
||||||
:validationRules="questions - required"
|
:validationRules="questions - required"
|
||||||
v-model="selectedAnswers2"
|
v-model="selectedAnswers"
|
||||||
@forwardButtonAction="forwardButtonAction"
|
@forwardButtonAction="forwardButtonAction"
|
||||||
@backButtonAction="backButtonAction"
|
@backButtonAction="backButtonAction"
|
||||||
:currentGlassPieceIndex="currentGlassPieceIndex" />
|
:currentGlassPieceIndex="currentGlassPieceIndex" />
|
||||||
|
|
@ -56,7 +56,7 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
questionsData: [],
|
questionsData: [],
|
||||||
selectedAnswers2: {},
|
selectedAnswers: {},
|
||||||
currentGlassPieceIndex: 0,
|
currentGlassPieceIndex: 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
@ -82,13 +82,13 @@ export default {
|
||||||
glass.questions = glass.capabilityQuestions;
|
glass.questions = glass.capabilityQuestions;
|
||||||
glass.answerKey = glass.glassLocation + "-" + glass.glassName;
|
glass.answerKey = glass.glassLocation + "-" + glass.glassName;
|
||||||
// reset selectedAnswers for this glass
|
// reset selectedAnswers for this glass
|
||||||
this.selectedAnswers2[glass.answerKey] = [];
|
this.selectedAnswers[glass.answerKey] = [];
|
||||||
|
|
||||||
const updatedGlass = this.setupInitialData(glass, i, alreadyAnsweredQuestions);
|
const updatedGlass = this.setupInitialData(glass, i, alreadyAnsweredQuestions);
|
||||||
|
|
||||||
// Set up watch for each set of glass questions
|
// Set up watch for each set of glass questions
|
||||||
this.$watch(
|
this.$watch(
|
||||||
"selectedAnswers2." + glass.answerKey,
|
"selectedAnswers." + glass.answerKey,
|
||||||
(newValue) => {
|
(newValue) => {
|
||||||
if (newValue && Object.keys(newValue).length > 0) {
|
if (newValue && Object.keys(newValue).length > 0) {
|
||||||
this.handleAnswerUpdates(newValue, glass.answerKey);
|
this.handleAnswerUpdates(newValue, glass.answerKey);
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
:alertFewMoreQuestionsCopy="AlertFewMoreQuestionsCopy"
|
:alertFewMoreQuestionsCopy="AlertFewMoreQuestionsCopy"
|
||||||
:questionsData="questionsData"
|
:questionsData="questionsData"
|
||||||
:validationRules="questions - required"
|
:validationRules="questions - required"
|
||||||
v-model="selectedAnswers2"
|
v-model="selectedAnswers"
|
||||||
@forwardButtonAction="forwardButtonAction"
|
@forwardButtonAction="forwardButtonAction"
|
||||||
@backButtonAction="backButtonAction"
|
@backButtonAction="backButtonAction"
|
||||||
:currentGlassPieceIndex="currentGlassPieceIndex" />
|
:currentGlassPieceIndex="currentGlassPieceIndex" />
|
||||||
|
|
@ -56,7 +56,7 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
questionsData: [],
|
questionsData: [],
|
||||||
selectedAnswers2: {},
|
selectedAnswers: {},
|
||||||
currentGlassPieceIndex: 0,
|
currentGlassPieceIndex: 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
@ -82,12 +82,12 @@ export default {
|
||||||
glass.questions = glass.parts[0].childPartQuestions;
|
glass.questions = glass.parts[0].childPartQuestions;
|
||||||
glass.answerKey = glass.glassLocation + "-" + glass.glassName;
|
glass.answerKey = glass.glassLocation + "-" + glass.glassName;
|
||||||
// reset selectedAnswers for this glass
|
// reset selectedAnswers for this glass
|
||||||
this.selectedAnswers2[glass.answerKey] = [];
|
this.selectedAnswers[glass.answerKey] = [];
|
||||||
|
|
||||||
const updatedGlass = this.setupInitialData(glass, i, alreadyAnsweredQuestions);
|
const updatedGlass = this.setupInitialData(glass, i, alreadyAnsweredQuestions);
|
||||||
|
|
||||||
this.$watch(
|
this.$watch(
|
||||||
"selectedAnswers2." + glass.answerKey,
|
"selectedAnswers." + glass.answerKey,
|
||||||
(newValue) => {
|
(newValue) => {
|
||||||
if (newValue && Object.keys(newValue).length > 0) {
|
if (newValue && Object.keys(newValue).length > 0) {
|
||||||
this.handleAnswerUpdates(newValue, glass.answerKey);
|
this.handleAnswerUpdates(newValue, glass.answerKey);
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,7 @@ export default {
|
||||||
"questionNum": 1,
|
"questionNum": 1,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"glassIndex": 0
|
"glassPieceIndex": 0
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -213,7 +213,7 @@ export default {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// limit duplicate search to glass pieces that follow after the currently being answered glass piece
|
// limit duplicate search to glass pieces that follow after the currently being answered glass piece
|
||||||
if (pieceIndex > answer.glassIndex) {
|
if (pieceIndex > answer.glassPieceIndex) {
|
||||||
let indexToSuppressTo;
|
let indexToSuppressTo;
|
||||||
// reset this glass piece, in case user is changing their previous answers
|
// reset this glass piece, in case user is changing their previous answers
|
||||||
glassPiece.answerData = null;
|
glassPiece.answerData = null;
|
||||||
|
|
@ -341,13 +341,13 @@ export default {
|
||||||
});
|
});
|
||||||
|
|
||||||
// set final answer data for the current answered glass part
|
// set final answer data for the current answered glass part
|
||||||
self.questionsData[answer.glassIndex].answerData = {
|
self.questionsData[answer.glassPieceIndex].answerData = {
|
||||||
answerResult: answer.answerResult,
|
answerResult: answer.answerResult,
|
||||||
answeredQuestions: answer.answeredQuestions,
|
answeredQuestions: answer.answeredQuestions,
|
||||||
};
|
};
|
||||||
|
|
||||||
// this part has been fully answered, so advance to next part's question chain
|
// this part has been fully answered, so advance to next part's question chain
|
||||||
for (let i = answer.glassIndex + 1; i < this.questionsData.length; i++) {
|
for (let i = answer.glassPieceIndex + 1; i < this.questionsData.length; i++) {
|
||||||
// if this part has not yet been fully answered, then make it the current part
|
// if this part has not yet been fully answered, then make it the current part
|
||||||
if (!this.questionsData[i].answerData?.answerResult) {
|
if (!this.questionsData[i].answerData?.answerResult) {
|
||||||
this.currentGlassPieceIndex = i;
|
this.currentGlassPieceIndex = i;
|
||||||
|
|
|
||||||
|
|
@ -425,7 +425,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
questionNum: 1,
|
questionNum: 1,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
glassIndex: 0,
|
glassPieceIndex: 0,
|
||||||
};
|
};
|
||||||
const { wrapper } = setupMocks({});
|
const { wrapper } = setupMocks({});
|
||||||
|
|
||||||
|
|
@ -459,7 +459,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
questionNum: 1,
|
questionNum: 1,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
glassIndex: 0,
|
glassPieceIndex: 0,
|
||||||
};
|
};
|
||||||
const { wrapper } = setupMocks({});
|
const { wrapper } = setupMocks({});
|
||||||
|
|
||||||
|
|
@ -495,7 +495,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
questionNum: 1,
|
questionNum: 1,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
glassIndex: 0,
|
glassPieceIndex: 0,
|
||||||
};
|
};
|
||||||
const { wrapper } = setupMocks({});
|
const { wrapper } = setupMocks({});
|
||||||
|
|
||||||
|
|
@ -532,7 +532,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
questionNum: 1,
|
questionNum: 1,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
glassIndex: 0,
|
glassPieceIndex: 0,
|
||||||
};
|
};
|
||||||
const { wrapper } = setupMocks({});
|
const { wrapper } = setupMocks({});
|
||||||
|
|
||||||
|
|
@ -609,7 +609,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
questionNum: 1,
|
questionNum: 1,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
glassIndex: 0,
|
glassPieceIndex: 0,
|
||||||
};
|
};
|
||||||
const { wrapper } = setupMocks({});
|
const { wrapper } = setupMocks({});
|
||||||
|
|
||||||
|
|
@ -681,7 +681,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
questionNum: 1,
|
questionNum: 1,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
glassIndex: 0,
|
glassPieceIndex: 0,
|
||||||
};
|
};
|
||||||
const { wrapper } = setupMocks({});
|
const { wrapper } = setupMocks({});
|
||||||
|
|
||||||
|
|
@ -752,7 +752,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
questionNum: 1,
|
questionNum: 1,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
glassIndex: 0,
|
glassPieceIndex: 0,
|
||||||
};
|
};
|
||||||
const { wrapper } = setupMocks({});
|
const { wrapper } = setupMocks({});
|
||||||
|
|
||||||
|
|
@ -855,7 +855,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
questionNum: 1,
|
questionNum: 1,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
glassIndex: 0,
|
glassPieceIndex: 0,
|
||||||
};
|
};
|
||||||
const { wrapper } = setupMocks({});
|
const { wrapper } = setupMocks({});
|
||||||
|
|
||||||
|
|
@ -1003,7 +1003,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
questionNum: 1,
|
questionNum: 1,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
glassIndex: 0,
|
glassPieceIndex: 0,
|
||||||
};
|
};
|
||||||
const { wrapper } = setupMocks({});
|
const { wrapper } = setupMocks({});
|
||||||
|
|
||||||
|
|
@ -1115,7 +1115,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
questionNum: 1,
|
questionNum: 1,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
glassIndex: 0,
|
glassPieceIndex: 0,
|
||||||
};
|
};
|
||||||
const { wrapper } = setupMocks({});
|
const { wrapper } = setupMocks({});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue