Wilbert's website at SocSci

> LimeSurvey> Dead end

limesurvey/deadend.html 2024-11-15

Creating an optional dead end in LimeSurvey

You can create an optional dead end in LimeSurvey. That is, you can stop a survey based on a response.

Imagine a situation where someone gives an answer that makes him unilligeble to continue your survey. For instance there is a question called permission that asks: "Do you approve of selling your personal data to the Privacy Destructor Group?". How do we prevent him from entering personal information?

The canonical method

For this example I assume that you use the group-by-group presentation method, which is usually the case.

Imagine a survey like the following

  1. Question group 1
    • permission Do you approve of selling your personal data to the Privacy Destructor Group?
  2. Question group 2
    • What is your name?
    • ...
    • What is your age?
  3. Question group 3
    • Thank you for your time.

Limesurvey follows a philosophy that it describes as Don't use routing, use Relevance. This means that when we decide that after Question group 1 that Question group 2 is no longer relevant, since we cannot sell the data anyway, we put that demand in the relevance equation:

Which could be translated to English as: This question group is relevant if the answer to the permission question is Yes. You can optionally use permission.NAOK to prevent an error when no answer is given, but it is best to make the permission question mandatory of course.

The participant will skip all the irrlevant question and move straight to to last page where he is thanked for his time. This method can be used for any complex combination. For instance make blocks of question only relevant for men older than 18 with education level: university.

The hacky method

But what if you have many question groups that become irrelevant? You could add a relevance equestion to each one of them, which is probably the best thing to do. But there is an alternative. You can create a dead end. If you create a dead end question group in the middle of your survey.

Insert a question group right after the permission question and before the first question that requires permission and make it relevant only if permission was denied:

permission == 'N'

Now make a question in this question group of type X: text display. Edit the question and click the source button:

Copy-paste the following text in the question editor while source is selected. You can alter the first line to explain why the survey does not continue.

This question intentionally creates a deadlock by removing the submit button.

The code in the <script> block will remove the button that allows the participant to continue and thus create a dead end.