You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SurveyCompleteView.vue 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template lang="pug">
  2. main.view--surveycomplete
  3. article(style='display: flex; flex-direction: column; align-items: center; text-align: center;')
  4. h2 Thanks for Completing Our Survey!!
  5. h1 Please review your answers and let us know if you need to change anything.
  6. br
  7. p(v-for='input in formInputs')
  8. p(v-for='(value, key) in answers')
  9. p(v-if='input.survey_stage == key && key !== "password"')
  10. p Your {{ key }}: {{ value }}
  11. br
  12. p(v-for='input in formDropdowns')
  13. p(v-for='(value, key) in answers')
  14. p(v-if='input.survey_stage == key')
  15. p Your {{ key }}: {{ value }}
  16. br
  17. p(v-for='(response, responseIndex) in questionResponses')
  18. p(v-for='(value, key) in answers')
  19. p(v-if='response.survey_stage == key')
  20. p Survey Question {{ responseIndex + 1 }}:
  21. p {{ key }}
  22. p You Answered: {{ value }}
  23. br
  24. w-button.ma1(@click="changeAnswers") Change Answers
  25. w-button.ma1(@click="finalSubmit") Submit Answers
  26. </template>
  27. <script>
  28. export default {
  29. props: {
  30. answers: {
  31. type: Object,
  32. default: () => ({}),
  33. },
  34. surveySteps: {
  35. type: Array,
  36. default: () => [],
  37. },
  38. },
  39. data: () => ({
  40. surveyObjects: [],
  41. formInputs: [],
  42. questionResponses: [],
  43. formDropdowns: [],
  44. }),
  45. created() {
  46. this.surveySteps.forEach((step) => {
  47. switch (step.component) {
  48. case 'FormInput':
  49. this.formInputs.push(step)
  50. break
  51. case 'FormDropdown':
  52. this.formDropdowns.push(step)
  53. break
  54. case 'QuestionResponse':
  55. this.questionResponses.push(step)
  56. break
  57. }
  58. })
  59. },
  60. }
  61. </script>