In the Introduction to order tags article, we cover the basic usage of the order
tag. This article provides additional simple examples of how to apply shorthand notations with the order
tag.
Examples
Randomizing all options and anchoring options at the end
Use the '$' sign to anchor the final element in a list while randomizing the others. Alternatively, you can use the anchor: y
decorator with the order
tag, as shown in Q6A. Both methods achieve the same result.
6. Which of the following colors is your favorite?
type: radio
order: [*],$
1. Blue
2. Green
3. Red
4. Orange
5. Yellow
97. Other {autoother: y; size: 10}
6A. Which of the following colors is your favorite?
type: radio
order: [*]
1. Blue
2. Green
3. Red
4. Orange
5. Yellow
97. Other {autoother: y; size: 10} {anchor: y}
Randomizing all options and anchoring options at the beginning
Use the '^' sign to anchor the first element in a list while randomizing the others. Alternatively, you can use the anchor: y
decorator with the order
tag, as shown in Q6C. Both methods achieve the same result.
6B. Which of the following colors is your favorite?
type: radio
order: ^,[*]
97. Other {autoother: y; size: 10}
1. Blue
2. Green
3. Red
4. Orange
5. Yellow
6C. Which of the following colors is your favorite?
type: radio
order: [*]
97. Other {autoother: y; size: 10} {anchor: y}
1. Blue
2. Green
3. Red
4. Orange
5. Yellow
Ordering a spreadsheet
The order
tag can be used on a define sheet
widget to set the order for a sheet for the entire survey or added to a listcall to apply it to a single question.
In the example below, the define sheet
widget applies an order to the 'countries' sheet. Wherever this sheet is used, such as in Q1A, the specified order will apply. However, in Q1B, the order
tag is applied at the optsfrom
listcall, so randomization is only applied to the 'food' sheet in this specific instance.
definesheet: surveyID.countries
order:[*]
1A. What is your favorite country?
type: radio
optsfrom: surveyID.countries
1B. What is your favorite food?
type: radio
optsfrom: surveyID.food
order:[*]
Randomizing the starting point of a sequential order
Using order: <*>
selects a random starting point in a list and then follows the list in sequential order.
3A. Please select your favorite letter of the alphabet.
type: radio
order:<*>
1. A
2. B
3. C
4. D
5. E
6. F
7. G
Randomizing the starting point and anchoring options at the end
Building on the previous example, you can have a randomized starting point while still anchoring specific options by specifying their positions. For example, the final element is always anchored with a dollar sign '$', the one before it with '$-1', and so on. In the example below, options 8 and 99 are added and will always be anchored at the end of the list.
3B. Please select your favorite letter of the alphabet.
type: radio
order:<*>,$-1,$
1. A
2. B
3. C
4. D
5. E
6. F
7. G
8. Z
99. None of these
The anchor: y
decorator could also be used with order: <*>
to anchor the last two options in place.
Randomizing the starting point and anchoring options at the beginning
You can also apply a randomized order to a list while still anchoring specific options at the beginning by specifying their positions. Whereas the final element of a list is anchored with a '$', with preceding elements specified by subtracting from it (e.g., '$-1', '$-2', etc.), the first element is anchored with a carat, '^', and subsequent elements are specified by adding to it (e.g., '^+1', '^+2', etc.).
In the example below, Q8 has a purely randomized order, but the first two options are anchored in their positions.
8. Which of the following fruits is your favorite?
type: radio
order: ^,^+1,[*]
1. Apples
2. Oranges
3. Pears
4. Plums
5. Bananas
6. Strawberries
7. Peaches
Randomizing the starting point of alphabetized options
Using order: AtoZ<*>
selects a random starting point in an alphabetized list and then follows the list in alphabetical order.
5. Please select one.
type: radio
order: AtoZ<*>
1. time
2. person
3. year
4. way
5. day
6. thing
7. man
8. world
9. life
Comments
0 comments
Please sign in to leave a comment.