Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Create a masked question that checks if all multiple choices have the same answe

  • amilcar_pg
  • amilcar_pg's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 months 3 weeks ago #244895 by amilcar_pg
Please help us help you and fill where relevant:
Your LimeSurvey version:  Community Edition   Version 6.1.2+230606 
Own server or LimeSurvey hosting: Own server
Survey theme/template: Vanilla
==================

Hello everyone!

I have a survey with many multiple questions, and It will be distributed via Internet with one of those providers that pay for who is willing to answer it. One of the problems with this kind of approach is that some people just press the same option over and over, just to get their prize. Therefore, I want to avoid this.

My first approach was to use the "Question validation" feature, however, it just pops up a warning, and the person still can just change one answer and keep on. 

So I was willing to create a hidden question with the equation type that returns me 1 if all previous questions on the array have received the same answer, and 0 otherwise. WIth this, I can add a quota that doesn't allow it, and the respondent will be excluded from the survey.

Unfortunately, I haven't been able to program it by myself. I know that it might be something silly, but can anyone help me please?

Thanks in advance for your assistance. I'm attaching a sample survey with 1 similar question.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 months 3 weeks ago - 9 months 3 weeks ago #244896 by Joffm
Hi,
read the manual about implemented functions
[url] manual.limesurvey.org/ExpressionScript_-...mplemented_functions [/url]
where you find the functions "count()" and  "countif()"

Now your equation will count each of your 5 answer options, like
countif("1",that.G01Q02.NAOK)
countif("2",that.G01Q02.NAOK)
...

If one of these counts is equal to  5, or more general (that it matches each number of subquestions) to "count(that.G01Q02)" you set the result to 1, else to 0.
And set your quota on this equation.

So:
{if(countif("1",that.G01Q02.NAOK)==count(that.G01Q02.NAOK) or countif("2",that.G01Q02.NAOK)==count(that.G01Q02.NAOK) or countif("3",that.G01Q02.NAOK)==count(that.G01Q02.NAOK) or countif("4",that.G01Q02.NAOK)==count(that.G01Q02.NAOK) or countif("5",that.G01Q02.NAOK)==count(that.G01Q02.NAOK),1,0)} 

Of course, you should use numerical codes- as I did. In your analysis you usually want to calculate some statistical measures, like mean, std.deviation, etc and also run some tests, like t-Test or ANOVA.
And really: the mean of "AO01" and "AO04" is not "AO02.5".   

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 9 months 3 weeks ago by Joffm.
The following user(s) said Thank You: amilcar_pg

Please Log in to join the conversation.

  • amilcar_pg
  • amilcar_pg's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 months 3 weeks ago #244897 by amilcar_pg
It worked flawlessly Joffm! Huge thanks!

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose