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 / CourseContentFeedbackFormTemplate.php

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

315 lines 10.4 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 CourseContentFeedbackFormTemplate
8 {
9 /**
10 * Get the Course Content Feedback Form template
11 *
12 * @return array<string, mixed>
13 */
14 public static function getTemplate(): array
15 {
16 return [
17 'id' => 'course_content_feedback_form',
18 'name' => BackendStrings::getTemplateStrings()['course_content_feedback_form'],
19 'description' => BackendStrings::getTemplateStrings()['course_content_feedback_form_desc'],
20 'category' => 'feedback-forms',
21 'subcategory' => 'training-feedback-forms',
22 'is_pro' => false,
23 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'course-content-feedback-form.svg',
24 'form_data' => [
25 'name' => BackendStrings::getTemplateStrings()['course_content_feedback_form'],
26 'published' => 1,
27 'showTitle' => 1,
28 'storeEntries' => 1,
29 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
30 'fields' => array_merge(
31 self::getCourseTopicField(),
32 self::getContentDifficultyField(),
33 self::getContentQualityRatingField(),
34 self::getContentRelevanceRatingField(),
35 self::getLearningSupportField(),
36 self::getContentSuggestionsField()
37 ),
38 'settings' => []
39 ]
40 ];
41 }
42
43 /**
44 * Course topic dropdown
45 *
46 * @return array<int, array<string, mixed>>
47 */
48 private static function getCourseTopicField(): array
49 {
50 return [[
51 'id' => 6,
52 'fieldIndex' => 1,
53 'type' => 'select',
54 'label' => BackendStrings::getTemplateStrings()['course_topic'],
55 'placeholder' => BackendStrings::getTemplateStrings()['select_course_topic'],
56 'required' => true,
57 'parentId' => null,
58 'defaultValue' => '',
59 'position' => 1,
60 'fieldOptions' => [
61 [
62 'id' => 1,
63 'label' => BackendStrings::getTemplateStrings()['technical_skills'],
64 'value' => 'technical_skills',
65 'isDefault' => false,
66 'position' => 1
67 ],
68 [
69 'id' => 2,
70 'label' => BackendStrings::getTemplateStrings()['soft_skills'],
71 'value' => 'soft_skills',
72 'isDefault' => false,
73 'position' => 2
74 ],
75 [
76 'id' => 3,
77 'label' => BackendStrings::getTemplateStrings()['management_leadership'],
78 'value' => 'management_leadership',
79 'isDefault' => false,
80 'position' => 3
81 ],
82 [
83 'id' => 4,
84 'label' => BackendStrings::getTemplateStrings()['compliance_safety'],
85 'value' => 'compliance_safety',
86 'isDefault' => false,
87 'position' => 4
88 ],
89 [
90 'id' => 5,
91 'label' => BackendStrings::getTemplateStrings()['other'],
92 'value' => 'other',
93 'isDefault' => false,
94 'position' => 5
95 ],
96 ]
97 ]];
98 }
99
100 /**
101 * Content difficulty radio
102 *
103 * @return array<int, array<string, mixed>>
104 */
105 private static function getContentDifficultyField(): array
106 {
107 return [[
108 'id' => 10,
109 'fieldIndex' => 2,
110 'type' => 'radio',
111 'label' => BackendStrings::getTemplateStrings()['content_difficulty_level'],
112 'required' => true,
113 'parentId' => null,
114 'defaultValue' => '',
115 'placeholder' => '',
116 'position' => 2,
117 'fieldOptions' => [
118 [
119 'id' => 7,
120 'label' => BackendStrings::getTemplateStrings()['too_basic'],
121 'value' => 'too_basic',
122 'isDefault' => false,
123 'position' => 1
124 ],
125 [
126 'id' => 8,
127 'label' => BackendStrings::getTemplateStrings()['just_right'],
128 'value' => 'just_right',
129 'isDefault' => false,
130 'position' => 2
131 ],
132 [
133 'id' => 9,
134 'label' => BackendStrings::getTemplateStrings()['too_advanced'],
135 'value' => 'too_advanced',
136 'isDefault' => false,
137 'position' => 3
138 ],
139 ]
140 ]];
141 }
142
143 /**
144 * Content quality rating
145 *
146 * @return array<int, array<string, mixed>>
147 */
148 private static function getContentQualityRatingField(): array
149 {
150 return [[
151 'id' => 11,
152 'fieldIndex' => 3,
153 'type' => 'rating',
154 'label' => BackendStrings::getTemplateStrings()['content_quality'],
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 * Content relevance rating
169 *
170 * @return array<int, array<string, mixed>>
171 */
172 private static function getContentRelevanceRatingField(): array
173 {
174 return [[
175 'id' => 12,
176 'fieldIndex' => 4,
177 'type' => 'rating',
178 'label' => BackendStrings::getTemplateStrings()['content_relevance'],
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 * Learning support checkbox
193 *
194 * @return array<int, array<string, mixed>>
195 */
196 private static function getLearningSupportField(): array
197 {
198 return [[
199 'id' => 18,
200 'fieldIndex' => 5,
201 'type' => 'checkbox',
202 'label' => BackendStrings::getTemplateStrings()['what_helped_your_learning'],
203 'required' => false,
204 'parentId' => null,
205 'defaultValue' => '',
206 'placeholder' => '',
207 'position' => 5,
208 'fieldOptions' => [
209 [
210 'id' => 13,
211 'label' => BackendStrings::getTemplateStrings()['clear_explanations'],
212 'value' => 'clear_explanations',
213 'isDefault' => false,
214 'position' => 1
215 ],
216 [
217 'id' => 14,
218 'label' => BackendStrings::getTemplateStrings()['real_world_examples'],
219 'value' => 'real_world_examples',
220 'isDefault' => false,
221 'position' => 2
222 ],
223 [
224 'id' => 15,
225 'label' => BackendStrings::getTemplateStrings()['exercises_assignments'],
226 'value' => 'exercises_assignments',
227 'isDefault' => false,
228 'position' => 3
229 ],
230 [
231 'id' => 16,
232 'label' => BackendStrings::getTemplateStrings()['visual_materials'],
233 'value' => 'visual_materials',
234 'isDefault' => false,
235 'position' => 4
236 ],
237 [
238 'id' => 17,
239 'label' => BackendStrings::getTemplateStrings()['case_studies'],
240 'value' => 'case_studies',
241 'isDefault' => false,
242 'position' => 5
243 ],
244 ]
245 ]];
246 }
247
248 /**
249 * Suggestions textarea
250 *
251 * @return array<int, array<string, mixed>>
252 */
253 private static function getContentSuggestionsField(): array
254 {
255 return [[
256 'id' => 19,
257 'fieldIndex' => 6,
258 'type' => 'textarea',
259 'label' => BackendStrings::getTemplateStrings()['suggestions_for_content_improvement'],
260 'placeholder' => BackendStrings::getTemplateStrings()['suggestions_for_content_improvement_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