Welcome to the LimeSurvey Community Forum

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

Changing answer choice list based on previous answer

  • rvenkat
  • rvenkat's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
10 years 4 months ago #101170 by rvenkat
My problem is as follows:

Based on the answer participants select in Q1, which is a drop-down list, I would like to present users with different answer choices for Q1. Q2 is also a drop-down list. There are a maximum of 12 possible answer choices for Q2, but some participants may see only 2 answer choices for Q2 and others may see 10 answer choices for Q2, depending on what they selected in Q1.

For example:
Q1, Which office location did you visit?
(answer choices could be: Vancouver, Calgary, Toronto, Montreal, Halifax)

If, Vancouver was selected for Q1,
Then Q2, What service did you access?
(answer choices: s1, s2, s3, s4, s5)

If Calgary was selected for Q1,
Then Q2 answer choices could be: s4, s5, s6, s10, s11, s12

If Toronto was selected for Q1,
Then Q2 answer choices could be s3,s4,s6,s8,s9,s10,s11,s12

and so on.

I have 24 office locations and 12 services. I created a separate service list question for each of the 24 offices. Using conditions I am able to present the appropriate list in Q2. But this creates many columns in my CSV file. If s4 occurs in 10 offices, there will be different 10 columns for s4. I want only 12 columns in the CSV, one column per service.

In other words, I want a single Q2 with 12 choices, but only the appropriate choices shown based on the selection in Q1.

What is the most efficient way to do this? Any help would be greatly appreciated.
Thanks.


rvenkat
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 4 months ago #101212 by tpartner
Unfortunately, there is no way to filter the answers in Q2 that way (there is currently no relevance setting for answers).

Even a JavaScript solution would be quite tricky. You cannot hide <option> elements in drop-downs - you need to remove them and that would get messy if the respondent changed Q1.

P.S. You forgot Ottawa in your Q1 choices :laugh:

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: rvenkat
The topic has been locked.
  • rvenkat
  • rvenkat's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
10 years 4 months ago #101225 by rvenkat
Hi Tony,

Thanks for the reply. It's too bad there's no solution.

I love our capital city. Just omitted it in the example. :)
BTW, I'm in Halifax.



Ramesh
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose