PluginProbe
The Innovative Form Builder – IvyForms / 1.0
The Innovative Form Builder – IvyForms v1.0
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
ivyforms / backend / src / Services / Template / OnlineTrainingFeedbackFormTemplate.php

OnlineTrainingFeedbackFormTemplate.php in The Innovative Form Builder – IvyForms 1.0, at backend/src/Services/Template/OnlineTrainingFeedbackFormTemplate.php

315 lines 10.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace IvyForms\Services\Template;
4
5 use IvyForms\Services\Translations\BackendStrings;
6
7 class OnlineTrainingFeedbackFormTemplate
8 {
9 /**
10 * Get the Online Training Feedback Form template
11 *
12 * @return array<string, mixed>
13 */
14 public static function getTemplate(): array
15 {
16 return [
17 'id' => 'online_training_feedback_form',
18 'name' => BackendStrings::getTemplateStrings()['online_training_feedback_form'],
19 'description' => BackendStrings::getTemplateStrings()['online_training_feedback_form_desc'],
20 'category' => 'feedback-forms',
21 'subcategory' => 'training-feedback-forms',
22 'is_pro' => false,
23 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'online-training-feedback-form.svg',
24 'form_data' => [
25 'name' => BackendStrings::getTemplateStrings()['online_training_feedback_form'],
26 'published' => 1,
27 'showTitle' => 1,
28 'storeEntries' => 1,
29 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
30 'fields' => array_merge(
31 self::getDeviceUsedField(),
32 self::getPlatformUsabilityField(),
33 self::getOverallExperienceRatingField(),
34 self::getMaterialsQualityRatingField(),
35 self::getTechnicalIssuesField(),
36 self::getTechnicalCommentsField()
37 ),
38 'settings' => []
39 ]
40 ];
41 }
42
43 /**
44 * Device used dropdown
45 *
46 * @return array<int, array<string, mixed>>
47 */
48 private static function getDeviceUsedField(): array
49 {
50 return [[
51 'id' => 5,
52 'fieldIndex' => 1,
53 'type' => 'select',
54 'label' => BackendStrings::getTemplateStrings()['device_used'],
55 'placeholder' => BackendStrings::getTemplateStrings()['select_device_used'],
56 'required' => true,
57 'parentId' => null,
58 'defaultValue' => '',
59 'position' => 1,
60 'fieldOptions' => [
61 [
62 'id' => 1,
63 'label' => BackendStrings::getTemplateStrings()['desktop'],
64 'value' => 'desktop',
65 'isDefault' => false,
66 'position' => 1
67 ],
68 [
69 'id' => 2,
70 'label' => BackendStrings::getTemplateStrings()['laptop'],
71 'value' => 'laptop',
72 'isDefault' => false,
73 'position' => 2
74 ],
75 [
76 'id' => 3,
77 'label' => BackendStrings::getTemplateStrings()['tablet'],
78 'value' => 'tablet',
79 'isDefault' => false,
80 'position' => 3
81 ],
82 [
83 'id' => 4,
84 'label' => BackendStrings::getTemplateStrings()['mobile_phone'],
85 'value' => 'mobile_phone',
86 'isDefault' => false,
87 'position' => 4
88 ],
89 ]
90 ]];
91 }
92
93 /**
94 * Platform usability radio
95 *
96 * @return array<int, array<string, mixed>>
97 */
98 private static function getPlatformUsabilityField(): array
99 {
100 return [[
101 'id' => 10,
102 'fieldIndex' => 2,
103 'type' => 'radio',
104 'label' => BackendStrings::getTemplateStrings()['platform_usability'],
105 'required' => true,
106 'parentId' => null,
107 'defaultValue' => '',
108 'placeholder' => '',
109 'position' => 2,
110 'fieldOptions' => [
111 [
112 'id' => 6,
113 'label' => BackendStrings::getTemplateStrings()['very_easy_to_use'],
114 'value' => 'very_easy_to_use',
115 'isDefault' => false,
116 'position' => 1
117 ],
118 [
119 'id' => 7,
120 'label' => BackendStrings::getTemplateStrings()['easy_to_use'],
121 'value' => 'easy_to_use',
122 'isDefault' => false,
123 'position' => 2
124 ],
125 [
126 'id' => 8,
127 'label' => BackendStrings::getTemplateStrings()['neutral'],
128 'value' => 'neutral',
129 'isDefault' => false,
130 'position' => 3
131 ],
132 [
133 'id' => 9,
134 'label' => BackendStrings::getNewFormStrings()['difficult_to_use'],
135 'value' => 'difficult_to_use',
136 'isDefault' => false,
137 'position' => 4
138 ],
139 ]
140 ]];
141 }
142
143 /**
144 * Overall experience rating
145 *
146 * @return array<int, array<string, mixed>>
147 */
148 private static function getOverallExperienceRatingField(): array
149 {
150 return [[
151 'id' => 11,
152 'fieldIndex' => 3,
153 'type' => 'rating',
154 'label' => BackendStrings::getTemplateStrings()['overall_online_training_experience'],
155 'required' => true,
156 'defaultValue' => '',
157 'placeholder' => '',
158 'position' => 3,
159 'labelPosition' => 'default',
160 'ratingIcon' => 'star',
161 'fieldOptions' => self::getStandardRatingOptions(9),
162 'showValues' => false,
163 'showRatingText' => false,
164 ]];
165 }
166
167 /**
168 * Training materials quality rating
169 *
170 * @return array<int, array<string, mixed>>
171 */
172 private static function getMaterialsQualityRatingField(): array
173 {
174 return [[
175 'id' => 12,
176 'fieldIndex' => 4,
177 'type' => 'rating',
178 'label' => BackendStrings::getTemplateStrings()['training_materials_quality'],
179 'required' => true,
180 'defaultValue' => '',
181 'placeholder' => '',
182 'position' => 4,
183 'labelPosition' => 'default',
184 'ratingIcon' => 'star',
185 'fieldOptions' => self::getStandardRatingOptions(14),
186 'showValues' => false,
187 'showRatingText' => false,
188 ]];
189 }
190
191 /**
192 * Technical issues checkbox
193 *
194 * @return array<int, array<string, mixed>>
195 */
196 private static function getTechnicalIssuesField(): array
197 {
198 return [[
199 'id' => 18,
200 'fieldIndex' => 5,
201 'type' => 'checkbox',
202 'label' => BackendStrings::getTemplateStrings()['technical_issues_experienced'],
203 'required' => false,
204 'parentId' => null,
205 'defaultValue' => '',
206 'placeholder' => '',
207 'position' => 5,
208 'fieldOptions' => [
209 [
210 'id' => 13,
211 'label' => BackendStrings::getTemplateStrings()['audio_issues'],
212 'value' => 'audio_issues',
213 'isDefault' => false,
214 'position' => 1
215 ],
216 [
217 'id' => 14,
218 'label' => BackendStrings::getTemplateStrings()['video_issues'],
219 'value' => 'video_issues',
220 'isDefault' => false,
221 'position' => 2
222 ],
223 [
224 'id' => 15,
225 'label' => BackendStrings::getTemplateStrings()['login_problems'],
226 'value' => 'login_problems',
227 'isDefault' => false,
228 'position' => 3
229 ],
230 [
231 'id' => 16,
232 'label' => BackendStrings::getTemplateStrings()['slow_loading'],
233 'value' => 'slow_loading',
234 'isDefault' => false,
235 'position' => 4
236 ],
237 [
238 'id' => 17,
239 'label' => BackendStrings::getTemplateStrings()['no_issues'],
240 'value' => 'no_issues',
241 'isDefault' => false,
242 'position' => 5
243 ],
244 ]
245 ]];
246 }
247
248 /**
249 * Technical comments textarea
250 *
251 * @return array<int, array<string, mixed>>
252 */
253 private static function getTechnicalCommentsField(): array
254 {
255 return [[
256 'id' => 19,
257 'fieldIndex' => 6,
258 'type' => 'textarea',
259 'label' => BackendStrings::getTemplateStrings()['technical_usability_comments'],
260 'placeholder' => BackendStrings::getTemplateStrings()['technical_usability_comments_placeholder'],
261 'required' => false,
262 'parentId' => null,
263 'defaultValue' => '',
264 'position' => 6,
265 'rows' => 3,
266 ]];
267 }
268
269 /**
270 * Standard rating options
271 *
272 * @return array<int, array<string, mixed>>
273 */
274 private static function getStandardRatingOptions(int $startId): array
275 {
276 return [
277 [
278 'id' => $startId,
279 'label' => BackendStrings::getNewFormStrings()['good'],
280 'value' => '1',
281 'isDefault' => false,
282 'position' => 1
283 ],
284 [
285 'id' => $startId + 1,
286 'label' => BackendStrings::getNewFormStrings()['nice'],
287 'value' => '2',
288 'isDefault' => false,
289 'position' => 2
290 ],
291 [
292 'id' => $startId + 2,
293 'label' => BackendStrings::getNewFormStrings()['very_good'],
294 'value' => '3',
295 'isDefault' => false,
296 'position' => 3
297 ],
298 [
299 'id' => $startId + 3,
300 'label' => BackendStrings::getNewFormStrings()['awesome'],
301 'value' => '4',
302 'isDefault' => false,
303 'position' => 4
304 ],
305 [
306 'id' => $startId + 4,
307 'label' => BackendStrings::getNewFormStrings()['amazing'],
308 'value' => '5',
309 'isDefault' => false,
310 'position' => 5
311 ],
312 ];
313 }
314 }
315