Welcome, Guest
Username: Password: Remember me

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

Only show subquestions in an array based on previous array question answers 7 months 1 week ago #103331

  • Haap
  • Haap's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 13
  • Karma: 0
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 administrator has disabled public write access.

Only show subquestions in an array based on previous array question answers 7 months 1 week ago #103342

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4119
  • Thank you received: 760
  • Karma: 346
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Only show subquestions in an array based on previous array question answers 7 months 1 week ago #103344

  • Haap
  • Haap's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 13
  • Karma: 0
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: 7 months 1 week ago by Haap. Reason: typo in hyperlinks
The administrator has disabled public write access.

Only show subquestions in an array based on previous array question answers 7 months 1 week ago #103345

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4119
  • Thank you received: 760
  • Karma: 346
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Only show subquestions in an array based on previous array question answers 7 months 1 week ago #103346

  • Haap
  • Haap's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 13
  • Karma: 0
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: 7 months 1 week ago by Haap.
The administrator has disabled public write access.

Only show subquestions in an array based on previous array question answers 7 months 1 week ago #103349

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4119
  • Thank you received: 760
  • Karma: 346
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
The following user(s) said Thank You: Haap

Only show subquestions in an array based on previous array question answers 7 months 1 week ago #103352

  • Haap
  • Haap's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 13
  • Karma: 0
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 administrator has disabled public write access.

Only show subquestions in an array based on previous array question answers 7 months 1 week ago #103355

  • Haap
  • Haap's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 13
  • Karma: 0
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:
{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
<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 administrator has disabled public write access.

Only show subquestions in an array based on previous array question answers 7 months 1 week ago #103534

  • LloydW
  • LloydW's Avatar
  • OFFLINE
  • Gold Donor
  • Posts: 32
  • Thank you received: 1
  • Karma: 0
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: 7 months 1 week ago by LloydW.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.256 seconds
Donation Image