This script allows participants to see Choice question options with fixed headers. Under the fixed headers, the individual answer options are randomized. The answer option groups are also randomized.
This script works on the following question types:
- Single Choice Questions (standard)
- Multi Choice Questions (standard)
Example
Note: Items within a randomized group cannot be locked (for example, cheese, egg and milk).
Detailed Steps
- Create your choice question and add the answer options.
- Configure your answer properties.
- Select Header to set the answer option as a header. In the example above, headers are items 1 and 5.
- Select Randomize in the properties of the question.
- Lock answer options that you do not want to be randomized. In the example above, the position of items 10 and 11 should be locked.
- Copy the script from below.
- Select the question in the Questionnaire Tree.
- In the Scripting section, click Edit Scripts.
- Paste the script into On Load tab.
- Change Q_NAME to the name of your question or page.
- Change # to group item numbers including the header separated by a comma. E.g. 1,2,3,4
Note: The numbers should be item positions, not precodes - Click Save.
- Validate and test your survey.
- If you have multiple groups you would like to keep together, repeat step 1 to 10.
Script
/* Script Name: How do I randomize options with headers? (Power Surveys) To ensure your script works as expected, always copy the original script from the script library found in the support portal. Failure to use the most up to date script from the script library may cause unexpected results. */ GroupItemsWithHeader(Q_NAME, new int[] {#});
Following with the example above, the 2 lines of script below groups items 1,2,3 and 4 together and keep item 1 always as the 1st position within the group. Similarly it will group items 5,6,7,8 and 9 together and keep item 5 always as the 1st position within the group on Q1.
GroupItemsWithHeader(Q1, new int[] {1,2,3,4}); GroupItemsWithHeader(Q1, new int[] {5,6,7,8,9});
More information
Please click on the WebHelp links below for more information:
Comments
0 comments
Article is closed for comments.