/
questionHelper.php
1623 lines (1479 loc) · 79.8 KB
/
questionHelper.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
* LimeSurvey
* Copyright (C) 2007-2016 The LimeSurvey Project Team / Carsten Schmitz
* All rights reserved.
* License: GNU/GPL License v3 or later, see LICENSE.php
* LimeSurvey is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*
*/
namespace LimeSurvey\Helpers;
use QuestionAttribute;
use QuestionTheme;
use Yii;
use Question;
/**
* General helper class for question + question setting system
*/
class questionHelper
{
/* @var array[]|null The question attribute definition for this LimeSurvey installation */
protected static $attributes;
/* @var array[] The question attribute (settings) by question type*/
protected static $questionAttributesSettings = array();
/**
* Return all the definitions of Question attributes core+extended value
* @return array[]
*
*@deprecated used only as fall back method
* use QuestionAttribute::getQuestionAttributesSettings function to get attributes
*/
public static function getAttributesDefinitions()
{
if (self::$attributes) {
return self::$attributes;
}
self::$attributes = array();
//For each question attribute include a key:
// name - the display name
// types - a string with one character representing each question typy to which the attribute applies
// help - a short explanation
// If you insert a new attribute please do it in correct alphabetical order!
// Please also list the new attribute in the function &TSVSurveyExport($sid) in em_manager_helper.php,
// so your new attribute will not be "forgotten" when the survey is exported to Excel/CSV-format!
// If you need to create a new attribute selector rendering for question advanced attribute
// Just add it to application/views/admin/survey/Question/advanced_settings_view
self::$attributes["alphasort"] = array(
"types" => Question::QT_EXCLAMATION_LIST_DROPDOWN . Question::QT_L_LIST . Question::QT_O_LIST_WITH_COMMENT,
'category' => gT('Display'),
'sortorder' => 100,
'inputtype' => 'switch',
'options' => array(
0 => gT('No'),
1 => gT('Yes')
),
'default' => 0,
"help" => gT("Sort the answer options alphabetically"),
"caption" => gT('Sort answers alphabetically'));
self::$attributes["answer_width"] = array(
"types" => Question::QT_A_ARRAY_5_POINT . Question::QT_B_ARRAY_10_CHOICE_QUESTIONS . Question::QT_C_ARRAY_YES_UNCERTAIN_NO . Question::QT_E_ARRAY_INC_SAME_DEC . Question::QT_F_ARRAY . Question::QT_1_ARRAY_DUAL . Question::QT_COLON_ARRAY_NUMBERS . Question::QT_SEMICOLON_ARRAY_TEXT,
'category' => gT('Display'),
'sortorder' => 100,
'inputtype' => 'integer',
'min' => '0',
'max' => '100',
"help" => gT('Set the percentage width of the (sub-)question column (1-100)'),
"caption" => gT('(Sub-)question width')
);
self::$attributes["answer_width_bycolumn"] = array(
"types" => "H",
'category' => gT('Display'),
'sortorder' => 100,
'inputtype' => 'integer',
'min' => '0',
'max' => '100',
"help" => gT('Set the percentage width of the answers column (1-100)'),
"caption" => gT('Answers column width')
);
self::$attributes["repeat_headings"] = array(
"types" => Question::QT_F_ARRAY . Question::QT_COLON_ARRAY_NUMBERS . Question::QT_1_ARRAY_DUAL . Question::QT_SEMICOLON_ARRAY_TEXT,
'category' => gT('Display'),
'sortorder' => 100,
'min' => '0',
'inputtype' => 'integer',
'default' => '',
"help" => gT('Repeat headers every n-th subquestions (Set to 0 to deactivate).'),
"caption" => gT('Repeat headers')
);
self::$attributes["array_filter"] = array(
"types" => Question::QT_1_ARRAY_DUAL . Question::QT_A_ARRAY_5_POINT . Question::QT_B_ARRAY_10_CHOICE_QUESTIONS . Question::QT_C_ARRAY_YES_UNCERTAIN_NO . Question::QT_E_ARRAY_INC_SAME_DEC . Question::QT_F_ARRAY . Question::QT_COLON_ARRAY_NUMBERS . Question::QT_SEMICOLON_ARRAY_TEXT . Question::QT_M_MULTIPLE_CHOICE . Question::QT_P_MULTIPLE_CHOICE_WITH_COMMENTS . Question::QT_L_LIST . Question::QT_K_MULTIPLE_NUMERICAL . Question::QT_Q_MULTIPLE_SHORT_TEXT . Question::QT_R_RANKING,
'category' => gT('Logic'),
'sortorder' => 100,
'inputtype' => 'text',
"help" => gT("Enter the code(s) of Multiple choice question(s) (separated by semicolons) to only show the matching answer options in this question."),
"caption" => gT('Array filter')
);
self::$attributes["array_filter_exclude"] = array(
"types" => Question::QT_1_ARRAY_DUAL . Question::QT_A_ARRAY_5_POINT . Question::QT_B_ARRAY_10_CHOICE_QUESTIONS . Question::QT_C_ARRAY_YES_UNCERTAIN_NO . Question::QT_E_ARRAY_INC_SAME_DEC . Question::QT_F_ARRAY . Question::QT_COLON_ARRAY_NUMBERS . Question::QT_SEMICOLON_ARRAY_TEXT . Question::QT_M_MULTIPLE_CHOICE . Question::QT_P_MULTIPLE_CHOICE_WITH_COMMENTS . Question::QT_L_LIST . Question::QT_K_MULTIPLE_NUMERICAL . Question::QT_Q_MULTIPLE_SHORT_TEXT . Question::QT_R_RANKING,
'category' => gT('Logic'),
'sortorder' => 100,
'inputtype' => 'text',
"help" => gT("Enter the code(s) of Multiple choice question(s) (separated by semicolons) to exclude the matching answer options in this question."),
"caption" => gT('Array filter exclusion')
);
self::$attributes["array_filter_style"] = array(
"types" => Question::QT_1_ARRAY_DUAL . Question::QT_A_ARRAY_5_POINT . Question::QT_B_ARRAY_10_CHOICE_QUESTIONS . Question::QT_C_ARRAY_YES_UNCERTAIN_NO . Question::QT_E_ARRAY_INC_SAME_DEC . Question::QT_F_ARRAY . Question::QT_COLON_ARRAY_NUMBERS . Question::QT_SEMICOLON_ARRAY_TEXT . Question::QT_M_MULTIPLE_CHOICE . Question::QT_P_MULTIPLE_CHOICE_WITH_COMMENTS . Question::QT_L_LIST . Question::QT_K_MULTIPLE_NUMERICAL . Question::QT_Q_MULTIPLE_SHORT_TEXT . Question::QT_R_RANKING,
'category' => gT('Logic'),
'sortorder' => 100,
'inputtype' => 'buttongroup',
'options' => array(0 => gT('Hidden', 'unescaped'),
1 => gT('Disabled', 'unescaped')),
'default' => 0,
"help" => gT("Specify how array-filtered subquestions should be displayed"),
"caption" => gT('Array filter style')
);
self::$attributes["assessment_value"] = array(
"types" => Question::QT_M_MULTIPLE_CHOICE . Question::QT_P_MULTIPLE_CHOICE_WITH_COMMENTS,
'category' => gT('Logic'),
'sortorder' => 100,
'default' => '1',
'inputtype' => 'integer',
"help" => gT("If one of the subquestions is marked then for each marked subquestion this value is added as assessment."),
"caption" => gT('Assessment value')
);
self::$attributes["category_separator"] = array(
"types" => Question::QT_EXCLAMATION_LIST_DROPDOWN,
'category' => gT('Display'),
'sortorder' => 100,
'inputtype' => 'text',
"help" => gT('Category separator'),
"caption" => gT('Category separator')
);
self::$attributes["commented_checkbox"] = array(
"types" => Question::QT_P_MULTIPLE_CHOICE_WITH_COMMENTS,
'category' => gT('Logic'),
'sortorder' => 110,
'inputtype' => 'singleselect',
'options' => array(
"allways" => gT('No control on checkbox'),
"checked" => gT('Checkbox is checked'),
"unchecked" => gT('Checkbox is unchecked'),
),
'default' => "checked",
'help' => gT('Choose when user can add a comment'),
'caption' => gT('Comment only when')
);
self::$attributes["commented_checkbox_auto"] = array(
"types" => Question::QT_P_MULTIPLE_CHOICE_WITH_COMMENTS,
'category' => gT('Logic'),
'sortorder' => 111,
'inputtype' => 'switch',
'options' => array(
"0" => gT('No'),
"1" => gT('Yes'),
),
'default' => "1",
'help' => gT('Use JavaScript functions to remove text and uncheck checkbox (or use only the ExpressionScript engine).'),
'caption' => gT('Remove text or uncheck checkbox automatically')
);
self::$attributes["display_columns"] = array(
"types" => Question::QT_L_LIST . Question::QT_M_MULTIPLE_CHOICE,
'category' => gT('Display'),
'sortorder' => 100,
'inputtype' => 'columns',
'default' => '1',
"help" => gT('The answer options will be distributed across the number of columns set here'),
"caption" => gT('Display columns')
);
self::$attributes["display_rows"] = array(
"types" => Question::QT_Q_MULTIPLE_SHORT_TEXT . Question::QT_S_SHORT_FREE_TEXT . Question::QT_T_LONG_FREE_TEXT . Question::QT_U_HUGE_FREE_TEXT,
'category' => gT('Display'),
'sortorder' => 100,
'inputtype' => 'integer',
"help" => gT('How many rows to display'),
"caption" => gT('Display rows')
);
self::$attributes["dropdown_dates"] = array(
"types" => Question::QT_D_DATE,
'category' => gT('Display'),
'sortorder' => 100,
'inputtype' => 'switch',
'options' => array(0 => gT('No'),
1 => gT('Yes')),
'default' => 0,
"help" => gT('Use accessible dropdown boxes instead of calendar popup'),
"caption" => gT('Display dropdown boxes')
);
self::$attributes["date_min"] = array(
"types" => Question::QT_D_DATE,
'category' => gT('Display'),
'sortorder' => 110,
'inputtype' => 'text',
'expression' => 2, /* What for "tomorrow" etc ....*/
"help" => gT('Minimum date, valide date in YYYY-MM-DD format or any English textual datetime description. Expression Managed can be used (only with YYYY-MM-DD format). For dropdown : only the year is restricted if date use variable not in same page.'),
"caption" => gT('Minimum date')
);
self::$attributes["date_max"] = array(
"types" => "D",
'category' => gT('Display'),
'sortorder' => 111,
'inputtype' => 'text',
'expression' => 2,
"help" => gT('Maximum date, valide date in any English textual datetime description (YYYY-MM-DD for example). Expression Managed can be used (only with YYYY-MM-DD format) value. For dropdown : only the year is restricted if date use variable not in same page.'),
"caption" => gT('Maximum date')
);
self::$attributes["dropdown_prepostfix"] = array(
"types" => Question::QT_1_ARRAY_DUAL,
'category' => gT('Display'),
'sortorder' => 112,
'inputtype' => 'text',
'i18n' => true,
"help" => gT('Prefix|Suffix for dropdown lists'),
"caption" => gT('Dropdown prefix/suffix')
);
self::$attributes["dropdown_separators"] = array(
"types" => Question::QT_1_ARRAY_DUAL,
'category' => gT('Display'),
'sortorder' => 120,
'inputtype' => 'text',
"help" => gT('Text shown on each subquestion row between both scales in dropdown mode'),
"caption" => gT('Dropdown separator')
);
self::$attributes["dualscale_headerA"] = array(
"types" => Question::QT_1_ARRAY_DUAL,
'category' => gT('Display'),
'sortorder' => 110,
'inputtype' => 'text',
'expression' => 1,
'i18n' => true,
"help" => gT('Enter a header text for the first scale'),
"caption" => gT('Header for first scale')
);
self::$attributes["dualscale_headerB"] = array(
"types" => Question::QT_1_ARRAY_DUAL,
'category' => gT('Display'),
'sortorder' => 111,
'inputtype' => 'text',
'expression' => 1,
'i18n' => true,
"help" => gT('Enter a header text for the second scale'),
"caption" => gT('Header for second scale')
);
self::$attributes["equation"] = array(
"types" => Question::QT_ASTERISK_EQUATION,
'category' => gT('Logic'),
'sortorder' => 100,
'inputtype' => 'textarea',
'expression' => 1,
"help" => gT('Final equation to set in database, defaults to question text.'),
"caption" => gT('Equation'),
"default" => ""
);
self::$attributes["equals_num_value"] = array(
"types" => Question::QT_K_MULTIPLE_NUMERICAL,
'category' => gT('Input'),
'sortorder' => 100,
'inputtype' => 'text',
'expression' => 2,
"help" => gT('Multiple numeric inputs sum must equal this value'),
"caption" => gT('Equals sum value')
);
self::$attributes["em_validation_q"] = array(
"types" => Question::QT_COLON_ARRAY_NUMBERS . Question::QT_SEMICOLON_ARRAY_TEXT . Question::QT_A_ARRAY_5_POINT . Question::QT_B_ARRAY_10_CHOICE_QUESTIONS . Question::QT_C_ARRAY_YES_UNCERTAIN_NO . Question::QT_D_DATE . Question::QT_E_ARRAY_INC_SAME_DEC . Question::QT_F_ARRAY . Question::QT_K_MULTIPLE_NUMERICAL . Question::QT_M_MULTIPLE_CHOICE . Question::QT_N_NUMERICAL . Question::QT_O_LIST_WITH_COMMENT . Question::QT_P_MULTIPLE_CHOICE_WITH_COMMENTS . Question::QT_Q_MULTIPLE_SHORT_TEXT . Question::QT_R_RANKING . Question::QT_S_SHORT_FREE_TEXT . Question::QT_T_LONG_FREE_TEXT . Question::QT_U_HUGE_FREE_TEXT . Question::QT_EXCLAMATION_LIST_DROPDOWN . Question::QT_L_LIST . Question::QT_5_POINT_CHOICE . Question::QT_G_GENDER . Question::QT_I_LANGUAGE . Question::QT_X_TEXT_DISPLAY . Question::QT_Y_YES_NO_RADIO . Question::QT_ASTERISK_EQUATION,
'category' => gT('Logic'),
'sortorder' => 200,
'inputtype' => 'textarea',
'expression' => 2,
"help" => gT('Enter a boolean equation to validate the whole question.'),
"caption" => gT('Question validation equation')
);
self::$attributes["em_validation_q_tip"] = array(
"types" => Question::QT_COLON_ARRAY_NUMBERS . Question::QT_SEMICOLON_ARRAY_TEXT . Question::QT_A_ARRAY_5_POINT . Question::QT_B_ARRAY_10_CHOICE_QUESTIONS . Question::QT_C_ARRAY_YES_UNCERTAIN_NO . Question::QT_D_DATE . Question::QT_E_ARRAY_INC_SAME_DEC . Question::QT_F_ARRAY . Question::QT_K_MULTIPLE_NUMERICAL . Question::QT_M_MULTIPLE_CHOICE . Question::QT_N_NUMERICAL . Question::QT_O_LIST_WITH_COMMENT . Question::QT_P_MULTIPLE_CHOICE_WITH_COMMENTS . Question::QT_Q_MULTIPLE_SHORT_TEXT . Question::QT_R_RANKING . Question::QT_S_SHORT_FREE_TEXT . Question::QT_T_LONG_FREE_TEXT . Question::QT_U_HUGE_FREE_TEXT . Question::QT_EXCLAMATION_LIST_DROPDOWN . Question::QT_L_LIST . Question::QT_5_POINT_CHOICE . Question::QT_G_GENDER . Question::QT_I_LANGUAGE . Question::QT_X_TEXT_DISPLAY . Question::QT_Y_YES_NO_RADIO . Question::QT_ASTERISK_EQUATION,
'category' => gT('Logic'),
'sortorder' => 210,
'inputtype' => 'textarea',
'expression' => 1,
'i18n' => true,
"help" => gT('This is a hint text that will be shown to the participant describing the question validation equation.'),
"caption" => gT('Question validation tip')
);
self::$attributes["em_validation_sq"] = array(
"types" => Question::QT_SEMICOLON_ARRAY_TEXT . Question::QT_COLON_ARRAY_NUMBERS . Question::QT_K_MULTIPLE_NUMERICAL . Question::QT_Q_MULTIPLE_SHORT_TEXT . Question::QT_S_SHORT_FREE_TEXT . Question::QT_T_LONG_FREE_TEXT . Question::QT_U_HUGE_FREE_TEXT . Question::QT_N_NUMERICAL,
'category' => gT('Logic'),
'sortorder' => 220,
'inputtype' => 'textarea',
'expression' => 2,
"help" => gT('Enter a boolean equation to validate each subquestion.'),
"caption" => gT('Subquestion validation equation')
);
self::$attributes["em_validation_sq_tip"] = array(
"types" => Question::QT_SEMICOLON_ARRAY_TEXT . Question::QT_COLON_ARRAY_NUMBERS . Question::QT_K_MULTIPLE_NUMERICAL . Question::QT_Q_MULTIPLE_SHORT_TEXT . Question::QT_S_SHORT_FREE_TEXT . Question::QT_T_LONG_FREE_TEXT . Question::QT_U_HUGE_FREE_TEXT . Question::QT_N_NUMERICAL,
'category' => gT('Logic'),
'sortorder' => 230,
'inputtype' => 'textarea',
'expression' => 1,
'i18n' => true,
"help" => gT('This is a tip shown to the participant describing the subquestion validation equation.'),
"caption" => gT('Subquestion validation tip')
);
self::$attributes["exclude_all_others"] = array(
"types" => "ABCEFMPKQ",
'category' => gT('Logic'),
'sortorder' => 130,
'inputtype' => 'text',
"help" => gT('Excludes all other options if a certain answer is selected - just enter the answer code(s) separated with a semicolon.'),
"caption" => gT('Exclusive option')
);
self::$attributes["exclude_all_others_auto"] = array(
"types" => Question::QT_M_MULTIPLE_CHOICE . Question::QT_P_MULTIPLE_CHOICE_WITH_COMMENTS,
'category' => gT('Logic'),
'sortorder' => 131,
'inputtype' => 'switch',
'options' => array(1 => gT('Yes'), 0 => gT('No')),
'default' => 0,
"help" => gT('If the participant marks all options, uncheck all and check the option set in the "Exclusive option" setting'),
"caption" => gT('Auto-check exclusive option if all others are checked')
);
// Map Options
self::$attributes["location_city"] = array(
"types" => Question::QT_S_SHORT_FREE_TEXT,
'readonly_when_active' => true,
'category' => gT('Location'),
'sortorder' => 100,
'inputtype' => 'singleselect',
'default' => 0,
'options' => array(1 => gT('Yes'), 0 => gT('No')),
"help" => gT("Store the city?"),
"caption" => gT("Save city")
);
self::$attributes["location_state"] = array(
"types" => Question::QT_S_SHORT_FREE_TEXT,
'readonly_when_active' => true,
'category' => gT('Location'),
'sortorder' => 100,
'default' => 0,
'inputtype' => 'singleselect',
'options' => array(1 => gT('Yes'), 0 => gT('No')),
"help" => gT("Store the state?"),
"caption" => gT("Save state")
);
self::$attributes["location_postal"] = array(
"types" => Question::QT_S_SHORT_FREE_TEXT,
'readonly_when_active' => true,
'category' => gT('Location'),
'sortorder' => 100,
'inputtype' => 'singleselect',
'default' => 0,
'options' => array(1 => gT('Yes'), 0 => gT('No')),
"help" => gT("Store the postal code?"),
"caption" => gT("Save postal code")
);
self::$attributes["location_country"] = array(
"types" => "S",
'readonly_when_active' => true,
'category' => gT('Location'),
'sortorder' => 100,
'inputtype' => 'singleselect',
'default' => 0,
'options' => array(1 => gT('Yes'), 0 => gT('No')),
"help" => gT("Store the country?"),
"caption" => gT("Save country")
);
self::$attributes["statistics_showmap"] = array(
"types" => "S",
'category' => gT('Statistics'),
'inputtype' => 'switch',
'sortorder' => 100,
'options' => array(1 => gT('Yes'), 0 => gT('No')),
'help' => gT("Show a map in the statistics?"),
'caption' => gT("Display map"),
'default' => 1
);
self::$attributes["statistics_showgraph"] = array(
'types' => '15ABCDEFGHIKLMNOPQRSTUWXYZ!:;|*',
'category' => gT('Statistics'),
'inputtype' => 'switch',
'sortorder' => 101,
'options' => array(1 => gT('Yes'), 0 => gT('No')),
'help' => gT("Display a chart in the statistics?"),
'caption' => gT("Display chart"),
'default' => 1
);
self::$attributes["statistics_graphtype"] = array(
"types" => '15ABCDEFGHIKLMNOQRSTUWXYZ!:;|*',
'category' => gT('Statistics'),
'inputtype' => 'singleselect',
'sortorder' => 102,
'options' => array(
0 => gT('Bar chart'),
1 => gT('Pie chart'),
2 => gT('Radar'),
3 => gT('Line'),
4 => gT('PolarArea'),
5 => gT('Doughnut'),
),
'help' => gT("Select the type of chart to be displayed"),
'caption' => gT("Chart type"),
'default' => 0
);
self::$attributes["location_mapservice"] = array(
"types" => Question::QT_S_SHORT_FREE_TEXT,
'category' => gT('Location'),
'sortorder' => 90,
'inputtype' => 'buttongroup',
'options' => array(
0 => gT('Off'),
100 => gT('OpenStreetMap via MapQuest', 'unescaped'),
1 => gT('Google Maps', 'unescaped')
),
'default' => 0,
"help" => gT("Activate this to show a map above the input field where the user can select a location"),
"caption" => gT("Use mapping service")
);
self::$attributes["location_mapwidth"] = array(
"types" => Question::QT_S_SHORT_FREE_TEXT,
'category' => gT('Location'),
'sortorder' => 102,
'inputtype' => 'text',
'default' => '500',
"help" => gT("Map width in pixel"),
"caption" => gT("Map width")
);
self::$attributes["location_mapheight"] = array(
"types" => Question::QT_S_SHORT_FREE_TEXT,
'category' => gT('Location'),
'sortorder' => 103,
'inputtype' => 'text',
'default' => '300',
"help" => gT("Map height in pixel"),
"caption" => gT("Map height")
);
self::$attributes["location_nodefaultfromip"] = array(
"types" => Question::QT_S_SHORT_FREE_TEXT,
'category' => gT('Location'),
'sortorder' => 91,
'inputtype' => 'singleselect',
'options' => array(0 => gT('Yes'), 1 => gT('No')),
'default' => 0,
"help" => gT("Get the default location using the user's IP address?"),
"caption" => gT("IP as default location")
);
self::$attributes["location_defaultcoordinates"] = array(
"types" => Question::QT_S_SHORT_FREE_TEXT,
'category' => gT('Location'),
'sortorder' => 101,
'inputtype' => 'text',
'expression' => 1,/* As static */
"help" => gT('Default coordinates of the map when the page first loads. Format: latitude [space] longtitude. Latitude and longtitude should be in decimal dot notation (for example "-3.1234 5.1424").'),
"caption" => gT('Default position')
);
self::$attributes["location_mapzoom"] = array(
"types" => Question::QT_S_SHORT_FREE_TEXT,
'category' => gT('Location'),
'sortorder' => 101,
'inputtype' => 'text',
'default' => '11',
"help" => gT("Map zoom level"),
"caption" => gT("Zoom level")
);
// End Map Options
self::$attributes["hide_tip"] = array(
"types" => "15ABCDEFGHIKLMNOPQRSTUXY!:;|",
'category' => gT('Display'),
'sortorder' => 100,
'inputtype' => 'switch',
'options' => array(0 => gT('No'), 1 => gT('Yes')),
'default' => 0,
"help" => gT('Hide the tip that is normally shown with a question'),
"caption" => gT('Hide tip')
);
self::$attributes['hidden'] = array(
'types' => Question::QT_1_ARRAY_DUAL . Question::QT_5_POINT_CHOICE . Question::QT_A_ARRAY_5_POINT . Question::QT_B_ARRAY_10_CHOICE_QUESTIONS . Question::QT_C_ARRAY_YES_UNCERTAIN_NO . Question::QT_D_DATE . Question::QT_E_ARRAY_INC_SAME_DEC . Question::QT_F_ARRAY . Question::QT_G_GENDER . Question::QT_H_ARRAY_COLUMN . Question::QT_I_LANGUAGE . Question::QT_K_MULTIPLE_NUMERICAL . Question::QT_L_LIST . Question::QT_M_MULTIPLE_CHOICE . Question::QT_N_NUMERICAL . Question::QT_O_LIST_WITH_COMMENT . Question::QT_P_MULTIPLE_CHOICE_WITH_COMMENTS . Question::QT_Q_MULTIPLE_SHORT_TEXT . Question::QT_R_RANKING . Question::QT_S_SHORT_FREE_TEXT . Question::QT_T_LONG_FREE_TEXT . Question::QT_U_HUGE_FREE_TEXT . Question::QT_X_TEXT_DISPLAY . Question::QT_Y_YES_NO_RADIO . Question::QT_EXCLAMATION_LIST_DROPDOWN . Question::QT_COLON_ARRAY_NUMBERS . Question::QT_SEMICOLON_ARRAY_TEXT . Question::QT_VERTICAL_FILE_UPLOAD . Question::QT_ASTERISK_EQUATION,
'category' => gT('Display'),
'sortorder' => 101,
'inputtype' => 'switch',
'options' => array(0 => gT('No'), 1 => gT('Yes')),
'default' => 0,
'help' => gT('Hide this question at any time. This is useful for including data using answer prefilling.'),
'caption' => gT('Always hide this question')
);
self::$attributes['cssclass'] = array(
'types' => Question::QT_1_ARRAY_DUAL . Question::QT_5_POINT_CHOICE . Question::QT_A_ARRAY_5_POINT . Question::QT_B_ARRAY_10_CHOICE_QUESTIONS . Question::QT_C_ARRAY_YES_UNCERTAIN_NO . Question::QT_D_DATE . Question::QT_E_ARRAY_INC_SAME_DEC . Question::QT_F_ARRAY . Question::QT_G_GENDER . Question::QT_H_ARRAY_COLUMN . Question::QT_I_LANGUAGE . Question::QT_K_MULTIPLE_NUMERICAL . Question::QT_L_LIST . Question::QT_M_MULTIPLE_CHOICE . Question::QT_N_NUMERICAL . Question::QT_O_LIST_WITH_COMMENT . Question::QT_P_MULTIPLE_CHOICE_WITH_COMMENTS . Question::QT_Q_MULTIPLE_SHORT_TEXT . Question::QT_R_RANKING . Question::QT_S_SHORT_FREE_TEXT . Question::QT_T_LONG_FREE_TEXT . Question::QT_U_HUGE_FREE_TEXT . Question::QT_X_TEXT_DISPLAY . Question::QT_Y_YES_NO_RADIO . Question::QT_EXCLAMATION_LIST_DROPDOWN . Question::QT_COLON_ARRAY_NUMBERS . Question::QT_SEMICOLON_ARRAY_TEXT . Question::QT_VERTICAL_FILE_UPLOAD . Question::QT_ASTERISK_EQUATION,
'category' => gT('Display'),
'sortorder' => 102,
'inputtype' => 'text',
'expression' => 1, /* As static */
'help' => gT('Add additional CSS class(es) for this question. Use a space between multiple CSS class names. You may use expressions - remember this part is static.'),
'caption' => gT('CSS class(es)')
);
self::$attributes["max_answers"] = array(
"types" => Question::QT_M_MULTIPLE_CHOICE . Question::QT_P_MULTIPLE_CHOICE_WITH_COMMENTS . Question::QT_R_RANKING . Question::QT_1_ARRAY_DUAL . Question::QT_COLON_ARRAY_NUMBERS . Question::QT_SEMICOLON_ARRAY_TEXT . Question::QT_A_ARRAY_5_POINT . Question::QT_B_ARRAY_10_CHOICE_QUESTIONS . Question::QT_C_ARRAY_YES_UNCERTAIN_NO . Question::QT_E_ARRAY_INC_SAME_DEC . Question::QT_F_ARRAY . Question::QT_K_MULTIPLE_NUMERICAL . Question::QT_Q_MULTIPLE_SHORT_TEXT,
'category' => gT('Logic'),
'sortorder' => 11,
'inputtype' => 'text',
'expression' => 2,
"help" => gT('Limit the number of possible answers'),
"caption" => gT('Maximum answers')
);
self::$attributes["max_num_value"] = array(
"types" => Question::QT_K_MULTIPLE_NUMERICAL,
'category' => gT('Input'),
'sortorder' => 100,
'inputtype' => 'text',
'expression' => 2,
"help" => gT('Maximum sum value of multiple numeric input'),
"caption" => gT('Maximum sum value')
);
self::$attributes["max_num_value_n"] = array(
"types" => Question::QT_N_NUMERICAL . Question::QT_K_MULTIPLE_NUMERICAL,
'category' => gT('Input'),
'sortorder' => 110,
'inputtype' => 'text',
'expression' => 2,
"help" => gT('Maximum value of the numeric input'),
"caption" => gT('Maximum value')
);
/* Ranking specific : max DB answer */
self::$attributes["max_subquestions"] = array(
"types" => Question::QT_R_RANKING,
'readonly_when_active' => true,
'category' => gT('Logic'),
'sortorder' => 12,
'inputtype' => 'integer',
'default' => '',
"help" => gT('Limit the number of possible answers fixed by number of columns in database'),
"caption" => gT('Maximum columns for answers')
);
self::$attributes["maximum_chars"] = array(
"types" => Question::QT_S_SHORT_FREE_TEXT . Question::QT_T_LONG_FREE_TEXT . Question::QT_U_HUGE_FREE_TEXT . Question::QT_N_NUMERICAL . Question::QT_Q_MULTIPLE_SHORT_TEXT . Question::QT_K_MULTIPLE_NUMERICAL . Question::QT_COLON_ARRAY_NUMBERS . Question::QT_SEMICOLON_ARRAY_TEXT,
'category' => gT('Input'),
'sortorder' => 100,
'inputtype' => 'integer',
'default' => '',
"help" => gT('Maximum characters allowed'),
"caption" => gT('Maximum characters')
);
self::$attributes["min_answers"] = array(
"types" => Question::QT_M_MULTIPLE_CHOICE . Question::QT_P_MULTIPLE_CHOICE_WITH_COMMENTS . Question::QT_R_RANKING . Question::QT_1_ARRAY_DUAL . Question::QT_COLON_ARRAY_NUMBERS . Question::QT_SEMICOLON_ARRAY_TEXT . Question::QT_A_ARRAY_5_POINT . Question::QT_B_ARRAY_10_CHOICE_QUESTIONS . Question::QT_C_ARRAY_YES_UNCERTAIN_NO . Question::QT_E_ARRAY_INC_SAME_DEC . Question::QT_F_ARRAY . Question::QT_K_MULTIPLE_NUMERICAL . Question::QT_Q_MULTIPLE_SHORT_TEXT,
'category' => gT('Logic'),
'sortorder' => 10,
'inputtype' => 'text',
'expression' => 2,
"help" => gT('Ensure a minimum number of possible answers (0=No limit)'),
"caption" => gT('Minimum answers')
);
self::$attributes["min_num_value"] = array(
"types" => Question::QT_K_MULTIPLE_NUMERICAL,
'category' => gT('Input'),
'sortorder' => 100,
'inputtype' => 'text',
'expression' => 2,
"help" => gT('The sum of the multiple numeric inputs must be greater than this value'),
"caption" => gT('Minimum sum value')
);
self::$attributes["min_num_value_n"] = array(
"types" => Question::QT_N_NUMERICAL . Question::QT_K_MULTIPLE_NUMERICAL,
'category' => gT('Input'),
'sortorder' => 100,
'inputtype' => 'text',
'expression' => 2,
"help" => gT('Minimum value of the numeric input'),
"caption" => gT('Minimum value')
);
self::$attributes["multiflexible_max"] = array(
"types" => Question::QT_COLON_ARRAY_NUMBERS,
'category' => gT('Display'),
'sortorder' => 112,
'inputtype' => 'text',
'expression' => 2, // Really ? Only if shown as text then
"help" => gT('Maximum value for array(mult-flexible) question type'),
"caption" => gT('Maximum value')
);
self::$attributes["multiflexible_min"] = array(
"types" => Question::QT_COLON_ARRAY_NUMBERS,
'category' => gT('Display'),
'sortorder' => 110,
'inputtype' => 'text',
'expression' => 2, // Really ? Only if shown as text then
"help" => gT('Minimum value for array(multi-flexible) question type'),
"caption" => gT('Minimum value')
);
self::$attributes["multiflexible_step"] = array(
"types" => Question::QT_COLON_ARRAY_NUMBERS,
'category' => gT('Display'),
'sortorder' => 111,
'inputtype' => 'float',
'default' => '',
"help" => gT('Step value'),
"caption" => gT('Step value')
);
self::$attributes["multiflexible_checkbox"] = array(
"types" => Question::QT_COLON_ARRAY_NUMBERS,
'category' => gT('Display'),
'sortorder' => 100,
'inputtype' => 'switch',
'options' => array(0 => gT('No'), 1 => gT('Yes')),
'default' => 0,
"help" => gT('Use checkbox layout'),
"caption" => gT('Checkbox layout')
);
self::$attributes["reverse"] = array(
"types" => Question::QT_D_DATE . Question::QT_COLON_ARRAY_NUMBERS,
'category' => gT('Display'),
'sortorder' => 100,
'inputtype' => 'switch',
'options' => array(0 => gT('No'), 1 => gT('Yes')),
'default' => 0,
"help" => gT('Present answer options in reverse order'),
"caption" => gT('Reverse answer order')
);
self::$attributes["num_value_int_only"] = array(
"types" => Question::QT_N_NUMERICAL . Question::QT_K_MULTIPLE_NUMERICAL,
'category' => gT('Input'),
'sortorder' => 100,
'inputtype' => 'switch',
'options' => array(0 => gT('No'), 1 => gT('Yes')),
'default' => 0,
"help" => gT('Restrict input to integer values'),
"caption" => gT('Integer only')
);
self::$attributes["numbers_only"] = array(
"types" => Question::QT_Q_MULTIPLE_SHORT_TEXT . Question::QT_SEMICOLON_ARRAY_TEXT . Question::QT_S_SHORT_FREE_TEXT . Question::QT_ASTERISK_EQUATION,
'category' => gT('Other'),
'sortorder' => 150,
'inputtype' => 'switch',
'options' => array(0 => gT('No'), 1 => gT('Yes')),
'default' => 0,
"help" => gT('Allow only numerical input'),
"caption" => gT('Numbers only')
);
self::$attributes['show_totals'] = array(
'types' => Question::QT_SEMICOLON_ARRAY_TEXT,
'category' => gT('Other'),
'sortorder' => 151,
'inputtype' => 'buttongroup',
'options' => array(
'X' => gT('Off', 'unescaped'),
'R' => gT('Rows', 'unescaped'),
'C' => gT('Columns', 'unescaped'),
'B' => gT('Rows & columns', 'unescaped')
),
'default' => 'X',
'help' => gT('Show totals for either rows, columns or both rows and columns'),
'caption' => gT('Show totals for')
);
self::$attributes['show_grand_total'] = array(
'types' => Question::QT_SEMICOLON_ARRAY_TEXT,
'category' => gT('Other'),
'sortorder' => 152,
'inputtype' => 'switch',
'options' => array(0 => gT('No'), 1 => gT('Yes')),
'default' => 0,
'help' => gT('Show grand total for either columns or rows'),
'caption' => gT('Show grand total')
);
self::$attributes["input_size"] = array(
"types" => Question::QT_K_MULTIPLE_NUMERICAL . Question::QT_M_MULTIPLE_CHOICE . Question::QT_N_NUMERICAL . Question::QT_Q_MULTIPLE_SHORT_TEXT . Question::QT_S_SHORT_FREE_TEXT . Question::QT_T_LONG_FREE_TEXT . Question::QT_U_HUGE_FREE_TEXT . Question::QT_COLON_ARRAY_NUMBERS . Question::QT_SEMICOLON_ARRAY_TEXT,
'category' => gT('Display'),
'sortorder' => 100,
'inputtype' => 'integer',
'default' => '',
"help" => gT("Set the size of the input or textarea. The input will be displayed approximately this size in width."),
"caption" => gT("Text input box size")
);
self::$attributes["input_boxes"] = array(
"types" => ":",
'category' => gT('Display'),
'sortorder' => 110,
'inputtype' => 'switch',
'options' => array(0 => gT('No'), 1 => gT('Yes')),
'default' => 0,
"help" => gT("Present as text input boxes instead of dropdown lists"),
"caption" => gT("Text inputs")
);
self::$attributes["other_comment_mandatory"] = array(
"types" => Question::QT_P_MULTIPLE_CHOICE_WITH_COMMENTS . Question::QT_L_LIST . Question::QT_EXCLAMATION_LIST_DROPDOWN,
'category' => gT('Logic'),
'sortorder' => 100,
'inputtype' => 'switch',
'options' => array(0 => gT('No'), 1 => gT('Yes')),
'default' => 0,
"help" => gT("Make the 'Other:' comment field mandatory when the 'Other:' option is active"),
"caption" => gT("'Other:' comment mandatory")
);
self::$attributes["other_numbers_only"] = array(
"types" => Question::QT_L_LIST . Question::QT_M_MULTIPLE_CHOICE . Question::QT_P_MULTIPLE_CHOICE_WITH_COMMENTS,
'category' => gT('Logic'),
'sortorder' => 100,
'inputtype' => 'switch',
'options' => array(0 => gT('No'), 1 => gT('Yes')),
'default' => 0,
"help" => gT("Allow only numerical input for 'Other' text"),
"caption" => gT("Numbers only for 'Other'")
);
self::$attributes["other_replace_text"] = array(
"types" => Question::QT_L_LIST . Question::QT_M_MULTIPLE_CHOICE . Question::QT_P_MULTIPLE_CHOICE_WITH_COMMENTS . Question::QT_EXCLAMATION_LIST_DROPDOWN,
'category' => gT('Display'),
'sortorder' => 100,
'inputtype' => 'text',
'expression' => 1,
'i18n' => true,
"help" => gT("Replaces the label of the 'Other:' answer option with a custom text"),
"caption" => gT("Label for 'Other:' option")
);
self::$attributes["page_break"] = array(
"types" => Question::QT_1_ARRAY_DUAL . Question::QT_5_POINT_CHOICE . Question::QT_A_ARRAY_5_POINT . Question::QT_B_ARRAY_10_CHOICE_QUESTIONS . Question::QT_C_ARRAY_YES_UNCERTAIN_NO . Question::QT_D_DATE . Question::QT_E_ARRAY_INC_SAME_DEC . Question::QT_F_ARRAY . Question::QT_G_GENDER . Question::QT_H_ARRAY_COLUMN . Question::QT_K_MULTIPLE_NUMERICAL . Question::QT_L_LIST . Question::QT_M_MULTIPLE_CHOICE . Question::QT_N_NUMERICAL . Question::QT_O_LIST_WITH_COMMENT . Question::QT_P_MULTIPLE_CHOICE_WITH_COMMENTS . Question::QT_Q_MULTIPLE_SHORT_TEXT . Question::QT_R_RANKING . Question::QT_S_SHORT_FREE_TEXT . Question::QT_T_LONG_FREE_TEXT . Question::QT_U_HUGE_FREE_TEXT . Question::QT_X_TEXT_DISPLAY . Question::QT_Y_YES_NO_RADIO . Question::QT_EXCLAMATION_LIST_DROPDOWN . Question::QT_COLON_ARRAY_NUMBERS . Question::QT_SEMICOLON_ARRAY_TEXT . Question::QT_VERTICAL_FILE_UPLOAD . Question::QT_ASTERISK_EQUATION,
'category' => gT('Other'),
'sortorder' => 100,
'inputtype' => 'switch',
'options' => array(0 => gT('No'), 1 => gT('Yes')),
'default' => 0,
"help" => gT('Insert a page break before this question in printable view.'),
"caption" => gT('Insert page break in printable view')
);
self::$attributes["placeholder"] = array(
"types" => Question::QT_COLON_ARRAY_NUMBERS . Question::QT_Q_MULTIPLE_SHORT_TEXT . Question::QT_S_SHORT_FREE_TEXT . Question::QT_T_LONG_FREE_TEXT . Question::QT_U_HUGE_FREE_TEXT . Question::QT_N_NUMERICAL,
'category' => gT('Display'),
'sortorder' => 12,
'inputtype' => 'text',
'expression' => 1,
'i18n' => true,
"help" => gT('A placeholder answer to a question. This will appear in the answer field and disappear when real answer text is entered.'),
"caption" => gT('Placeholder answer')
);
self::$attributes["prefix"] = array(
"types" => Question::QT_K_MULTIPLE_NUMERICAL . Question::QT_N_NUMERICAL . Question::QT_Q_MULTIPLE_SHORT_TEXT . Question::QT_S_SHORT_FREE_TEXT,
'category' => gT('Display'),
'sortorder' => 10,
'inputtype' => 'text',
'expression' => 1,
'i18n' => true,
"help" => gT('Add a prefix to the answer field'),
"caption" => gT('Answer prefix')
);
self::$attributes["printable_help"] = array(
"types" => Question::QT_1_ARRAY_DUAL . Question::QT_5_POINT_CHOICE . Question::QT_A_ARRAY_5_POINT . Question::QT_B_ARRAY_10_CHOICE_QUESTIONS . Question::QT_C_ARRAY_YES_UNCERTAIN_NO . Question::QT_D_DATE . Question::QT_E_ARRAY_INC_SAME_DEC . Question::QT_F_ARRAY . Question::QT_G_GENDER . Question::QT_H_ARRAY_COLUMN . Question::QT_K_MULTIPLE_NUMERICAL . Question::QT_L_LIST . Question::QT_M_MULTIPLE_CHOICE . Question::QT_N_NUMERICAL . Question::QT_O_LIST_WITH_COMMENT . Question::QT_P_MULTIPLE_CHOICE_WITH_COMMENTS . Question::QT_R_RANKING . Question::QT_Y_YES_NO_RADIO . Question::QT_EXCLAMATION_LIST_DROPDOWN . Question::QT_COLON_ARRAY_NUMBERS . Question::QT_ASTERISK_EQUATION,
'category' => gT('Display'),
'sortorder' => 201,
"inputtype" => "text",
'expression' => 1, // Must control if yes
'i18n' => true,
'default' => "",
"help" => gT('In the printable version the condition is being replaced with this explanation text.'),
"caption" => gT("Condition help for printable survey")
);
self::$attributes["public_statistics"] = array(
"types" => Question::QT_1_ARRAY_DUAL . Question::QT_5_POINT_CHOICE . Question::QT_A_ARRAY_5_POINT . Question::QT_B_ARRAY_10_CHOICE_QUESTIONS . Question::QT_C_ARRAY_YES_UNCERTAIN_NO . Question::QT_E_ARRAY_INC_SAME_DEC . Question::QT_F_ARRAY . Question::QT_G_GENDER . Question::QT_H_ARRAY_COLUMN . Question::QT_K_MULTIPLE_NUMERICAL . Question::QT_L_LIST . Question::QT_M_MULTIPLE_CHOICE . Question::QT_N_NUMERICAL . Question::QT_O_LIST_WITH_COMMENT . Question::QT_P_MULTIPLE_CHOICE_WITH_COMMENTS . Question::QT_R_RANKING . Question::QT_Y_YES_NO_RADIO . Question::QT_EXCLAMATION_LIST_DROPDOWN . Question::QT_COLON_ARRAY_NUMBERS . Question::QT_ASTERISK_EQUATION,
'category' => gT('Statistics'),
'sortorder' => 80,
'inputtype' => 'switch',
'options' => array(0 => gT('No'), 1 => gT('Yes')),
'default' => 0,
"help" => gT('Show statistics of this question in the public statistics page'),
"caption" => gT('Show in public statistics')
);
self::$attributes["random_order"] = array(
"types" => Question::QT_A_ARRAY_5_POINT . Question::QT_B_ARRAY_10_CHOICE_QUESTIONS . Question::QT_C_ARRAY_YES_UNCERTAIN_NO . Question::QT_E_ARRAY_INC_SAME_DEC . Question::QT_F_ARRAY . Question::QT_H_ARRAY_COLUMN . Question::QT_K_MULTIPLE_NUMERICAL . Question::QT_M_MULTIPLE_CHOICE . Question::QT_O_LIST_WITH_COMMENT . Question::QT_P_MULTIPLE_CHOICE_WITH_COMMENTS . Question::QT_Q_MULTIPLE_SHORT_TEXT . Question::QT_1_ARRAY_DUAL . Question::QT_COLON_ARRAY_NUMBERS . Question::QT_SEMICOLON_ARRAY_TEXT,
'category' => gT('Display'),
'sortorder' => 100,
'inputtype' => 'singleselect',
'options' => array(0 => gT('No'), 1 => gT("Yes")),
//1=>gT('Randomize on each page load') // Shnoulle : replace by yes till we have only one solution
//2=>gT('Randomize once on survey start') //Mdekker: commented out as code to handle this was removed in refactoring
'default' => 0,
"help" => gT('Present subquestions/answer options in random order'),
"caption" => gT('Random order')
);
self::$attributes["answer_order"] = array(
"types" => Question::QT_L_LIST . Question::QT_R_RANKING . Question::QT_EXCLAMATION_LIST_DROPDOWN,
'category' => gT('Display'),
'sortorder' => 100,
'inputtype' => 'singleselect',
'options' => array('normal' => gT('Normal'), 'random' => gT("Random"), 'alphabetical' => gT("Alphabetical")),
//1=>gT('Randomize on each page load') // Shnoulle : replace by yes till we have only one solution
//2=>gT('Randomize once on survey start') //Mdekker: commented out as code to handle this was removed in refactoring
'default' => 0,
"help" => gT('Present answer options in normal, random or alphabetical order'),
"caption" => gT('Answer options order')
);
self::$attributes["showpopups"] = array(
"types" => Question::QT_R_RANKING,
'category' => gT('Display'),
'sortorder' => 110,
'inputtype' => 'switch',
'options' => array(0 => gT('No'), 1 => gT('Yes')),
'default' => 1,
"caption" => gT('Show javascript alert'),
"help" => gT('Show an alert if answers exceeds the number of max answers')
);
self::$attributes["samechoiceheight"] = array(
"types" => Question::QT_R_RANKING,
'category' => gT('Display'),
'sortorder' => 120,
'inputtype' => 'switch',
'options' => array(0 => gT('No'), 1 => gT('Yes')),
'default' => 1,
"caption" => gT('Same height for all answer options'),
"help" => gT('Force each answer option to have the same height.') . ' ' . gT('If you have a lot of items and use a filter you can disable this to improve browser speed.')
);
self::$attributes["samelistheight"] = array(
"types" => Question::QT_R_RANKING,
'category' => gT('Display'),
'sortorder' => 121,
'inputtype' => 'switch',
'options' => array(0 => gT('No'), 1 => gT('Yes')),
'default' => 1,
"caption" => gT('Same height for lists'),
"help" => gT('Force the choice list and the rank list to have the same height.') . ' ' . gT('If you have a lot of items and use a filter you can disable this to improve browser speed.')
);
self::$attributes["parent_order"] = array(
"types" => Question::QT_COLON_ARRAY_NUMBERS,
'category' => gT('Display'),
'sortorder' => 100,
'inputtype' => 'text',
"caption" => gT('Get order from previous question'),
"help" => gT('Enter question ID to get subquestion order from a previous question')
);
self::$attributes["slider_layout"] = array(
"types" => Question::QT_K_MULTIPLE_NUMERICAL,
'category' => gT('Slider'),
'sortorder' => 100,
'inputtype' => 'switch',
'options' => array(0 => gT('No'), 1 => gT('Yes')),
'default' => 0,
"help" => gT('Use slider layout'),
"caption" => gT('Use slider layout')
);
self::$attributes["slider_min"] = array(
"types" => Question::QT_K_MULTIPLE_NUMERICAL,
'category' => gT('Slider'),
'sortorder' => 110,
'inputtype' => 'text',
'expression' => 2,
"help" => gT('You can use Expression manager, but this must be a number before showing the page else set to 0. If minimum value is not set, this value is used.'),
"caption" => gT('Slider minimum value')
);
self::$attributes["slider_max"] = array(
"types" => Question::QT_K_MULTIPLE_NUMERICAL,
'category' => gT('Slider'),
'sortorder' => 120,
'inputtype' => 'text',
'expression' => 2,
"help" => gT('You can use Expression manager, but this must be a number before showing the page else set to 100. If maximum value is not set, this value is used.'),
"caption" => gT('Slider maximum value')
);
self::$attributes["slider_accuracy"] = array(
"types" => Question::QT_K_MULTIPLE_NUMERICAL,
'category' => gT('Slider'),
'sortorder' => 130,
'inputtype' => 'text',
'expression' => 2,
"help" => gT('You can use Expression manager, but this must be a number before showing the page else set to 1.'),
"caption" => gT('Slider accuracy')
);
self::$attributes["slider_default"] = array(
"types" => Question::QT_K_MULTIPLE_NUMERICAL,
'category' => gT('Slider'),
'sortorder' => 210,
'inputtype' => 'text',
'expression' => 2, // must be controlled : unsure
"help" => gT('Slider start as this value. You can use Expression manager, but this must be a number before showing the page. This setting has priority over slider starts at the middle position.'),
"caption" => gT('Slider initial value')
);
self::$attributes["slider_default_set"] = array(
"types" => Question::QT_K_MULTIPLE_NUMERICAL,
'category' => gT('Slider'),
'sortorder' => 220,
'inputtype' => 'switch',
'options' => array(0 => gT('No'), 1 => gT('Yes')),
'default' => 1, /* before 3.0 : this is the default behaviour */
"help" => gT('When using slider initial value set this value at survey start.'),
"caption" => gT('Slider initial value set at start')
);
self::$attributes["slider_middlestart"] = array(
"types" => Question::QT_K_MULTIPLE_NUMERICAL,
'category' => gT('Slider'),
'sortorder' => 200,
'inputtype' => 'switch',
'options' => array(0 => gT('No'), 1 => gT('Yes')),
'default' => 0,
"help" => gT('The handle is displayed at the middle of the slider except if Slider initial value is set (this will not set the initial value).'),
"caption" => gT('Slider starts at the middle position')
);
self::$attributes["slider_orientation"] = array(
"types" => Question::QT_K_MULTIPLE_NUMERICAL,
'category' => gT('Slider'),
'sortorder' => 300,
'inputtype' => 'buttongroup',
'options' => array(
0 => gT('Horizontal', 'unescaped'),
1 => gT('Vertical', 'unescaped')
),
'default' => 0,
"help" => gT('Set the orientation.'),
"caption" => gT('Orientation')
);
self::$attributes["slider_handle"] = array(
"types" => Question::QT_K_MULTIPLE_NUMERICAL,
'category' => gT('Slider'),
'sortorder' => 320,
'inputtype' => 'singleselect',
'options' => array(
0 => gT('Circle'),
1 => gT('Square'),
2 => gT('Triangle'),