CSR-111 Map answerResult value for question-chain component

This commit is contained in:
Katie 2022-08-15 12:13:18 -04:00
parent 2fd175711a
commit a2e0d73c11
2 changed files with 19 additions and 6 deletions

View file

@ -1,7 +1,5 @@
<template>
<div v-for="(q, i) in questions" :key="i">
{{ questions }}<br/>
{{q}}
<transition appear name="fade" mode="out-in">
<buttonQuestion
v-if="q.answerSelected || (q.questionSequence === currentQuestionNum)"

View file

@ -12,6 +12,7 @@
<funnelSubHeader cmsWidgetName="FunnelSubHeaderWidget" />
<div class="fade-on-route-transition sub-container make-tall">
<h1>CAPABILITY QUESTIONS TEMPORARY PLACEHOLDER</h1>
CQD: {{ capabilityQuestionsData }}
<alert
ref="alertFewMoreQuestions"
class="my-5"
@ -20,15 +21,15 @@
:manualCopy="AlertFewMoreQuestionsCopy"
v-bind:isDismissible="false"
/>
<div v-for="(question, i) in capabilityQuestionsData" :key="i">
<!-- <div v-for="(question, i) in capabilityQuestionsData" :key="i"> -->
<questionChain
ref="questionChain"
v-model="selectedModel"
:questionData="question"
:questionData="capabilityQuestionsData"
:partIndex="i"
validationRules="questions-required"
/>
</div>
<!-- </div> -->
<funnel-footer
ref="funnelFooter"
cmsWidgetName="FunnelFooterWidget"
@ -61,6 +62,7 @@ import { fmgPageValues } from "@/router/router-constants/fmgPage-values";
import { Form, defineRule } from "vee-validate";
import { required } from "@/helpers/validation-rules";
import { errorMessages } from "@/constants/error-messages";
import { result } from "lodash";
// DEFINE VALIDATION RULES
defineRule("questions-required", required(errorMessages.OPTION_REQUIRED));
@ -89,7 +91,20 @@ export default {
// Call the "next" function to complete the transition to this page.
next((vm) => {
vm.setCmsContent(resultMap.cmsContent);
vm.capabilityQuestionsData = resultMap.capabilityQuestions;
resultMap.capabilityQuestions.forEach(question => {
console.log(question.answers)
question.answers = question.answers.map(answer => {
return {
...answer,
answerResult: answer.answerResult1
}
})
// question.answers = question.answers
})
vm.capabilityQuestionsData = {
partQuestions: resultMap.capabilityQuestions
};
console.log("CQ: ", resultMap.capabilityQuestions)
});
},