Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Hide answer option / sub question via EM?

Hide answer option / sub question via EM? 3 years 3 months ago #99299

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5446
  • Thank you received: 814
  • Karma: 240
I am trying the potential of Expression Manager for the first time, and I must say I am really impressed. Tailoring is really easy now. But as I am still at the beginning, I am often running into obstacles, which I am trying to overcome via Forum posts and the wiki.

However, now I ran into an issue, which I couldn't fina a solution for:

Depending on a previous question about the current brand I want to hide answer options in the following question, which has car models in it. I tried it via this code in the answer option field, but of course it doesn't hide the option and the radio button. As else is required, I added a stupid text "do not choose".
{if(A3==1,'Citro├źn Berlingo','do not choose')}
Is there any way to hide the models that in this case are not from "Citroen" in this question?

I could of course create a question for each brand and then hide/show them with EM or conditions, but the questionnaire structure currently is to have them all in one question and just hide the ones that are not from the chosen brand. If I use the solution with various questions, I need to work on the database later on to bring the answers back into one column, which I'd like to avoid.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | [url=https://manual.limesurvey.org/Workarounds[/url]

If you found this answer helpful and it saved you some time please consider a [url=https://donate.limesurvey.org[/url] to the...
The administrator has disabled public write access.

Hide answer option / sub question via EM? 3 years 3 months ago #99308

  • first
  • first's Avatar
  • Offline
  • Platinum Lime
  • Posts: 329
  • Thank you received: 35
  • Karma: 15
I have a quick solution if you are comfortable in displaying both questions on separate screens.
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."
Last Edit: 3 years 3 months ago by first.
The administrator has disabled public write access.

Hide answer option / sub question via EM? 3 years 3 months ago #99337

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5446
  • Thank you received: 814
  • Karma: 240
Here the questions can (and most probably will be anyway) shown on different screens.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | [url=https://manual.limesurvey.org/Workarounds[/url]

If you found this answer helpful and it saved you some time please consider a [url=https://donate.limesurvey.org[/url] to the...
The administrator has disabled public write access.

Hide answer option / sub question via EM? 3 years 3 months ago #99362

  • first
  • first's Avatar
  • Offline
  • Platinum Lime
  • Posts: 329
  • Thank you received: 35
  • Karma: 15
I always use group by group display layout because it provide me more flexibility. I have implement what you need in a dummy survey attached. I think you can easily figure out how we can do it by looking at the survey. If you still have any confusion please let me know.
Attachments:
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."
The administrator has disabled public write access.

Hide answer option / sub question via EM? 3 years 3 months ago #99388

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5446
  • Thank you received: 814
  • Karma: 240
Thanks trivender, I'll have a look at your solution and see if it works for me.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | [url=https://manual.limesurvey.org/Workarounds[/url]

If you found this answer helpful and it saved you some time please consider a [url=https://donate.limesurvey.org[/url] to the...
The administrator has disabled public write access.
Time to create page: 0.522 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form