Ranking question prefilled: how to hide unselected values ?

More
3 years 7 months ago #102996 by karld
karld created the topic: Ranking question prefilled: how to hide unselected values ?
Hello,

I have a multiple choice question 1 (checkboxes) that I use to prefill a ranking question 2 (same functionality as www.partnersinc.biz/surveys//index.php?s...14&newtest=Y&lang=en but so far I have not needed to use javascript). Version 2.00+ Build 130802.

Here is the code for an item in question 2:
{if(is_empty(INSERTANS:962814X3X20SQ007),'','aan behandelingen voor besmettelijke ziekten')}

Unchecked items in question 1 are shown as empty items in question 2, which means they can be ordered in question 2 while not having been selected in question 1 (see attachment), which is unwanted.

Is there a way to hide the items in question 2 that they are not checked in question 1?

Thanks in advance.
Attachments:

Please Log in to join the conversation.

More
3 years 7 months ago #103009 by tpartner
tpartner replied the topic: Ranking question prefilled: how to hide unselected values ?
You should be able to hide those empty elements with JavaScript.

Can you attach a sample survey?

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
3 years 7 months ago #103012 by karld
karld replied the topic: Ranking question prefilled: how to hide unselected values ?
Thank you.

Here it is.
Attachments:

Please Log in to join the conversation.

More
3 years 7 months ago #103014 by tpartner
tpartner replied the topic: Ranking question prefilled: how to hide unselected values ?
In version 2.00+ you can use array filtering on ranking questions - manual.limesurvey.org/Question_type_-_Ra...r_.28array_filter.29 .

Here is your survey back with the array filter applied and relevance applied so the ranking question only appears if more than one item in the check-box question is selected.

File Attachment:

File Name: limesurvey...1741.lss
File Size:22 KB


.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
The following user(s) said Thank You: karld

Please Log in to join the conversation.

More
3 years 7 months ago #103017 by karld
karld replied the topic: Ranking question prefilled: how to hide unselected values ?
Thank you very much.

I managed to change my (complete) survey by doing the following in the question 2 (m3):
  • in the advanced settings: Array filter = m1 (question 1) and Minimum answers = 0
  • in the subquestions of m3 (question 2): put the same codes as for the m1 (question 1) subquestions codes and for the subquestions in m3, don't use code, just type what should appear (corresponding to the code) in the item once it is selected in m1

It seems to work fine, I hope I didn't miss anything.

Thank you again for your help.

Please Log in to join the conversation.

More
3 years 7 months ago #103019 by tpartner
tpartner replied the topic: Ranking question prefilled: how to hide unselected values ?
Nope, you didn't miss anything.

You're welcome.

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: DenisChenu

Please Log in to join the conversation.

Did you already participate in our customer survey?

Don't miss your chance for great prices.

Please click here to participate:

Start now

Start now!

Just create your account and start using Limesurvey today.

Register now