Welcome to the LimeSurvey Community Forum

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

Only show subquestions in an array based on previous array question answers

More
10 years 2 months ago #103331 by Haap
Hi all,

I am searching and trying for two days now, but I am getting more and more confused. What I am trying to do is to use the answers from a previous array in a new array. This is so vaguely described, I will try to explain:

There is an array shown in a survey, where the subquestions are SQ1 .. SQ5. The answer options are AO1 and AO2 (but not "yes" and "no", so I cannot use the yes/no question type).

What I am trying to achieve is to get another array question to only show the subquestions from the previous array question, when the answer option AO1 is selected.

I can do quite a lot of other things, but I cannot get it done. Any help would be greatly appreciated.

Thanks in advance, Haap
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 2 months ago #103342 by tpartner
You will need to use JavaScript for "column-specific" filtering. Have a look at this post - www.limesurvey.org/en/forum/can-i-do-thi...-with-options#102599 .

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
10 years 2 months ago - 10 years 2 months ago #103344 by Haap
Tony, thanks for your reply. I will go and fiddle around with that.

Yet another question arose: looking at the Expression Manager Examples I read that there is a subquestion relevance equation possibility. Looking and the example survey question logic ( screenshot ) I see it is in the logic file. But where am I to input the equation. I am searching for the option, but it's driving me nuts ;)
Last edit: 10 years 2 months ago by Haap. Reason: typo in hyperlinks
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 2 months ago #103345 by tpartner

I read that there is a subquestion relevance equation possibility

Where do you see that?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
10 years 2 months ago - 10 years 2 months ago #103346 by Haap
My bad, I inserted the wrong URL. As far as I understand, that's what it says here
Edit: reading it over again, it concerns something completely different: validation instead of relevance. However, I am still wondering where you can input the subquestion relevance as shown in the sample survey (see below).

In addition to that: in the screenshot from the examples ( question logic there is a different relevance equation visible for each subquestion. Even when running the example survey on my LS installation, I can see these conditions in the question logic file. But I cannot see where they where inserted.
Last edit: 10 years 2 months ago by Haap.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 2 months ago #103349 by tpartner
As far as I know, you cannot put relevance or conditions on subquestions.

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: Haap
The topic has been locked.
More
10 years 2 months ago #103352 by Haap
Well, that changes the case. I am testing all kind of things to get my survey display the way I want. I have now found out that the SQrelevance as shown in the Survey Logic file, comes from the array filters. That gave some light to my question. I guess I will come up with a feature request, for subquestion relevance conditions ;-)

Thanks, tpartner!
The topic has been locked.
More
10 years 2 months ago #103355 by Haap
For all those looking for the solution, I have found this workaround:

First I have created my array question [Q1].

On a new page (new group), I created a multiple short text question, with the same amount of subquestions as the array question. I have entered the default answer option with the following expression:
Code:
{if(Q1_SQ1 == "ANSWER","manualy add the text of subquestion 1",'')}

This fills the text fields with the desired subquestions if the desired answer is given. If a different answer was chosen, it leaves the field empty.

After that, I hid this question using this script
Code:
<script type="text/javascript" charset="utf-8">
 
   $('#questionQQ').hide();
 
</script>

Finally, I have added my next array question. The array filter is chosen for the hidden question. After that, It works like a charm.
The topic has been locked.
More
10 years 2 months ago - 10 years 2 months ago #103534 by LloydW
Hi
Well done this is a neat solution :cheer: , but it would be great if you didn't have to create another question group to get the multiple short text q to fill! Perhaps something for the future. :unsure:

Lloyd.
Last edit: 10 years 2 months ago by LloydW.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose