Collections are groups of options, lists, or sheets. A closed-end question widget has a single collection of options by default. This default collection is created either via a single listcall or inline options attached the question.
There are two different ways a widget can have multiple collections:
- collection headers
- listcall tags.
An order or randomize tag applied to the question or set list widget will order the options within a single collection. However, when multiple collections are present, this behavior changes.
Collection headers
First, if a list includes multiple collection headers, each will generate its own collection. Collection headers are indicated by placing the collection header decorator next to the list item. In the example below, CATEGORIES has two collections: '100. Shoes' and '200. Hats'.
set list: CATEGORIES
100. Shoes {collection header: y}
1. Running shoes
2. Flats
3. Sandals
200. Hats {collection header: y}
4. Cowboy
5. Fedora
6. Baseball
Listcall tags
Second, listcall tags (optsfrom, rowsfrom, etc.) create collections. In this example, ALLFRUITS has two collections. It includes option '20. Avocado' in its default collection, plus the elements from the optsfrom tag, FRUITS.
set list: FRUITS 10. Banana 11. Orange 12. Apple set list: ALLFRUITS 20. Avocado optsfrom: FRUITS
Note: When combining locally defined options, headers, and/or listcalls, ensure all option IDs are unique.
Order
Options are displayed in their natural order (the order they are programmed) unless the order or randomize tag is included, or additional collection decorators are added to specify the placement.
Natural order
Consider the following example. The placement of each option and collection is key. The list FOODANDDRINK shows options 13, 14, and 15 within the 'Condiments' collection because it's pulled in with optsfrom: FOOD. Then, option 20 appears as the first option in the question's list because it's programmed inline and placed before the optsfrom listcall.
Tip! Combining multiple collections can be complex. The system will try to render them correctly, but it's best to test the order several times. If the results aren't what you expected, you may need to create a new list with all options and use explicit ordering.
Tags to modify order
In the context of multiple collections, order can be defined on the question widget, on the set list, or as a decorator on the collection header.
For simplicity's sake, the order tag is mentioned below, but the behavior is the same for all tags where order can be defined — randomize, order: AtoZ, order: ZtoA, alphabetize, etc.
-
On a question widget: An
ordertag on a question widget defines the order of the collections and extends to the options within them. For example, applyingrandomize: ywill randomize both collections and their options, but the options won't mix across collections. -
On a set list: An
ordertag on a set list with collections works the same as on a question widget. -
On a collection header as a decorator: A tag placed on a collection header, such as
100. Shoes {collection header: y} {randomize: y}, will only affect the order within that collection, not others.
If a list is randomized with order or randomize tags, or is alphabetized, any "Other" specifies using the autoother decorator will be automatically fixed in place, staying last in their respective groups.
Tip! You can use the collection decorator to assign a list item to a different collection; for example, 4. Sandals {collection: 100}. When added, the item is placed in the collection specified after the colon.
Additional examples
Randomize the order of the groups only
If the client wants the groups randomized, but not the items within each group, use randomize: y for the collections and add randomize: n to each group header to prevent randomization within groups. This way, the order of the groups (HEADING A, B, C) will vary, but the items within each group will stay in their original order.
Keep the final collection last
In this example, the tag randomize: y randomizes the collections. The anchor: y tag on the final collection keeps it in last place. Note that this anchors the final collection last, and not the final option in that collection.
Explicit order on collections
For questions with single collections, "explicit ordering" refers to the position of the elements themselves, not their IDs. However, in multiple collections, explicit ordering refers to the position of the collections.
In the example below, the Dogs and Cats collections each have explicit ordering with the order decorator on their collection headers. Meanwhile, the order tag on the set list is describing the relationship between the three collections. The first two are randomized and 'Other', is always last.
set list: ANIMALS
order: ([1,2],3)
100. Dogs {order: (3,1,2)}{collection header: y}
1. Pug
2. Dalmatian
3. Boxer
200. Cats {order: (2,1,3)}{collection header: y}
4. Bengal
5. Serval
6. Siamese
300. Other {collection header: y}
7. Guinea Pig
Comments
0 comments
Please sign in to leave a comment.