Welcome to the LimeSurvey Community Forum

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

Unify provided response options in a filtered questions

  • alexandrosi
  • alexandrosi's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 1 month ago #193612 by alexandrosi
Hello everybody,

I would appreciate your help on the following challenge I have:

I have a multiple-choice question (Q1) which is used as a filter for another question (Q2) (type of Q2 is Array (Numbers)). Let me give you an example to make myself clear:

Q1. Please select which of the following project outcomes you have used so far:

a. 2018 Webinar
b. 2019 Webinar
c. 2018 Flyer
d. 2019 Flyer
e. 2018 Handbook
f. 2019 Handbook

Q2. Where did you use the project outcomes in:

If someone selects a and/or b then I want one option to appear "Webinar". The same goes with remaining Q1 options. If c and/or d then I want one option "Flyer", and for e and/or f then "Handbook".

(I don't know if it is relevant or helpful but at Q2. the x-scale subquestions will be: "Presentations", "Promotional materials", "Consultations", "Other").

Thank you in advance for your help.

Alexandros
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 1 month ago #193618 by tpartner
It seems to me that sub-question relevance like this would work (first example):

Code:
!is_empty(Q1_a) OR !is_empty(Q1_b)

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • alexandrosi
  • alexandrosi's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 1 month ago - 4 years 1 month ago #193753 by alexandrosi
Just a quick thank you for your feedback.
My real situation was a bit more complicated than the example I gave. More conditions should have been met in order for the !is_empty(Q1_a)... to work.
I found a workaround in case someone is interested.
In Q1, I created a kind of "checkbox" headers like "Webinar", "Flyer", Handbook". If someone checked one of these options then several options appeared underneath based on the year of the "outcome" (i.e. 2017 webinar, 2018 webinar, 2019 webinar).
In Q2, only the checked headers appeared. The remaining subquestions (i.e. 2017 webinar...) were ruled out using "0" in the relevance field of the subquestion.

Thanks again.
Last edit: 4 years 1 month ago by alexandrosi.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 1 month ago #193759 by Joffm

My real situation was a bit more complicated than the example I gave


And why did you only give a limited example?
How can we give real help if we don't know all circumstances?

And there are some examples in the forum to show a two or three-level multiple answer.


Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • alexandrosi
  • alexandrosi's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 1 month ago #193778 by alexandrosi

Joffm wrote:
And why did you only give a limited example?
How can we give real help if we don't know all circumstances?

Joffm


Dear Joffm,
Thanks for your feedback which is highly appreciated. No need to be offensive with newbies though. I was trying to be as concise as possible. Obviously that was not helpful to anyone.

In any case, I would appreciate anyone's help in several issues that I have with my survey. This is why I attach an .lss file.

Issue #1: Thanks to Joffm, I found instructions on how to show a two-level multiple question. I also imported an example which works smoothly. However, when I apply it to my survey, I can't tick the boxes of the secondary questions. The question code is S1Q0

Issue #2: Is there any way so as S1Q1b and S1Q2 appear only when any subquestion of S1Q1a is checked?

Issue #3: In "Question Group 2", I ask for responders' feedback only for subquestions of S1Q2 with rating "Not at all useful" or "Slightly useful". It works quite well except for:

a. when no S1Q2 subquestion is answered as "Not at all useful" or "Slightly useful" . Then "Question Group 2" appears but without any reason. Can I bypass it if this scenario occurs? (i.e. "Question Group 2")

b. when in "Question Group 2" (question "OUTCOMERating") and I hit the "previous" button any changes to the answers of S1Q2 are not reflect to question "OUTCOMERating". Is it a bug?

Thanks a lot for any help.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 1 month ago - 4 years 1 month ago #193780 by Joffm
Sorry,
I can't import this lss export.
Tried LS 3.22.1. and 4.1.1.
So please copy your survey, remove all not relevant questions and export, attach again.

Your questions:

I can't tick the boxes of the secondary questions. The question code is S1Q0

You should remove the </script><script> in the middle of your script.
Code:
</script> <script type="text/javascript" charset="utf-8">
  // A function to handle "secondary" checkboxes

Is there any way so as S1Q1b and S1Q2 appear only when any subquestion of S1Q1a is checked?

You should use the count-function, like
Relevance of S1Q1b: count(that.S1Q1a)==xx

when no S1Q2 subquestion is answered as "Not at all useful" or "Slightly useful" . Then "Question Group 2" appears but without any reason. Can I bypass it if this scenario occurs? (i.e. "Question Group 2")

You should use the countifop-function, like
countifop(">","3",that.S1Q2) lt 1 , where "Not at all useful" and "Slightly useful" are coded "5" and "4".
Addition: I opened your lss with a text editor and saw that there are still the default codes "A1," "A2", ...
In this case you cannot use this countifop. Numerical codes are always easier to handle and of course better to analyse. How do you think to calculate a mean of "A1", "A2", ...

when in "Question Group 2" (question "OUTCOMERating") and I hit the "previous" button any changes to the answers of S1Q2 are not reflect to question "OUTCOMERating".

As I can't import, no idea.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 1 month ago by Joffm.
The topic has been locked.
More
4 years 1 month ago #193784 by jelo

Joffm wrote: Sorry,I can't import this lss export.
Tried LS 3.22.1. and 4.1.1.

Any error message? I attach a reimport of the LSS.

File Attachment:

File Name: limesurvey...port.lss
File Size:147 KB

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