Difference between revisions of "Question getQuestion"

From Catglobe Wiki
Jump to: navigation, search
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Category:Questionnaire_Functions]]
 
[[Category:Questionnaire_Functions]]
 
{{HelpFiles}}
 
{{HelpFiles}}
 +
__NOTOC__
  
====Question_getQuestion====
+
=Question_getQuestion=
  
 
Get a question object by its label
 
Get a question object by its label
  
'''Syntax'''
+
===Syntax===
  
 
Question_getQuestion(''qualifiedLabel, isoCode'')
 
Question_getQuestion(''qualifiedLabel, isoCode'')
Line 14: Line 15:
 
Question_getQuestion(''qualifiedLabel'')
 
Question_getQuestion(''qualifiedLabel'')
  
'''Arguments'''
+
===Arguments===
  
 
* ''qualifiedLabel '': is a ''string ''expression. It is the label of the question, it might contain the questionnaire's qualified name
 
* ''qualifiedLabel '': is a ''string ''expression. It is the label of the question, it might contain the questionnaire's qualified name
 
* ''isoCode '': is a ''string ''expression. It is the ISO code of a language, if it is not specified, the current user's language (if it is defined in the questionnaire template) or the question's default language will be used
 
* ''isoCode '': is a ''string ''expression. It is the ISO code of a language, if it is not specified, the current user's language (if it is defined in the questionnaire template) or the question's default language will be used
  
'''Return value'''
+
===Return value===
  
 
An ''array'', it is the question object, which contains the following items:
 
An ''array'', it is the question object, which contains the following items:
Line 45: Line 46:
 
| style="border: 1px solid #010101" width="479" |
 
| style="border: 1px solid #010101" width="479" |
 
Type of question
 
Type of question
 +
 +
<br>NotSet = 0,
 +
<br>Single = 1,
 +
<br>Multi = 2,
 +
<br>Number = 3,
 +
<br>Text = 4,
 +
<br>Open = 5,
 +
<br>SingleGrid = 6,
 +
<br>MultiGrid = 7,
 +
<br>TextGrid = 8,
 +
<br>Page = 9,
 +
<br>Multimedia = 10,
 +
<br>Scale = 11,
 +
<br>ScaleGrid = 12
 +
 
|- align="left" valign="top"
 
|- align="left" valign="top"
 
| style="border: 1px solid #010101" width="292" |
 
| style="border: 1px solid #010101" width="292" |
Line 73: Line 89:
 
| style="border: 1px solid #010101" width="479" |
 
| style="border: 1px solid #010101" width="479" |
 
Sub questions
 
Sub questions
 +
|}
  
'''Example'''
+
===Example===
  
''array q1 = Question_getQuestion("5312BMW\\5312bmw_SALES_CATI_2008\\S_OUTLET_ID");''
+
<source lang="javascript">
  
''array q2 = Question_getQuestion("S_OUTLET_NAME", "en-GB");''
+
array q1 = Question_getQuestion("5312BMW\\5312bmw_SALES_CATI_2008\\Gender");
  
'''Availability'''
+
array q2 = Question_getQuestion("Gender", "en-GB");
  
Version 5.6
+
//output : {12,364872,1,Gender,<p> Your sex : </p>,{{13,1,Male},{13,2,Female},{13,3,Don't want to tell}},{}}
__NOTOC__
+
 
<!-- imported from file: 6272.htm-->
+
</source>

Latest revision as of 08:38, 13 November 2015




Question_getQuestion

Get a question object by its label

Syntax

Question_getQuestion(qualifiedLabel, isoCode)

or

Question_getQuestion(qualifiedLabel)

Arguments

  • qualifiedLabel : is a string expression. It is the label of the question, it might contain the questionnaire's qualified name
  • isoCode : is a string expression. It is the ISO code of a language, if it is not specified, the current user's language (if it is defined in the questionnaire template) or the question's default language will be used

Return value

An array, it is the question object, which contains the following items:

Index

Data type

Value

QUESTION_ID

number

Id

QUESTION_TYPE

number

Type of question


NotSet = 0,
Single = 1,
Multi = 2,
Number = 3,
Text = 4,
Open = 5,
SingleGrid = 6,
MultiGrid = 7,
TextGrid = 8,
Page = 9,
Multimedia = 10,
Scale = 11,
ScaleGrid = 12

QUESTION_LABEL

string

Label

QUESTION_TEXT

string

Question's text (in the specified language)

QUESTION_ANSWER_OPTIONS

array

Answer options

QUESTION_SUB_QUESTIONS

array

Sub questions

Example

array q1 = Question_getQuestion("5312BMW\\5312bmw_SALES_CATI_2008\\Gender");

array q2 = Question_getQuestion("Gender", "en-GB");

//output : {12,364872,1,Gender,<p> Your sex : </p>,{{13,1,Male},{13,2,Female},{13,3,Don't want to tell}},{}}