Browse Source

checklist working

tags/0.0.1
diaseu 4 years ago
parent
commit
8bbf407ea3

+ 7
- 2
frontend/src/components/form.vue View File

@@ -23,13 +23,18 @@
23 23
                 ) {{ response }}
24 24
             //- TODO: Checklist
25 25
             .response-wrapper(v-if='prompt.type === "checklist"')
26
-                .checklist(v-for='response in prompt.responses')
26
+                .checklist(
27
+                    v-for='(response, index) in prompt.responses'
28
+                    v-bind:key='response')
27 29
                     input(
28 30
                         type='checkbox'
29 31
                         :id='response'
32
+                        :value='response'
30 33
                         :name='response'
34
+                        :true-value='response'
35
+                        false-value=''
31 36
                         v-model='answers[makeKebob(prompt.question)]')
32
-                    label {{ response}}
37
+                    label(:for='response') {{ response }}
33 38
             //- TODO: Slider from -3 to 0 to +3 (increments of 1)
34 39
             .response-wrapper(v-if='prompt.type === "slider"')
35 40
                 label {{ prompt.type }}

+ 2
- 2
frontend/src/services/survey.service.js View File

@@ -32,7 +32,7 @@ const fetchSurveyByProfileId = profileId => {
32 32
                 id: 3,
33 33
                 type: 'checklist',
34 34
                 question: 'what is your current status',
35
-                responses: ['employed', 'unemployed'],
35
+                responses: ['employed', 'unemployed', 'degenerate', 'alien'],
36 36
             },
37 37
         ],
38 38
         [
@@ -40,7 +40,7 @@ const fetchSurveyByProfileId = profileId => {
40 40
                 id: 4,
41 41
                 type: 'slider',
42 42
                 question: 'whats your favorite number',
43
-                responses: ['1', '2', '3'],
43
+                responses: null,
44 44
             },
45 45
         ],
46 46
     ]

+ 6
- 4
frontend/src/views/Survey.vue View File

@@ -40,19 +40,21 @@ article
40 40
     header
41 41
         color: #ccc
42 42
         font-style: italic
43
-    > *
43
+    header, footer, ul
44 44
         padding: 1vh
45 45
     ul
46 46
         display: flex
47
-        color: blue
47
+        /* color: blue */
48 48
         width: 100%
49 49
         li
50 50
             flex-direction: column
51 51
             border: 0px solid yellow
52 52
             width: 100%
53
+            padding: 0
54
+            text-align: left
53 55
             label
54 56
                 margin-right: 1vh
55
-            > *
57
+            > h3
56 58
                 text-transform: capitalize
57
-                padding: 1vh
59
+                padding: 1vh 0
58 60
 </style>

Loading…
Cancel
Save