CountAnswers: Difference between revisions
From Catglobe Wiki
More actions
No edit summary |
No edit summary Β |
||
Line 4: | Line 4: | ||
====countAnswers==== | ====countAnswers==== | ||
Returns the number of selected answers belonging to the specified question. | Returns the number of selected answers belonging to the specified question. This function run in question context | ||
'''Syntax''' | '''Syntax''' | ||
countAnswers('' | countAnswers(''questionLabel'') | ||
Β | |||
or | |||
Β | |||
countAnswers(''questionPath'') | |||
'''Arguments''' | '''Arguments''' | ||
''question'': | ''questionLabel'': a string expression. It is the label of a question Β | ||
Β | |||
''questionPath'': a string expression. It is the path of a question Β | |||
'''Return type''' | '''Return type''' | ||
Line 19: | Line 25: | ||
'''Examples''' | '''Examples''' | ||
Β | <source lang="javascript"> | ||
// | //Q1 is a multi question with 5 options, then respondent select 2 of 5, countAnswers will return 2 | ||
Β | number n = countAnswers("Q1"); | ||
// | //or | ||
Β | number n = countAnswers(Q1.QuestionLabel); | ||
number n = countAnswers( | //or | ||
Β | number n = countAnswers(Resource_getResourceName(qnaireRId) + "\\Q1"); | ||
</source> | |||
'''Availability''' | '''Availability''' | ||
Latest revision as of 04:48, 23 August 2019
ο»Ώ
countAnswers
Returns the number of selected answers belonging to the specified question. This function run in question context
Syntax
countAnswers(questionLabel)
or
countAnswers(questionPath)
Arguments
questionLabel: a string expression. It is the label of a question
questionPath: a string expression. It is the path of a question
Return type
number
Examples
//Q1 is a multi question with 5 options, then respondent select 2 of 5, countAnswers will return 2
number n = countAnswers("Q1");
//or
number n = countAnswers(Q1.QuestionLabel);
//or
number n = countAnswers(Resource_getResourceName(qnaireRId) + "\\Q1");
Availability
Version 4.8