Inhaltsverzeichnis

question()

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.

Notes

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).

Examples

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: ___".