The exclusive tag or decorator is used with checkbox questions or tables. 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.
Details
- The
exclusivetag can specify one option ID to make it exclusive of all others (e.g.,exclusive: 99), or multiple IDs to make the first ID exclusive of the others 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.
-
exclusivecan also accept a range of options. For example,exclusive: 99,1,2,3,4can also be written asexclusive: 99,1..4. - If a question or table uses the
randomizeorordertag and also includes exclusive options, these options are automatically anchored in their positions. Theanchordecorator is not needed. - The
exclusivetag can also be used with coded variables and variables usingselectbywhen multiple IDs are specified, e.g.,exclusive: 1,11,12.
Tip! The decorator exclusive: y is intended to be used on respondent-facing questions only.
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?
instructions: 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?
instructions: 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 exclusive options, the exclusive options default to being anchored in place. To change this behavior, include anchor exclusive: n on individual questions or apply it to the set defaults widget.
1A. 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}
1B. Which of the following fruits have you eaten?
type: checkbox
randomize: y
anchor exclusive: n
99. None of these {exclusive: y}
1. Apple
2. Orange
3. Banana
4. Pear
Applying 'exclusive' to a selectby variable
The example below selects three options at random using selectby: random. However, it also uses the exclusive tag to tell the selectby logic which options can't be picked at the same time.
- If 1 is selected, then can't select 2 (and vice versa)
- If 3, then can't select 4 (and vice versa)
- Also if 3, can't select 5 or 6 (but 5 can have 6 and vice versa)
TRACK. Pick three
type: checkbox
selectby: random
maxgroups: 3
exclusive: 1,2
exclusive: 3,4
exclusive: 3,5,6
1. Apples
2. Oranges
3. Pear
4. Carrot
5. Tomato
6. Watermelon
7. Cherries
8. Canteloupe
9. Jackfruit
Comments
0 comments
Please sign in to leave a comment.