Welcome to the LimeSurvey Community Forum

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

Select random answer from the list of answers

More
7 years 6 months ago #142981 by kko
Let's say I have array of questions that looks like this (Q1) (see attached image)

in Q2 I want to display this question:

Tell us why do you hate {FRUIT} so much?

I want to ask this for a single random fruit.

This means that in Q2 I want to pick a random value from Q1_1, Q1_3, and Q1_5 (all "hate" Answers)

Ideally, I also want to have a random choice only from fruits, i.e. Q1_1, Q1_2, and Q1_3

I'm not sure how to best achieve this. I tried to create a hidden question with an equation but I cannot write correct equation.

It probably would need to look be something like this: RAND(select answers where answer is HATE and Question number is 1, 2 or 3)

Any help and points would be great
Attachments:
The topic has been locked.
More
7 years 6 months ago #143000 by jelo
LimeSurvey is lacking a way to build dynamic lists which can be used to solve your issue.
You can vote for this feature here:
bugs.limesurvey.org/view.php?id=11688

A workaround for you situation might be to create a question for every fruit in a randomized group.
You choose one question out of the randomized group, which will be only chosen, if they are in the "hate" answer category.
Ways to choose randomly x out of y questions can be found here:
www.limesurvey.org/de/foren/can-i-do-thi...s-from-a-bucket-of-y

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose