Inhaltsverzeichnis

value()

mixed value(string variable, [string outputformat])

The participant's responses (answer codes, selected options or text inputs) can be determined with this function.

Note: Only responses given by the participant on an earlier page in the questionnaire, and already transmitted to the server with “Next” can be called up.

Note: The value() function can also read the draw of a random generator. This is already possible on the same page on which the random generator was placed, if the PHP-Code is placed below the random generator.

Note: The retention time (“TIME001”, “TIME002”, …) can't be read out using value(). Please use the function caseTime() for this.

Application in Filters

Tip: Please also see Filters and Conditional Questions and Show Answers in a Follow-up Question.

The respondent answered question 07 in section AB (a dichotomous scale) on the previous page. The following code only calls up question XY01 if the participant answered “yes” (in this example with the value 2) to the item 03 in question AB07:

if (value('AB07_03') == 2) {
  question('XY01');
}

Display Individual Response

The participant can select their favorite school subject or write it in themselves in “other:”. The subject should be displayed on a later page.

Tip: Please also see Placeholders.

$subject = value('AB08', 'free');
html('<h1>School subject: '.$subject.'</h1>');