As with lists, groups of pages can be ordered and randomized. By using an order
tag, the sequence in which pages defined within groups may be manipulated. This is useful for many of the same reasons one might randomize options within lists: to eliminate bias introduced by fatigue. To order pages within groups, use an order
tag when the group is defined.
Syntax
startgroup: RANDOMIZE_PAGES order:[*] Page 1 newpage Page 2 endgroup: RANDOMIZE_PAGES
Examples
Nested ordering
The order
tag will also work with nested groups, so that sets of pages can be ordered within other ordered groups. In this next example, pages 1 and 2 are randomized, as are pages 3 and 4. However, each set of randomized pages will always appear together.
Nested ordering with single 'order' tag
The order
tag, when applied to groups, still supports all of the same inputs as it does when it is applied to lists. The following example retains the same nested group ordering as the previous, but does so by using a single order
tag instead of nested groups with order
tags:
Blocks
Blocks require external data sources to provide the content for substitutions. When the data source is a list, the block will render following the order specified in that list. In the following examples, this block will generate the numbers from 1 to 10 in a random order because the list BLOCK_LIST has a randomize input on the order
tag:
Blocks with inline list call
Blocks data sources may also be ordered by including an [order]
decorator on the list call:
Assigning order with a variable
As with other uses of the order
tag, the order can be defined using a variable. This allows for finer control over the order used in across the survey data. In this example, the order of the questions is assigned by lowest counts to be either '1,2,3' or '3,2,1', so an even number of respondents will get each order.
Accounting for random order of inline elements
In the example below, the inline: y
and ap: n
tags on the outer group allows the contained groups questions within them to be displayed on a single page in a random order.
Groups work a bit like set defaults
- tags applied to the start group
widget apply to all groups and questions therein.
Comments
0 comments
Please sign in to leave a comment.