Randomize list of select_one and select_multiple questions


#1

Hi everyone,

The release notes from November, 2018 point out that there’s now "Support for randomizing order of items in select_one and select_multiple questions.’

This will be incredibly useful to us but is there a post that provides more information about how I can add this feature through my XLSform? Something in the calculation field with begin_group, maybe?

Many thanks in advance for your help!


#2

See Randomizing Choice Order. https://docs.opendatakit.org/form-question-types/#randomizing-choice-order


#3

Aaah… perfect. Thank you! Is there support for randomizing the order in which questions in a group appear as well?

For example, if there are 10 questions set to appear on a page, they would appear in a different sequence each time?


#4

Not cleanly, but there are ways you can ‘fake’ it… For example, duplicate all the questions in various different random orders in several groups, and then use a random() function to pick which group to display using the group’s relevance. Its not truly ‘random’ - with 10 questions there 10! = 3628800 different permutations - but if you, say, hardcode 10 groups with a different permutation it may appear sufficiently random for your purposes. [or you can hardcode 3.5 million groups for a better result… :slight_smile: ]

There a a few threads on this topic on the ODK Forum.