Difference between revisions of "Question getQuestion"
Cg huyphong (talk | contribs) |
|||
Line 2: | Line 2: | ||
{{HelpFiles}} | {{HelpFiles}} | ||
− | + | =Question_getQuestion= | |
Get a question object by its label | Get a question object by its label | ||
− | + | ===Syntax=== | |
Question_getQuestion(''qualifiedLabel, isoCode'') | Question_getQuestion(''qualifiedLabel, isoCode'') | ||
Line 14: | Line 14: | ||
Question_getQuestion(''qualifiedLabel'') | Question_getQuestion(''qualifiedLabel'') | ||
− | + | ===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=== | |
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 90: | Line 90: | ||
|} | |} | ||
− | + | ===Example=== | |
<source lang="javascript"> | <source lang="javascript"> | ||
Line 101: | Line 101: | ||
</source> | </source> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 08:37, 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
|
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}},{}}