- Posts: 44
- Thank you received: 3
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Validation for multiple choice question
- ch123
- Topic Author
- Offline
- Senior Member
Less
More
3 years 5 months ago #207964
by ch123
Validation for multiple choice question was created by ch123
Hey there!
I have prepared a small checklist as a first question. For this I have chosen a multiple choice question. All participants have to check all these boxes to continue.
I suppose that this can be solved with the validation? However, I am a bit confused - it doesn't seem to be the same commands as in conditions or something? At least I can't just write " Checklist_01=='Y' AND Checklist_02=='Y' " there. The quotas won't work here either.
Does anyone here have a tip for me?
I currently use LS 4.3 ...
Thanks a lot!
I have prepared a small checklist as a first question. For this I have chosen a multiple choice question. All participants have to check all these boxes to continue.
I suppose that this can be solved with the validation? However, I am a bit confused - it doesn't seem to be the same commands as in conditions or something? At least I can't just write " Checklist_01=='Y' AND Checklist_02=='Y' " there. The quotas won't work here either.
Does anyone here have a tip for me?
I currently use LS 4.3 ...
Thanks a lot!
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12881
- Thank you received: 3965
3 years 5 months ago #207967
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Validation for multiple choice question
Hi,
what do you want to achieve?
Of course you can write a validation equation like "Checklist_01=='Y' AND Checklist_02=='Y' AND ..."
and a nice validation tip like "You have to select all options to continue"
Or use the function "count": count(self)==number of items
manual.limesurvey.org/ExpressionScript_-...mplemented_functions
Or do you want to screen out the persons who do not without any further message?
Here you use a quota.
Create a question of type equation "eqQuota" like {if(count(that.Checklist)==number of items,1,0)}
Then you may create a quota and screen out the person with eqQuota==0.
Joffm
what do you want to achieve?
Do you want to let them continue only after they checked all options?All participants have to check all these boxes to continue.
Of course you can write a validation equation like "Checklist_01=='Y' AND Checklist_02=='Y' AND ..."
and a nice validation tip like "You have to select all options to continue"
Or use the function "count": count(self)==number of items
manual.limesurvey.org/ExpressionScript_-...mplemented_functions
Or do you want to screen out the persons who do not without any further message?
Here you use a quota.
Create a question of type equation "eqQuota" like {if(count(that.Checklist)==number of items,1,0)}
Then you may create a quota and screen out the person with eqQuota==0.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: ch123
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11639
- Thank you received: 2737
3 years 5 months ago #207977
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Validation for multiple choice question
Hmmm, maybe I am thinking too easy, but why not use the 'minimum answer' logic? Just put the value of minimum answer to the number of subquestions in your question. This should resolve your problem, shouldn't it?
manual.limesurvey.org/Question_type_-_Multiple_choice
manual.limesurvey.org/Question_type_-_Multiple_choice
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The following user(s) said Thank You: ch123
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12881
- Thank you received: 3965
3 years 5 months ago #207985
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Validation for multiple choice question
That reminds me not to think in "equations and functions" only, but take into account the question specific options, too.
Joffm
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- ch123
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 44
- Thank you received: 3
3 years 5 months ago #208240
by ch123
Replied by ch123 on topic Validation for multiple choice question
Thank you Joffm & holch - both are working
I actually didn't think about the simple built-in options either - probably the easiest solution, thanks!
And the code is working now. It was my mistake. Had it entered at "Input Validation", didn't work. Using "Question validation equation" works. I still have to get used to the new structure of LS 4.
I could have come up with both options myself ... sorry for the question!
I actually didn't think about the simple built-in options either - probably the easiest solution, thanks!
And the code is working now. It was my mistake. Had it entered at "Input Validation", didn't work. Using "Question validation equation" works. I still have to get used to the new structure of LS 4.
I could have come up with both options myself ... sorry for the question!
The topic has been locked.