[[value()]]
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
en:create:functions:value [03.12.2014 08:15] alexander.ritteren:create:functions:value [30.04.2021 09:57] sophia.schauer
Line 5: Line 5:
 The participant's responses (answer codes, selected options or text inputs) can be determined with this function.  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:** Only responses given by the participant on an __earlier__ page in the questionnaireand already transmitted to the server with "Next" can be called up. 
  
-  * //variable//\\ ID of the variable to be read. The correct ID can always be found in the **Variables Overview**. The variable ID is usually (not always) composed of section, question and, if applicable, item ID and must be given as a string (in quotation marks) (e.g. '''XY01_02'''). +  * //variable//\\ ID of the variable to be read. The correct ID can always be found in the **Variables Overview**.  
 +    * The variable ID is usually (not always) composed of section, question and, if applicable, item ID and must be given as a string (in quotation marks) (e.g. '''XY01_02''').  
 +    * Besides the variables of questions, the following variables are also available: CASE, MISSING, SERIAL, REF, QUESTNNR, MODE, LANGUAGE and STARTED
   * //outputformat//\\ The output format determines whether the function returns the answer code (default) or the label text of the response. The following entries are allowed:   * //outputformat//\\ The output format determines whether the function returns the answer code (default) or the label text of the response. The following entries are allowed:
-    * '''code'''\\ Default format for ''value()'': answer code according to the **Variables Overview** (also returned if no answer format is specified), for text input questions this is the text entered.  +    * ''%%'code'%%''\\ Default format for ''value()'': answer code according to the **Variables Overview** (also returned if no answer format is specified), for text input questions this is the text entered.  
-    * '''label'''\\ Answer code label (selection questions: option, multiple-choice selection: "not selected" or "selected", scales: value label).  +    * ''%%'label'%%''\\ Answer code label (selection questions: option, multiple-choice selection: "not selected" or "selected", scales: value label).  
-    * '''text'''\\ Answer option label as in questionnaire (selection question: selected option, multiple-choice selection: option text if selected, nothing else).  +    * ''%%'text'%%''\\ Answer option label as in questionnaire (selection question: selected option, multiple-choice selection: option text if selected, nothing else).  
-    * '''free'''\\ If you allow a selection with a free text input field, this option displays the text of the selected option __or__ the free text input, if one of these was done. +    * ''%%'free'%%''\\ If you allow a selection with a free text input field, this option displays the text of the selected option __or__ the free text input, if one of these was done.  
 +    * ''%%'csv'%%''\\ Divides the label by commas (CSV) and returns an array.  This can be used in combination with a random number generator for multi-factorial experimental designs ([[:en:create:randomization]]).
  
 ===== Application in Filters  ===== ===== Application in Filters  =====
  
-**Tip:** Please also see [[:en:create:filters|Filters and Conditional Questions]].+**Tip:** Please also see [[:en:create:filters|Filters and Conditional Questions]] and [[:en:create:transfer-responses]].
  
-The respondent answered question ''07'' in section ''AB'' (a dichotomous scale) on the previous page. The following code calls up question ''XY01'' only if the participant answered item ''03'' in the question ''AB07'' with "yes" (in this example with the value 2):+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'':
  
 <code php> <code php>
en/create/functions/value.txt · Last modified: 03.05.2024 09:27 by jdupont
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki