|
85 | 85 | questions: [ |
86 | 86 | new QuestionModel({ |
87 | 87 | id: 'first_name', |
88 | | - title: "Hi! Welcome to our demo survey 😊", |
89 | | - question: 'What is your first name?', |
| 88 | + tagline: "Hi! Welcome to our demo survey 😊", |
| 89 | + title: 'What is your first name?', |
90 | 90 | type: QuestionType.Text, |
91 | 91 | required: true, |
92 | 92 | placeholder: 'Start typing here...' |
93 | 93 | }), |
94 | 94 | new QuestionModel({ |
95 | 95 | id: 'email', |
96 | | - title: "Nice to meet you 👀, let's continue", |
97 | | - question: "Provide an example email.", |
| 96 | + tagline: "Nice to meet you 👀, let's continue", |
| 97 | + title: "Provide an example email.", |
98 | 98 | type: QuestionType.Email, |
99 | 99 | required: true, |
100 | 100 | placeholder: 'Start typing here...' |
101 | 101 | }), |
102 | 102 | new QuestionModel({ |
103 | 103 | id: 'phone', |
104 | | - question: 'Doing great! 👍 Go ahead and try with a phone number.', |
| 104 | + title: 'Doing great! 👍 Go ahead and try with a phone number.', |
105 | 105 | type: QuestionType.Phone, |
106 | 106 | required: true, |
107 | 107 | mask: '(###) ###-####' |
108 | 108 | }), |
109 | 109 | new QuestionModel({ |
110 | 110 | id: 'movies', |
111 | | - question: 'List your favorite movies. 🍿', |
| 111 | + title: 'List your favorite movies. 🍿', |
112 | 112 | type: QuestionType.LongText, |
113 | 113 | required: true, |
114 | 114 | placeholder: 'Start typing here...' |
115 | 115 | }), |
116 | 116 | new QuestionModel({ |
117 | 117 | id: 'multiple_choice', |
118 | | - title: "FYI, You can always go back 👈, use the up arrow on the bottom.", |
119 | | - question: 'Multiple choice question:', |
| 118 | + tagline: "FYI, You can always go back 👈, use the up arrow on the bottom.", |
| 119 | + title: 'Multiple choice question:', |
120 | 120 | type: QuestionType.MultipleChoice, |
121 | 121 | multiple: false, |
122 | 122 | allowOther: true, |
|
135 | 135 | }), |
136 | 136 | new QuestionModel({ |
137 | 137 | id: 'multiple_choices', |
138 | | - question: 'Multiple choices question:', |
| 138 | + title: 'Multiple choices question:', |
139 | 139 | type: QuestionType.MultipleChoice, |
140 | 140 | multiple: true, |
141 | 141 | helpText: 'Select all that apply. 👇', |
|
157 | 157 | }), |
158 | 158 | new QuestionModel({ |
159 | 159 | id: 'break_1', |
160 | | - /* eslint-disable-next-line no-unused-vars */ |
161 | | - content(h) { |
162 | | - return <span> |
163 | | - <span class="fh2">Awesome, thank you. 🙏</span> |
164 | | - <span class="section-text">You arrived at the section break of our little demo survey. To continue exploring, just press enter or use the continue button.</span> |
165 | | - </span> |
166 | | - }, |
| 160 | + title: 'Awesome, thank you. 🙏', |
| 161 | + content: 'You arrived at the section break of our little demo survey. To continue exploring, just press enter or use the continue button.', |
167 | 162 | description: 'Note: We will take a look at our multiple path feature next.', |
168 | 163 | type: QuestionType.SectionBreak |
169 | 164 | }), |
170 | 165 | new QuestionModel({ |
171 | 166 | id: 'choose_path', |
172 | | - title: "Where would you like to go? 🤔", |
173 | | - question: 'Choose your path:', |
| 167 | + tagline: "Where would you like to go? 🤔", |
| 168 | + title: 'Choose your path:', |
174 | 169 | type: QuestionType.Dropdown, |
175 | 170 | multiple: false, |
176 | 171 | placeholder: 'Select', |
|
191 | 186 | }), |
192 | 187 | new QuestionModel({ |
193 | 188 | id: 'path_a', |
194 | | - /* eslint-disable-next-line no-unused-vars */ |
195 | | - content(h) { |
196 | | - return <span> |
197 | | - <span class="fh2">Excellent choice! 🥳</span> |
198 | | - <span class="section-text">Press enter or use the continue button for the final submit screen.</span> |
199 | | - </span> |
200 | | - }, |
| 189 | + title: 'Excellent choice! 🥳', |
| 190 | + content: 'Press enter or use the continue button for the final submit screen.', |
201 | 191 | type: QuestionType.SectionBreak, |
202 | 192 | jump: { |
203 | 193 | _other: '_submit' |
204 | 194 | } |
205 | 195 | }), |
206 | 196 | new QuestionModel({ |
207 | 197 | id: 'path_b', |
208 | | - title: "Path B", |
209 | | - question: 'Hmm, are you sure?', |
| 198 | + tagline: "Path B", |
| 199 | + title: 'Hmm, are you sure?', |
210 | 200 | subtitle: 'Path A sounds like a winner! 😉', |
211 | 201 | type: QuestionType.MultipleChoice, |
212 | 202 | multiple: false, |
|
284 | 274 | } |
285 | 275 |
|
286 | 276 | this.questions.forEach(question => { |
287 | | - if (question.question) { |
| 277 | + if (question.title) { |
288 | 278 | let answer = question.answer |
289 | 279 | if (typeof answer === 'object') { |
290 | 280 | answer = answer.join(', ') |
291 | 281 | } |
292 | 282 |
|
293 | | - data.questions.push(question.question) |
| 283 | + data.questions.push(question.title) |
294 | 284 | data.answers.push(answer) |
295 | 285 | } |
296 | 286 | }) |
|
0 commit comments