Welcome to the LimeSurvey Community Forum

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

Finish survey if answer to first question is negative.

  • farterland
  • farterland's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 1 month ago #148623 by farterland
Hi All,

Can I put in a logic statement or some function to end a survey if the answer to the first question is negative.

This is so I can survey 100 people and ask them as a first question "Do you drink coffee regularly?"

If they say "No", naturally, the survey should end, but the result should be captured so a simple pie-chart can be made of those who drink coffee versus those who do not.

Any thoughts or pointers gratefully received.

Thanks!
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 1 month ago #148635 by tpartner
Please refer to the manual - Quotas.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • farterland
  • farterland's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 1 month ago #148637 by farterland
Problem :

Let's say the survey is 4 questions long. The questions are...
| No| Q Code| Question| Type
| 1.| everbuy| Do you ever buy coffee?| Y/N
| 2.| howmany| How many coffees a day do you drink?| List (dropdown)
| 3.| umadbro| Do you regularly eat donuts?| Y/N
| 4.| ulift| Do you even lift brah?| Y/N


Suppose I want to ask the first question, and then, if the answer is "Yes", I want to move straight to the 2nd, 3rd and 4th question. If the answer to the first question is "No", then I want to move to question 4 directly and continue on.

Solution :
The solution is as follows..

1. Log in to the admin section of the survey site.
2. Click Surveys.
3. Click the survey you want to adjust.
4. Click 'List Questions' in the left hand side.
5. For question 2, click the 'Edit question' button on the far right hand side opposite.
6. In the Relevance Equation box, type

everbuy == "Y"

7. Click 'Save and Close'
8. For question 3, click the Edit question button on the far right hand side.
9. Again, in the Relevance Equation box, type

everbuy == "Y"

10. Click 'Save and Close'

The survey will now only show Q2 and Q3 if the answer to Q1. was 'Yes' and thus skip directly to Q4 if 'No' is give as a first answer.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 1 month ago #148638 by holch
The answer to your original question was "quotas" as Tpartner said.

However, seems like your actual problem was different and for this scenario your solution is completely correct and the better solution. You could have used conditions as well, but via relevance equation things are a lot quicker and more flexible.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
More
7 years 1 month ago #148639 by Ben_V
The good thing using quota (value = "0" for selected answer option(s) ) is that it's pretty easy to build screen-out questions and end the survey with a tailored message and/or redirection

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 1 month ago #148640 by holch
@Ben_V: I totally agree. But in this case faterland actually doesn't want to end the survey after the first question, but he/she wants to skip a few questions and have a final question then. In this case you can solve it only with conditions, or even better relevance equations.

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: Ben_V
The topic has been locked.
More
5 years 3 weeks ago #180774 by alisonspecht
the use of relevance equations worked very well to exit if someone answered 'no', but I want to put an exit message as they leave. How do I do that?

Thanks!
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 3 weeks ago #180797 by tpartner
Two options...

1) Use Expression Manager to tailor the End Message.

2) Insert a group with a text-display question shown (via relevance) to only the "screen-outs".

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
3 years 11 months ago #195928 by LaurafcHH
HI everybody,

I have a similar question, which I couldn't find an answer to so far.

My survey starts with a screening question, where participants have to choose the energy provider they are currently using. They can choose 28 different companies as well as state their energy provider as "other". I am however only interested in having participants from 4 of these companies in my survey, the others I want to leave the survey after this first question. I already tried with quotas, but it didn't work. Can anyone help me? Sorry I am really new to Limesurvey and it's still a bit overwhelming!
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago - 3 years 11 months ago #195929 by holch

I already tried with quotas, but it didn't work.

  • What exactly did you try?
  • What exactly did not work?
  • Did you test with the survey active? (Because quotas can only work with an active survey, in preview the responses are not saved and thus quotas can not be applied.)
  • Which Limesurvey version?

Ideally you always attach a LSS file with ONLY the relevant questions (make a copy of your survey and delete all questions that are not relevant to the problem).


Quotas, in specific "zero quotas" are the way to go. There is no real way to achieve this effect otherwise, if you do not want to set relevance equations for each and every flowing question.

So you need to set quotas for all answer options despite the 4 you want to continue.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Last edit: 3 years 11 months ago by holch.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose