The syntax " not selected" to restrict answer option choice

Hi,
I have three answer choice options (a, b and c) to a multiple choice question. and I don’t want to have an answer combination with at least one of the first two options with the third answer option (i.e.: ac or bc or abc).
How can I use the syntax “not selected” to make this restriction.

Try this:

constraint = not((selected(${answer},'a') or selected(${answer},'b')) and selected(${answer},'c'))

Note, there are other slightly simpler expressions that can achieve the equivalent result; eg

not(selected(${answer},'c') and count-selected(${answer} > 1)

2 Likes

Thank for answering my question. I have tried the first syntax you proposed and it works very well.
I will try the second syntax with “count-selected” later.

1 Like