Single Grid

From Catglobe Wiki
Jump to: navigation, search



Single Grid

An identifier with array type is created for each Single Grid question. The array is zero-index based, its size is equal to the number of sub questions. It contains number items, which are the selected answer option values for each sub question.

Example

5707.jpg

if (Q6[0] == 1)//check if the answer option value 1 has been chosen for the first sub question

//do something

else if (Q6[1] == [1-3]//check if any answer option having value from 1 – 3 has been chosen for the second sub question

//do something else

...

Answer option can be set to selected by assigning its value to the sub questions.

Example

Q6[0] = 1;

Q6[1] = 3;

Q6[2] = 2;

Q6 = {1,3,2};//serve the same purpose as the 3 previous lines

Back to: Single