- Posts: 6
- Thank you received: 0
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
- Topic Author
- Offline
- New Member
Less
More
7 years 5 months ago #144154
by michelep
Can't hide question groups based on Yes/No whatever I try :S was created 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
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11639
- Thank you received: 2737
7 years 5 months ago #144158
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Can't hide question groups based on Yes/No whatever I try :S
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11639
- Thank you received: 2737
7 years 5 months ago #144159
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Can't hide question groups based on Yes/No whatever I try :S
Here a working example.
Not sure what you are exactly doing wrong, but you must be doing something wrong, because it works fine here.
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.
Attachments:
The topic has been locked.
- michelep
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
7 years 5 months ago #144172
by michelep
Replied by michelep on topic Can't hide question groups based on Yes/No whatever I try :S
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!
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
7 years 5 months ago #144174
by michelep
Replied by michelep on topic Can't hide question groups based on Yes/No whatever I try :S
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 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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
7 years 5 months ago #144175
by michelep
Replied by michelep on topic [SOLVED] Can't hide question groups based on Yes/No whatever I try :S
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!
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.
- SarcoidosisUK
- Offline
- Senior Member
Less
More
- Posts: 40
- Thank you received: 1
5 years 4 months ago - 5 years 4 months ago #177238
by SarcoidosisUK
Replied by SarcoidosisUK on topic [SOLVED] Can't hide question groups based on Yes/No whatever I try :S
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
for your help
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
Attachments:
Last edit: 5 years 4 months ago by SarcoidosisUK.
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11639
- Thank you received: 2737
5 years 4 months ago - 5 years 4 months ago #177240
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic [SOLVED] Can't hide question groups based on Yes/No whatever I try :S
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 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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
5 years 4 months ago #177241
by DenisChenu
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.
Replied by DenisChenu on topic [SOLVED] Can't hide question groups based on Yes/No whatever I try :S
The issue is here maybe …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 …
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11639
- Thank you received: 2737
5 years 4 months ago #177245
by holch
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.
Replied by holch on topic [SOLVED] Can't hide question groups based on Yes/No whatever I try :S
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11639
- Thank you received: 2737
5 years 4 months ago #177246
by holch
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:
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.
Replied by holch on topic [SOLVED] Can't hide question groups based on Yes/No whatever I try :S
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"
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
5 years 4 months ago #177270
by DenisChenu
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.
Replied by DenisChenu on topic [SOLVED] Can't hide question groups based on Yes/No whatever I try :S
I think only question,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.
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.