Welcome to the LimeSurvey Community Forum

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

Setting condition on Array Question

  • hannia.nawaz
  • hannia.nawaz's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 months 2 weeks ago #267170 by hannia.nawaz
Setting condition on Array Question was created by hannia.nawaz
Please help us help you and fill where relevant:
Your LimeSurvey version: 6.6.5
Own server or LimeSurvey hosting: limesurvey hosting
Survey theme/template:
==================
I have an array question where I need to set a condition so if eve one of the option is rated a 4 or a 5 the next question appears and if none of the options are rated a 4 or a 5 the next question wont appear. 
I have attached the question. I added in the condition where if it has a value of 4 or 5 then the next question appears but when I test it, the next question does not appear if I dont select a 4 or 5 rating for the 'Other' option as well. And I want that even if the respondent chooses one option with a 4 or 5 rating it instantly triggers the next question. Is there a way to do that?

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 months 2 weeks ago - 6 months 2 weeks ago #267172 by Joffm
Replied by Joffm on topic Setting condition on Array Question
There's an "other"-option in the array?
So you used a script to insert the "other" fields?

Well, send your question.
But send a lss export, neither lsg nor lsq.

Copy the survey, remove everything not relevant and send this.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 6 months 2 weeks ago by Joffm.

Please Log in to join the conversation.

  • hannia.nawaz
  • hannia.nawaz's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 months 2 weeks ago - 6 months 2 weeks ago #267174 by hannia.nawaz
Replied by hannia.nawaz on topic Setting condition on Array Question
Here's the lss file. I only left that question in and the next question I want to appear even if only one of the option selected has a rating of 4 or 5. 

And yes I used a script to add the other field.  
 

File Attachment:

File Name: limesurvey...6989.lss
File Size:46 KB
Last edit: 6 months 2 weeks ago by hannia.nawaz.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 months 2 weeks ago #267175 by Joffm
Replied by Joffm on topic Setting condition on Array Question
Hi,

I want to appear even if only one of the option selected has a rating of 4 or 5. 

now, what does this mean?
The number of items rated 4 or 5 is greater than 0, or equal
The number of items rated gretater than 3 is greater than 0

In the implemented functions
[url] www.limesurvey.org/manual/ExpressionScri...mplemented_functions [/url]
you find exactly what you need,
countifop:  Count the number of answered questions in the list which pass the criteria (arg op value)

So the condition of your question G07Q27 is
countifop(">","3",that.Q12)>0
About that read here
[url] www.limesurvey.org/manual/ExpressionScri...%22that%22_variables [/url]

Here is this sample back.
By the way: I changed this (imO silly) predefined 5-point-array to an "array".
Reason
It is annoying for respondents if the scale is explained before in the question text instead in the array itself
You do not need this long question text

 

File Attachment:

File Name: limesurvey...89_J.lss
File Size:51 KB

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • hannia.nawaz
  • hannia.nawaz's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 months 2 weeks ago #267176 by hannia.nawaz
Replied by hannia.nawaz on topic Setting condition on Array Question
This is perfect. Thank you so much.

Please Log in to join the conversation.

  • hannia.nawaz
  • hannia.nawaz's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 months 2 weeks ago #267177 by hannia.nawaz
Replied by hannia.nawaz on topic Setting condition on Array Question
I am facing another small issue. The question I had sent had a previous condition set on it where if I chose 'no' in the previous question then this one showed up. But now if I go to set that condition it says the question has customized condition which will be removed if I set a new condition.

I have attached a lss file of the whole question group. So the first question needs to be a no for the next question to show up and for the second question it has to be a rating of high or very high for any value for the last question to show up. 
 

File Attachment:

File Name: limesurvey...2635.lss
File Size:58 KB

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 months 2 weeks ago #267178 by Joffm
Replied by Joffm on topic Setting condition on Array Question
There is no condition on Q12.

But now if I go to set that condition it says the question has customized condition which will be removed if I set a new condition.

I suppose you used this outdated condition builder.
Use ExpressionScript. This is mpre flexible, mightier and as easy (or easier) to use.
Read about a comparison here
[url] www.limesurvey.org/manual/ExpressionScri...itions_and_Relevance ?[/url]
Conditions = Condition builder
Relevance = ExpressionScript

You see the condition in G07Q27
Exactly as this you enter the condition in Q12 (after changing these default alphanumeric codes (AO01,...) to numeric codes like (1,2,3,...)
Numeric codes are much better to handle - and allow better comparisons like "greater than" , "smaller than",...

When is Q12 shown? Q11 has to be 2 (= No)
That's all.
Q11==2

And if Q11==2, the countifop of Q12 is 0, so Q27 is not shown, too.

Joffm

Did you copy the texts from somewhere?
I wonder about these <span> orgias in the question and subquetion texts.

<h2 style="margin-bottom: 13px;"><span style="font-size:16px;"><span style="line-height:115%"><span style="font-family:Arial,sans-serif"><span style="line-height:115%"><span style="color:black">Please specify which of the following items you believe should be eligible for reimbursement.<br />For each item rate its importance</span></span></span></span></span></h2>
You use <h2> but right afterwards you change the font-size and set the same line-height twice.

Unfortunartely you did not answer the question about your used theme.
I suppose it is "fruity_twentythree" the only one that appears in your lss.
So extend your theme and enter the overwritten classes in the custom.css.

If you - for some reasons - don't want to do this you should at least revise your inline css to decrease the <span>
<h2 style="margin-bottom: 13px;"><span style="font-size:16px;"><span style="line-height:115%"><span style="font-family:Arial,sans-serif"><span style="line-height:115%"><span style="color:black">Please specify which of the following items you believe should be eligible for reimbursement.<br />For each item rate its importance</span></span></span></span></span></h2>

<p style="margin-bottom: 13px;font-size:16px;line-height:115%;font-family:Arial,sans-serif;color:black">Please specify which of the following items you believe should be eligible for reimbursement.<br />For each item rate its importance</p>
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • hannia.nawaz
  • hannia.nawaz's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 months 2 weeks ago #267179 by hannia.nawaz
Replied by hannia.nawaz on topic Setting condition on Array Question
Thats great. Thank you for all your help

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose