Welcome to the LimeSurvey Community Forum

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

Can't hide question groups based on Yes/No whatever I try :S

  • michelep
  • michelep's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 5 months ago #144154 by michelep
Hello,
Sorry but I checked here manual.limesurvey.org/Expression_Manager_Examples#Validation
but whatever I try in "Relevance equation" for group to hide ie. PET == "Y" does not work.
Where am I wrong? I understand this is a very stupid question, very sorry to ask, but nothing seems to work.
Please note: I am using italian language survey and I also tried "Si" or "S" instead of "Y" but same result: question groups shows even if No is selected.
Please be so kind to put me in the right direction.
Cheers
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 5 months ago #144158 by holch
For these kind of questions it is always good to add a little example of what you have done. It helps us to help you, because we can have a look at your code. And: We do not have to rebuild your case to test it, we just import it and can work on this basis.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 5 months ago #144159 by holch
Here a working example.

Not sure what you are exactly doing wrong, but you must be doing something wrong, because it works fine here.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • michelep
  • michelep's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 5 months ago #144172 by michelep
Thank you very much for your kinf reply @holch
I will try your solution and report back to community here.
I am very sorry if my Q was not detailed enough...next time will make sure to ask it better and with examples if I manage to create them :)
My use case is very straightforward:
a) create Q1 Yes/No in Group 1
b) create Group 2 with Q2, Q3,...
c) if answer to Q1="Yes" then show Group 2 otherwise go ahead with next questions/groups

Cheers!
M

PS You're helping in building a survey for recent earthquakes in Italy to help people there...THANK YOU AND LIMESURVEY FOR THIS!
The topic has been locked.
  • michelep
  • michelep's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 5 months ago #144174 by michelep
Ok, logically what I did is identical to yours.
The problem seems to be question code. Your "G1Q1" works in relevance but if I replace it in your example like in mine with "compilidannipersone" it does not work.
Is this a misbehaviour of limesurvey? When I save the question with the code "compilidannipersone" gaves no error but if I use it in relevance field, that code seems not to be recognized as valid.
Am I wrong?
Cheers
The topic has been locked.
  • michelep
  • michelep's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 5 months ago #144175 by michelep
Hello again,
I solved it....by opening (edit mode) and saving again both Q and Relevance expression in group, with no changes, simply edit->save.
Hope this helps others.
Cheers!
The topic has been locked.
More
5 years 4 months ago - 5 years 4 months ago #177238 by SarcoidosisUK
I am having the same issue. I cannot hide a question group based on Y/N question in the previous group. Survey attached - I want the 'HIDE group' to appear only when the answer to 'LANG' question is 'Yes'.

My actual aim is to hide question groups based on language- the above is just trying to learn a more simple process first. If you have any info on how to hide groups based on language (including conditional based on dropdown list) then that would be appreciated.

Thanks

Attachment not found

for your help
Last edit: 5 years 4 months ago by SarcoidosisUK.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago - 5 years 4 months ago #177240 by holch
This can't work. I think the problem is that {LANG} is a reserved word and displays the language of the current questionnaire, because for test purposes I had included {LANG} into the question text to see what comes up and taken out the relevance equation and no matter what I answered in the language question (pretty strange question anyway, or the answer options, they just don't fit to each other, but that is another question), the answer was always "en". Of course your condition LANG=="Y" is never true then.

I changed LANG to LANGU and it works.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Last edit: 5 years 4 months ago by holch.
The following user(s) said Thank You: DenisChenu, SarcoidosisUK
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #177241 by DenisChenu

holch wrote: This can't work. I think the problem is that {LANG} is a reserved word and displays the language of the current questionnaire, because for test purposes I had included {LANG} into the question text to see what comes up and taken …

The issue is here maybe …
We must disallow LANG (and some other …)

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.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #177245 by holch

We must disallow LANG (and some other …)


I agree! All words used by expression manager internally should not be allowed as question, subquestion or answer codes.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #177246 by holch

My actual aim is to hide question groups based on language- the above is just trying to learn a more simple process first. If you have any info on how to hide groups based on language (including conditional based on dropdown list) then that would be appreciated.


This seemed to have been changed while I was answering, because I don't remember this part in the original post.

So for you {LANG} would actually be the right variable. It gives you the language that is currently (?) used in the questionnaire. so in your case "en".

Then you could always have a relevance equation like this:
Code:
LANG=="en"
if the question should be shown when English is the language of the questionnaire, and for example LANG=="pt-br" for Brazilian Portuguese.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: SarcoidosisUK
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #177270 by DenisChenu

holch wrote:

We must disallow LANG (and some other …)


I agree! All words used by expression manager internally should not be allowed as question, subquestion or answer codes.

I think only question,

For subquestion : we already disallow other if other (if question allow other) but allowed it if not (it's allow to use other in filter : and it's great) : we don't need to disallow lang.

For answer : we must use {Q01 == "LANG"} and not {Q01 == LANG}, then no issue.

Can you report the issue (please) ? I take it and start by LANG, SAVEDID, SID,GID,QID,SGQA (if you see some other :) )

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 following user(s) said Thank You: holch
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose