- Posts: 12
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Attention check: screen out participants based on a multiple-choice question
- jacob76
- Topic Author
- Offline
- New Member
Less
More
3 months 1 week ago #254828
by jacob76
Attention check: screen out participants based on a multiple-choice question was created by jacob76
Please help us help you and fill where relevant:
Your LimeSurvey version: LimeSurvey Community Edition Version 5.6.7+230222
Own server or LimeSurvey hosting: Own server
Survey theme/template: fruity
==================
Hi everyone,
My multiple-choice question as attention check is named G01Q01 and the choices are coded as SQ001, SQ002, and SQ003, and I want to create a True/False hidden equation question right after the multiple-choice question to screen out the participant who select only one of the three choices or none of them. If they select any two of them or three of them, they should not be screened out. So I can create a quota later and setup the quota 0, if the hidden equation question returns to False.
I checked some information on the forum and tested various versions in the equation question, but I did not work out (here returns to '1' or '0'). For example,
Here results are not correct.
Here shows G01Q01 not defined variable.
Here results are not correct.
Here shows G01Q01 not defined variable.
Any help is appreciated. Thanks a lot!
Your LimeSurvey version: LimeSurvey Community Edition Version 5.6.7+230222
Own server or LimeSurvey hosting: Own server
Survey theme/template: fruity
==================
Hi everyone,
My multiple-choice question as attention check is named G01Q01 and the choices are coded as SQ001, SQ002, and SQ003, and I want to create a True/False hidden equation question right after the multiple-choice question to screen out the participant who select only one of the three choices or none of them. If they select any two of them or three of them, they should not be screened out. So I can create a quota later and setup the quota 0, if the hidden equation question returns to False.
I checked some information on the forum and tested various versions in the equation question, but I did not work out (here returns to '1' or '0'). For example,
Code:
{if(countif(that.G01Q01.NAOK == 'SQ001' or that.G01Q01.NAOK == 'SQ002' or that.G01Q01.NAOK == 'SQ003') >= 2, '1', '0')}
Code:
{if(countif(G01Q01.NAOK == 'SQ001' or G01Q01.NAOK == 'SQ002' or G01Q01.NAOK == 'SQ003') >= 2, '1', '0')}
Code:
{{if((countif(that.G01Q01.NAOK == 'SQ001') == 1 or countif(that.G01Q01.NAOK == 'SQ002') == 1 or countif(that.G01Q01.NAOK == 'SQ003') == 1) or countif(that.G01Q01.NAOK == '') == 3, '1', '0')}
Code:
{{if((countif(G01Q01.NAOK == 'SQ001') == 1 or countif(G01Q01.NAOK == 'SQ002') == 1 or countif(G01Q01.NAOK == 'SQ003') == 1) or countif(G01Q01.NAOK == '') == 3, '1', '0')}
Any help is appreciated. Thanks a lot!
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12941
- Thank you received: 3979
3 months 1 week ago #254830
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Attention check: screen out participants based on a multiple-choice question
Yes, it's always wrong syntax.
The manual shows
countif(matches, arg1, arg2, ... argN)
So it should be like
{if(countif("Y",G01Q01_SQ001,G01Q01_SQ002,G01Q01_SQ003)>1,1,0)}
Joffm
The manual shows
countif(matches, arg1, arg2, ... argN)
So it should be like
{if(countif("Y",G01Q01_SQ001,G01Q01_SQ002,G01Q01_SQ003)>1,1,0)}
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Please Log in to join the conversation.
- jacob76
- Topic Author
- Offline
- New Member
Less
More
- Posts: 12
- Thank you received: 0
3 months 1 week ago #254831
by jacob76
Replied by jacob76 on topic Attention check: screen out participants based on a multiple-choice question
It worked out perfectly. Thanks a lot!!!
Please Log in to join the conversation.