I have a multiple choice question with options:
Conditions: If a user selects "None" they cannot select any combinations of A, B, or C.
Here are the combinations of answers (8 total):
[none] = 0
A = 1
B = 2
C = 3
A,B = 4
B,C = 5
A,C = 6
A,B,C = 7
For each combination, there is a indice tied to it.
What I am trying to do, is that I pass this data to another application via the form QuestionID=QuestionAnswerCode, where QuestionAnswerCode is the number of the indice tied to the combination chosen for the above question.
When I try to do this, I do the following via the expression manager:
Code:
if( QCode_Selection004 == 'Y', 0,
if( QCode_Selection001 == 'Y' && QCode_Selection002 == 'Y' && QCode_Selection003 == 'Y', 7,
if( QCode_Selection001 == 'N' && QCode_Selection002 == 'Y' && QCode_Selection003 == 'Y', 6,
if( QCode_Selection001 == 'Y' && QCode_Selection002 == 'N' && QCode_Selection003 == 'Y', 5,
if( QCode_Selection001 == 'Y' && QCode_Selection002 == 'Y' && QCode_Selection003 == 'N', 4,
if( QCode_Selection001 == 'N' && QCode_Selection002 == 'N' && QCode_Selection003 == 'Y', 3,
if( QCode_Selection001 == 'N' && QCode_Selection002 == 'Y' && QCode_Selection003 == 'N', 2,
if( QCode_Selection001 == 'Y' && QCode_Selection002 == 'N' && QCode_Selection003 == 'N', 1, '')
)
)
)
)
)
)
)
But this isn't working. Logically, to me at least, it would appear to make sense. However, given that there are many who are intimately familiar with the Limesurvey system, I am wondering if my approach is either (1) too verbose, (2) correct but has a syntax error or (3) there is a much simpler way of doing this.
Please share your thoughts if you are aware of a similar situation or can help. Thanks!