Welcome to the LimeSurvey Community Forum

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

Relevance condition

More
8 years 10 months ago #120453 by shade
Relevance condition was created by shade
Hi!

I'm trying to find a way to set relevance condition to skip a question if it was already answered for the token.
For example: token 111 first enters the survey and sees question Q1. He enters the answer and finalizes the survey. Next time he enters the same survey using the same token question Q1 needs to be hidden as already answered.
I tried to set relevance condition for Q1 as is_empty(Q1.NAOK) but due to Dynamic changes I can't even enter the answer as it disappears. Same goes for count(Q1.NAOK)==0 condition.

What condition should I use? Or maybe there is a way to disable Dynamic On-page relevance?
The topic has been locked.
More
8 years 10 months ago #120458 by Ben_V
Replied by Ben_V on topic Relevance condition
Have a look here

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The following user(s) said Thank You: shade
The topic has been locked.
More
8 years 10 months ago #120523 by shade
Replied by shade on topic Relevance condition
Thanks, that helped. But it's a really uncomfortable workaround. It would be really helpful if non-relevant questions saved data instead of changing it to NULL.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 10 months ago #120527 by tpartner
Replied by tpartner on topic Relevance condition
See "$deletenonvalues" in config.php - manual.limesurvey.org/Optional_settings#Survey_Behavior

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, shade
The topic has been locked.
More
8 years 9 months ago #120839 by shade
Replied by shade on topic Relevance condition
That partially worked. I received very strange results of computation:

I have equation question
EQ1= {if(is_empty(Q1.naok), 1, 0)+if(is_empty(Q2.naok), 1, 0)+if(is_empty(Q3.naok), 1, 0)}
and three questions with relevance conditions:
Q1: EQ1==3
Q2: EQ1==2
Q3: EQ1<2

I need to show next of Q1-Q3 each time token enters the survey.
Now is works 1st and 2nd times, but after that EQ1 fixes on value 2 and never changes again. I have a suspicion that after second entry with same token equation questions just stop any calculations. But how to fix it haven't got a clue.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 9 months ago - 8 years 9 months ago #120841 by DenisChenu
Replied by DenisChenu on topic Relevance condition
Put a +1 on this Feature request ;) : bugs.limesurvey.org/view.php?id=9110

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 8 years 9 months ago by DenisChenu. Reason: Adding FR link (oups)
The topic has been locked.
More
8 years 9 months ago #120842 by shade
Replied by shade on topic Relevance condition
Now it is not a question of multiple token uses but a question of why equation calculation stops working after first completion and is there a way to jump start it again.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 9 months ago #120844 by DenisChenu
Replied by DenisChenu on topic Relevance condition
+ : it's unsure : it can be concat or sum.

Better is to force count here:
Code:
count(Q1.NAOK,Q2.NAOK,Q3.NAOK)

Or maybe here:
Code:
count(Q1.relevanceStatus,Q2.relevanceStatus,Q3.relevanceStatus)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
More
8 years 9 months ago - 8 years 9 months ago #120846 by shade
Replied by shade on topic Relevance condition
Yep, tried that already. The same story. The equation stops calculating results on second entry. And then you get stuck on same step - when there are answers to Q1 and Q2, but EQ1= {if(is_empty(Q1.naok), 1, 0)+if(is_empty(Q2.naok), 1, 0)+if(is_empty(Q3.naok), 1, 0)} (or EQ1= 3-count(Q1.NAOK,Q2.NAOK,Q3.NAOK)) is stuck on the value of 2 and never changes.
Last edit: 8 years 9 months ago by shade.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 9 months ago #120851 by DenisChenu
Replied by DenisChenu on topic Relevance condition
Can you upload a little lss file or a lsa file to make some test ?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
More
8 years 9 months ago - 8 years 9 months ago #120858 by shade
Replied by shade on topic Relevance condition

File Attachment:

File Name: survey_arc...2333.zip
File Size:4 KB

Here it is. $deletenonvalues is set to 0.
Last edit: 8 years 9 months ago by shade.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 9 months ago - 8 years 9 months ago #120859 by DenisChenu
Replied by DenisChenu on topic Relevance condition
Oh yes , rigth : use Use left create a new survey again and again.

Did you need different reponse line each time or not ?

If yes : you need a plugin system
If no : set UsesLeft to 1 (or less) because you already have checked "Allow multiple responses or update responses with one token?"

I didn't test with deletenonvalues at 0, but first time : see 1st question, second time Second question with deletenonvalues at 1.

PS: tested using TOKEN:USESLEFT for 1 to -1, use quota if less than -1 to out after 3 pass.
See atached survey

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 8 years 9 months ago by DenisChenu.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose