Array filter
Last updated
Was this helpful?
Last updated
Was this helpful?
To enable advanced array filtering code 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.
array_filter
Here we define the settings for array filter. If not needed, just remove this entire block code and skip this tutorial π
array_filter
-> filter
This variable allows you to the take into account the answer options that were selected in the filter question code to apply the filter process
array_filter
-> filter_schema
This variable gets the filter's schema that was placed in an open text field.
βΉοΈ This is required in order to filter only answer codes that appeared in the filter question. Any remaining code outside filter schema will not be filtered.
array_filter
-> type
Variable that defines the behavior of the filter process.
If inclusive, the filter will keep only answer codes that were selected in filter question and are listed in filter's schema.
If exclusive, the filter will remove only answer codes that were selected in filter question and are listed in filter's schema.