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:question [12.07.2016 14:25] adminen:create:functions:question [29.09.2020 16:47] – [question()] sophia.schauer
Line 1: Line 1:
 ====== question() ====== ====== question() ======
  
-''void **question**(string //questionID//, array|string //items//, [string //options//])''+''void **question**(string|array //questionID//, array|string //items//, [string //options//])''
  
 Shows the question with the specified //questionID// in the questionnaire. The function ''question()'' is mainly used with [[:en:create:filters|Filters and Conditional Questions]]. Shows the question with the specified //questionID// in the questionnaire. The function ''question()'' is mainly used with [[:en:create:filters|Filters and Conditional Questions]].
  
-  * //questionID//\\ The four-digit ID is composed of the ID of the section and the question (both two-digit) and must be given in quotation marks (single or double), e.g. '''XY01'''+  * //questionID//  
 +    * The four-digit ID is composed of the ID of the section and the question (both two-digit) and must be given in quotation marks (single or double), e.g. '''XY01'''.  
 +    * (array) You can also specify an array with multiple question IDs. These are then displayed as [[:en:create:combine|combined question]]], just like when using the parameter ''combine=...''.
   * //items//\\ The second parameter can optionally be used to specify which items in the question should be shown and/or in what order this occurs. The item IDs are either specified as an array (''array(2,4,6,8)'') or separated with a comma as a string ('''2,4,6,8''').  In order to describe items 1, 3, 5, 6, 7, 8, 9 and 10, number ranges can also be specified in the item list, e.g. '''1,3,5-10''' or ''array(1,3,'5-10')''   * //items//\\ The second parameter can optionally be used to specify which items in the question should be shown and/or in what order this occurs. The item IDs are either specified as an array (''array(2,4,6,8)'') or separated with a comma as a string ('''2,4,6,8''').  In order to describe items 1, 3, 5, 6, 7, 8, 9 and 10, number ranges can also be specified in the item list, e.g. '''1,3,5-10''' or ''array(1,3,'5-10')''
   * //options//\\ There is a large range of options available for fine-tuning. Any number of options can be specified for each ''question()'' command. Put each option in quotation marks (single or double) and separate multiple options with commas (see example below).    * //options//\\ There is a large range of options available for fine-tuning. Any number of options can be specified for each ''question()'' command. Put each option in quotation marks (single or double) and separate multiple options with commas (see example below). 
Line 21: Line 23:
     * '''gap=line'''\\ Display a line between the combined questions. The space or the line is displayed equally between all combined questions.      * '''gap=line'''\\ Display a line between the combined questions. The space or the line is displayed equally between all combined questions. 
   * //options//\\ Some options are intended to dynamically overwrite the question's settings:   * //options//\\ Some options are intended to dynamically overwrite the question's settings:
-    * '''filter=<specification>'''\\ Prefix for the database key in a question type "Extended Selection" or "Suggesting Text Input" (e.g. '''filter=country''' to show all database entries whose key begins with "country").+    * '''filter=<specification>'''\\ Prefix for the database key in a question type "Extended Selection" or "Suggesting Text Input" (e.g. '''filter=country''' to show all database entries whose key begins with "country"). To allow the correct encoding of a response in the suggesting text input, at least a part of the prefix mus be set in the question itself as //prefix//. The parameter in ''question()'' can then narrow down these options.
     * '''direction=<up|down>'''\\ Arrange selection options in a scale or in a horizontal selection in ascending (''up'') or descending (''down'') order.     * '''direction=<up|down>'''\\ Arrange selection options in a scale or in a horizontal selection in ascending (''up'') or descending (''down'') order.
     * '''composition=<default|extended|dense>'''\\ Customize setting for //Composition of a Question// .     * '''composition=<default|extended|dense>'''\\ Customize setting for //Composition of a Question// .
     * '''align-labels=<center|inside|outside|eachline>'''\\ Customize alignment of the verbal anchor in a scale with only the extremes labeled. This parameter overwrites the respective setting in the question dynamically.     * '''align-labels=<center|inside|outside|eachline>'''\\ Customize alignment of the verbal anchor in a scale with only the extremes labeled. This parameter overwrites the respective setting in the question dynamically.
     * '''shading=<auto|none|start-shaded|start-unshaded|all-shaded|all-unshaded>'''\\ Item shading.     * '''shading=<auto|none|start-shaded|start-unshaded|all-shaded|all-unshaded>'''\\ Item shading.
 +    * '''flip-inputs'''\\ In most questions you can set whether the input fields (e.g. check boxes) should be on the left or right side of the labels. With this parameter you can invert the setting.
  
 ===== Tips ===== ===== Tips =====
en/create/functions/question.txt · Last modified: 05.09.2023 22:42 by swissel.uni-mannheim
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki