TopAnswers

From Catglobe Wiki
Jump to: navigation, search



Question_getTopSelectedAnswers

Returns an array of answers using an existing multi question, where the returned array will be a subset of the original question values filtered using a position and length parameter.

Syntax

Question_getTopSelectedAnswers(questionName,position,length[,index])

Arguments

questionName: String - An existing multi question label or multi grid question label in the context questionnaire.

position: Number from 0 and up. Defines the first answer that will be included in the new array from the original data.

length: Number from 1 and up. Defines the number of answers to be included in the new array as starting from the position in the original data.

index: A sub question index to be used for multi grid questions. If omitted, we will get array returned from all sub questions of the multi grid question.

Return type

array

Examples

Question_getTopSelectedAnswers(originalmulti,1,1)

// given that the originalmulti question is Multi question

... [1,2,3,4,5] then returned array becomes [2]

... [5,4,3,2,1] then returned array becomes [4]

... [1,2,3] then returned array becomes [2]

... [5,4,3] then returned array becomes [4]

... [1,2] then returned array becomes [2]

... [2] then returned array becomes []

Availability

Version 5.6