Validation for multiple choice question

More
1 year 6 months ago #207964 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!
The topic has been locked.
More
1 year 6 months ago #207967 by Joffm
Hi,
what do you want to achieve?

All participants have to check all these boxes to continue.

Do you want to let them continue only after they checked all options?
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.
More
1 year 6 months ago #207977 by holch
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

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.
More
1 year 6 months ago #207985 by Joffm
That reminds me not to think in "equations and functions" only, but take into account the question specific options, too.
Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
More
1 year 6 months ago #208240 by ch123
Thank you Joffm & holch - both are working :D

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.

Start now!

Just create your account and start using Limesurvey today.

Register now