The flatorder
tag modifies option ordering in a list built from multiple collections. The hierarchy of collections is "flattened," so each individual list element can be directly referenced.
In the above example, flatorder
overrides the orders specified in the CASUALSHOES and DRESSSHOES lists. Instead, it randomizes all options in the combined list SHOES while anchoring the final option ('9. Birkenstocks').
Details
- Like other order tags,
flatorder
can be added to a set list or directly on a question or table widget. - Similar to the
order
tag,flatorder
can accept both explicit orders or shorthand notations as input (e.g.,flatorder: [1,2,3,4]
orflatorder: [*]
). -
flatorder
can also use "series syntax" for consecutive values (e.g.,flatorder:(1,6,[2..5])
). -
Unlike the
order
tag, collection headers occupy a position if specifying an order withflatorder
. Explicit order can be used to ensure collection headers still accompany their respective collections. - The
flatroworder
andflatcolorder
tags can be included with tables to modify the existing order of a list containing multiple collections for table rows and columns, respectively.
Additional examples
Collection headers and flatorder
Collection headers also interact differently with the order
tag than with the flatorder
tag. When the order
tag is applied to a list with collection headers, the specified order does not affect the headers themselves. For example, the order '(3,[1,2])' on SHOESTYLES specifies to list the 3rd collection, 'C' (Sandals) first, then randomize the listing for collections 'A' (Casual shoes) and 'B' (Dress shoes). The options within collection A and B will be randomized as well, but are still grouped with their collection headers.
The flatorder
tag instead assigns a position to each collection header, meaning the headers themselves are included in the order. For instance, in the SHOESTYLES2 list, CASUALSTYLES elements are assigned positions 1-5, FANCYSTYLES elements take positions 6-10, and the local collection C and its elements take positions 11-13.
To create the same order in SHOESTYLES2 as SHOESTYLES, we can use an explicit element ordering of '(11..13,[(1,[2..5]),(6,[7..10])])'.
Comments
0 comments
Please sign in to leave a comment.