Check out the LimeSurvey source code on GitHub!

Do not allow answers based on previous answers

More
2 years 6 months ago #111741 by andogro
Hello
I am creating a survey where some questions have answers that should not be allowed based on previous ones. For example:

A. How many close friends do you have
1. 0
2. 1
3. 2
4. 3-5
5. 6-10
6. More than 10

B. How many are female?
1. 0
2. 1
3. 2
4. 3-5
5. 6-10
6. More than 10

For Question B, I need to not allow the answer to be higher than the previous question. Is there an easy way to do this with conditions?

Thanks
Andy

Please Log in to join the conversation.

More
2 years 6 months ago #111743 by first
This can be done question validation equation in question settings. Something like below.

B.NAOK <= A.NAOK

Survey Designer and Programmer
"I always suggest to have a group by group display layout and create a seprate group for each question. This will be extra work but you will get flexiblity to create your question by using more than more lime survey question types."

Please Log in to join the conversation.

More
2 years 6 months ago - 2 years 6 months ago #111745 by andogro
Thank you for the response - I'm glad to know it can be done. Can you give me a more specific example of what the code might look like? I see the relevance equation area for the question and already have some conditions set there, but am wondering how I would code.

In a similar vein, I have other questions that are type in answers - for example "How old were you the first time you smoked cigarettes" and the second question is "How old were you when you started smoking a pack a day". The second question must be equal or greater than the first.
Last Edit: 2 years 6 months ago by andogro. Reason: needed to add more

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form