Randomization
Last updated
Was this helpful?
Last updated
Was this helpful?
Please note that Surveyβs built-in randomization is not compatible with the advanced randomization codes provided in this tutorial. To enable advanced randomization for your multiple choice question, import the library as described in the Getting started section.
Once you have completed the main steps, you will need to modify the parameters in the provided template snippet to apply the changes.
question_code
The code of the multiple choice question you want to configure
schema
This variable represents an open text field where answer codes will be stored. It is only required if you plan to use this question to filter or randomize in the same order. Remove it if not needed.
Use a descriptive name for the schema that indicates it is associated with a specific question code, such as
Q1_SCHEMA
or Q1xSCHEMA
The open text should be placed in the same page of the multiple choice.
randomize
Here we define settings for randomization. If not needed, just remove this entire block code and skip this tutorial
randomize
-> filter_schema
This variable allows you to randomize answer options in the same order as a previous question by using its schema.
If you choose to use this feature, you can skip the rest of the configurations described below this row.
randomize
-> answer_groups
This variable represents a list of answer codes that you want to group together for randomization. The answer codes should be wrapped inside brackets [] and separated by commas.
Any remaining answer codes that are not included in a group will be treated as anchors.
randomize
-> randomize_groups
This variable determines whether or not answer groups should be randomized after the elements inside them have been randomized.
If set to true, both the elements within the groups and the groups themselves will be randomized.
If set to false, only the elements within the groups will be randomized.