Welcome to the LimeSurvey Community Forum

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

Hide a question according to previous answer

  • slaugh
  • slaugh's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 5 months ago #143137 by slaugh
I went through the forum in order to find an answer to my question, but I did. I'll try to explain it clearly.

I know how to set conditions in order to hide a question. If I understand clearly, a question always shows, unless you specify the conditions under which it should show. Then, it doesn't show unless those conditions are met.

I would like to do the contrary: always show a question unless a specific condition is met.

For instance:
1. Please indicate for each objects how many you own. (Type of question: Array numbers)
Lamp:
Table:
Bed:
Chair:
Forks:
Spoon:

2. If it was possible to get one free, would you get a lamp? (Question type: Yes/no)

I'd like the second question to show, unless a person indicated, in the first questions, that they own one lamp or more.

Is that possible?

By the way, I am using LS Version 2.52+ and the default theme.

Thank you!

Sophie
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 5 months ago - 7 years 5 months ago #143150 by holch
It is basically the same.

You tell in the condition or relevance equation (which I actually prefer) that the question should be shown when lamp>=1.

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

Last edit: 7 years 5 months ago by holch.
The topic has been locked.
  • slaugh
  • slaugh's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 5 months ago #143152 by slaugh
And what would this relevance equation looks like?

Thanks!
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 5 months ago #143154 by holch
Depends on your survey.

You would need to check what question/subquestion code allows you to access the subquestion "lamp" in your case.

Then you would use this subquestion code, let's say it is "lamp" and insert something like this into the relevation equation for the question that you want to hide/show.
Code:
lamp >= 1
To find out how to access the subquestion, the survey / question logic file helps quite a bit.

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.
  • slaugh
  • slaugh's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 5 months ago #143155 by slaugh
But, that will show the question only to people who said they had 1 or more lamp. Doesn't it?
But, I want to hide the question to those people and show it to the rest.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 5 months ago #143156 by holch
unfortunately for your question type it is not as straight forward as for other types (where you often only need to use the question code).

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.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 5 months ago #143158 by holch
I am trying to recreate your setup and I was struggeling a bit. Now I found out why. Because I was struggeling with the array (number) question type.

Actually, I would go for the multiple numerical input, because you do not need various columns of number inputs, right?

For the array (number) question, are you using the version with open input fields or with the drop down version?

Could you show a screenshot, or even better: export the questions in a group for me to play?

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.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 5 months ago - 7 years 5 months ago #143159 by holch
OK, I think I managed to get what you wanted to do. See the attached question group. Your second question shows, but as soon as you insert a value higher than 0 in the box, it disappears. So I think this is what you wanted to achieve.

(You can ignore the text display question, this is only to make sure, what the output for the equation is with the code i was using. So just control.)

However, I would suggest a few changes to your approach, that would make it simpler and clearer.

I would NOT show the second question until someone filled in the first question and you actually want them to answer it. It makes more sense than to show it, and then suddenly hide it when they answer differently. If the question is on a different page, this might not be imporant, but if both questions are on the same page, this can be confusing behaviour and actually leed to respondents change their first answer.

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

Last edit: 7 years 5 months ago by holch.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose