The order from tag allows you use the order from a previous list, question, or variable.
set list: SODA
randomize: y
1. Cola
2. Root beer
3. Lemon-lime
2. Which of these soda types are you familiar with?
type: checkbox
optsfrom: SODA
3. And which of these brands are you familiar with?
type: checkbox
order from: SODA
1. Coke, Pepsi
2. A&W, Mug
3. Sprite, StarryIn the example above, Q3 will display the options in the same order as those in the list SODA are displayed at Q2.
Details
- The
order fromtag accepts a question label (e.g.,Q1) or aset listname as input. It then applies the ordering from the referenced widget. - The list or question label referenced by
order frommust have anorderorrandomizetag to parse successfully. - The
order fromtag has variantsrow order fromandcol order fromto reorder table rows or columns based on the order of another widget. - The
order fromtag can be used inline with listcalls likeoptsfrom,rowsfrom, orcolsfromusing square brackets.
Caution: Both the widget using order from and the referenced widget must have the same number of options to avoid missing options.
Additional examples
Using related tags 'row order from' and 'col order from'
When used in a table, the order from tag will re-order the table's options list only. To re-order the rows or columns of a table, use the variants row order from and col order from. These tags will apply the ordering from the widget specified to the table's rows and columns, respectively.
In this example, the rows appear in the same order as the options from the MY_LIST widget.
set list: MY_LIST
order: (5,3,4,1,2)
optsfrom: series[1..5]
4. How often do you use these brands?
type: radio table
optsfrom: series[1..5]
headings: Never, Always
row order from: MY_LIST
rows:
1. IBM (1)
2. Kleenex (2)
3. Sony (3)
4. Nabisco (4)
5. Helsinki (5)
Inline as a decorator
The order from tag may also be used as a decorator on a listcall (optsfrom/rowsfrom/colsfrom). To do this, use square brackets.
5. This is a question with ordered options.
type: radio
randomize: y
optsfrom: series[1..5]
set list: OPTIONS_FOR_Q6
1. Strip mall (1)
2. Parking spot (2)
3. Peach tree (3)
4. Golf ball (4)
5. Mining (5)
6. This is a question that will use the order from Q5.
type: radio
optsfrom: OPTIONS_FOR_Q6 [order from: Q5]
Comments
0 comments
Please sign in to leave a comment.