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
en:create:functions:getitemtext [24.01.2015 15:44] – [Example 1] alexander.ritteren:create:functions:getitemtext [26.08.2020 22:14] (current) sophia.schauer
Line 2: Line 2:
  
 ''string **getItemtext**(string //questionID//, int //item//)'' ''string **getItemtext**(string //questionID//, int //item//)''
 +''string **getItemtext**(string //ItemID//)''
  
 An item's or option's label can be determined with this function -- e.g. to use the text in another question or to display in the print view for the participant. The function can also determine the text in the question. An item's or option's label can be determined with this function -- e.g. to use the text in another question or to display in the print view for the participant. The function can also determine the text in the question.
Line 10: Line 11:
     * '''question''' -- Question's title     * '''question''' -- Question's title
     * '''explanation''' -- Question's explanation     * '''explanation''' -- Question's explanation
 +  * //ItemID//\\ The identifier of an item, e.g. "AB01_02".\\ Instead of specifying question identifier and item separately, the item identifier can also be entered directly.
  
-**Note:** It is often easier to use the function ''[[:en:create:functions:value|value()]]'' with  '''text''' or '''free''' as the second parameter (compare example 1).+**Note:** selection questions it is often easier to use the function ''[[:en:create:functions:value|value()]]'' with  '''text''' or '''free''' as the second parameter (compare example 1).
  
  
Line 32: Line 34:
 <code php> <code php>
 $title = value('AB01', 'free');  // Respondent's selection as text $title = value('AB01', 'free');  // Respondent's selection as text
-replace('%title%', $titel);  // Set up placeholder+replace('%title%', $title);  // Set up placeholder
 question('AB02');  // Ask question AB02 question('AB02');  // Ask question AB02
 </code> </code>
en/create/functions/getitemtext.txt · Last modified: 26.08.2020 22:14 by sophia.schauer
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki