The exclusive
tag or decorator is used with checkbox questions, whether standalone, in a table, or in a hidden variable. It designates options that should not be selected with other options, making it useful for options like 'None of these' or multiple options that logically should not be selected together.
Try it!
Details
- The
exclusive
tag can specify a single option ID, making it exclusive of all other options (e.g.,exclusive: 99
). It can also specify multiple IDs, making the first ID exclusive only of the other IDs listed (e.g.,exclusive: 1,11,12
). - The decorator can accept values of 'y' (exclusive of all other options) or specific option IDs (exclusive of certain options); e.g.,
99. I don't watch the news {exclusive: 1,2}
. - When an exclusive option is checked, all other listed options are automatically deselected.
exclusive
can also accept a range of options, similar to theseries
tag. For example,exclusive: 99,1,2,3,4
can also be written asexclusive: 99,1..4
.
Additional examples
Single option as a tag or decorator
Prevents an option from being selected with any other options.
1A. Which of the following fruits have you eaten?
type: checkbox
exclusive: 99
1. Apple
2. Orange
3. Banana
4. Pear
99. None of these
1B. Which of the following fruits have you eaten?
type: checkbox
1. Apple
2. Orange
3. Banana
4. Pear
99. None of these {exclusive: y}
Grouped options with a tag or decorator
Prevents an option from being selected with a group of specified options.
When using the exclusive
tag, the first option ID listed is exclusive of all the subsequent option IDs. When applying the exclusive
decorator to an option, simply list the option IDs that cannot be selected with it.
2A. Do you like pizza?
instruct: Cannot select "No" responses with "Yes" responses.
type: checkbox
exclusive: 1,11,12
exclusive: 2,11,12
exclusive: 99
1. Yes, because I like cheese
2. Yes, because I like sauce
11. No, because I do not like cheese
12. No, because I do not like sauce
99. I've never had pizza.
2B. Do you like pizza?
instruct: Cannot select "No" responses with "Yes" responses.
type: checkbox
1. Yes, because I like cheese {exclusive: 11,12}
2. Yes, because I like sauce {exclusive: 11,12}
11. No, because I do not like cheese
12. No, because I do not like sauce
99. I've never had pizza. {exclusive: y}
anchor exclusive
If a question or table uses the randomize
or order
tag and also includes a single exclusive option, the exclusive option defaults to being anchored to the bottom of the list. To change this behavior, include anchor exclusive: n
on individual questions or apply it to the set defaults
widget.
1. Which of the following fruits have you eaten?
type: checkbox
randomize: y
anchor exclusive: n
1. Apple
2. Orange
3. Banana
4. Pear
99. None of these {exclusive: y}
Comments
0 comments
Please sign in to leave a comment.