IUserAccessiableGetAnswers Method (Int32, Int32, Boolean) |
Relevant for all questions.
Returns a list of inMaxSize selected answers (or all of them if inMaxSize is larger than the number of selected answers) depending on the question type in a randomized order.
For example for a Single Choice question it would rerutn the selected answer (equivalent to Answer(inQuesIdx)).
For a Multiple Selection question it would return a list of inMaxSize selected answers in a randomized order.
Namespace: SurveyToGo.UserLogic.InterfacesAssembly: UserLogicInt.Pocket (in UserLogicInt.Pocket.dll) Version: 1.0.4.0
Syntax int[] GetAnswers(
int inQuesIdx,
int inMaxSize,
bool inRandom
)
Parameters
- inQuesIdx
- Type: SystemInt32
Index of question - inMaxSize
- Type: SystemInt32
An integer specifying the max amount of results to get - inRandom
- Type: SystemBoolean
true or false
Return Value
Type:
Int32Array containing the selected answers indexes
Examples
For a Multiple Selection question with answers 1,2,3,4,5,6 and 3,5 selected
The following code will return one of the 2:
- "First value selected is: 2 Second value selected is: 5"
- "First value selected is: 5 Second value selected is: 2"
var i=GetAnswers(CurrQues, 2, true);
Prompt("First value selected is: " + i[0] + " Second value selected is: " + i[1]);
The following code will return one of the 2 as well as 3 is larger than the maximum available answers:
- "First value selected is: 2 Second value selected is: 5"
- "First value selected is: 5 Second value selected is: 2"
var i=GetAnswers(CurrQues, 3, true);
Prompt("First value selected is: " + i[0] + " Second value selected is: " + i[1]);
The following code will return one of the 2:
- "First value selected is: 2"
- "First value selected is: 5"
var i=GetAnswers(CurrQues, 1, true);
Prompt("First vallue selected is: " + i[0]);
See Also