Toggle menu
876
3.8K
30.2K
279.1K
Catglobe Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Rotate answer options/sub questions

From Catglobe Wiki
Revision as of 04:23, 6 January 2012 by Cg van (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Rotate answer options/sub questions

In order to synchronize the answer option/sub question rotation among more than one questions

As a questionnaire creator

I want to control the rotation by setting explicitly the first item in a range after rotation

Rotate answer options

Example

  • I have a list of drinks as answer options

  • I want to have Mirinda as the top answer option in the list and keep None of the above in its original position

 

Solution

Set the rotation range from 0-5 with rotation index is 3

Code

  • Add a Single question to Questionnaire editor
  • Go to menu Properties -> Question scripts -> Java script and input below script


quest.rotateAnswerOptions(0, 5, 3);

Note Note: quest.rotateAnswerOptions(startIndex, endIndex, rotateIndex): rotate answer options in a range specified by startIndex and endIndex, the first item in the range will be rotateIndex


Rotate sub questions

Example

  • I have a single grid question like below image


  • I want to have Mirinda as the top sub question in the list


Solution

Set the rotation range from 0-5 with rotation index is 3

Code

  • Add a Single grid question to Questionnaire editor
  • Go to menu Properties -> Question scripts -> Java script and input below script


quest.rotateSubQuestions(0, 5, 3);

Note Note: quest.rotateSubQuestions(startIndex, endIndex, rotateIndex): rotate sub questions in a range specified by startIndex and endIndex, the first item in the range will be rotateIndex



Source

Questionnaire Resource Id on cg site: 159730