void question(string|array QuestionIdentifier, array|string Items, [string Options])
Displays the question with the specified questionIdentifier in the questionnaire. The function question()
is mainly used in conjunction with Filters and filter questions.
'XY01
'.combine=…
parameter.array(2,4,6,8)
) or separated by a comma as a string ('2,4,6,8
). Numerical ranges can also be specified in the item list, e.g., '1,3,5-10
' or array(1,3,'5-10')
to describe items 1, 3, 5, 6, 7, 8, 9, and 10.question()
command any number of options can be specified. Put each option in quotes (single or double) and separate multiple options with commas (see examples below).'show-title=no'
'show-explanation=no'
'show-items=no'
'spacing=<n>'
'number=<n>'
number=<n>
or number=yes
you can then assign a number to individual questions.'anchor=<amount>
''anchor=none
''random
''random=<n>
''gap=<value>
''gap=20
').'gap=line
''filter=<value>
''filter=country
' to display all database entries whose key starts with “country”). For the encoding of an answer to work correctly with the selection recommendation, at least part of the prefix must be entered in the question itself as prefix for database key. By means of question()
a narrowing down can then be done. vorgenommen werden.'direction=<up|down>
'up
) or descending (down
) order.'composition=<default|extended|dense>
''align-labels=<center|inside|outside|eachline>
''shading=<auto|none|start-shaded|start-unshaded|all-shaded|all-unshaded>
''flip-inputs
'
Important: A call to the function question()
is equivalent to dragging and dropping a question into the questionnaire. If you include a question with the question()
command (e.g. in a filter), then make sure that the same question was not additionally placed on the page by dragging it in. Otherwise the question will appear twice.
Important: SoSci Survey distinguishes between upper and lower case letters in the identifier and all options.
Note: Both the identifier and other options must be written as a string, usually in single or double quotation marks (see examples).
Tip: You can dynamically display only those items that the participant has selected in another question. For more information see Transfer items to another question.
Tip: You do not have to type the question()
command by hand. You can also simply drag a question into a PHP-code element, see Introduction to PHP code: Programming more conveniently (questions and texts).
question('BS10'); // Daily television usage. question('BS01', '2,1,4,5'); // Items 2, 1, 4 and 5 are asked here. question('NH02', 'random=3'); // 3 items are randomly selected question('AA01', 'show-title=no'); // hide question text // The following three lines show items 1 to 4 and 6 of question BS07 respectively question('BS07', array(1,2,3,4,6)); question('BS07', array('1-4',6)); question('BS07', '1-4,6'); question('SK01', 'spacing=4'); // Show a scale and directly below it ... question('SK02', '1', 'show-title=no'); // ... the first item of an open text entry "Other: ___".