not equal in group relevance equation

More
8 months 2 days ago - 8 months 2 days ago #176903 by KompetenzZ
Hi community,

I tried to set a relevance equation for a question group, the question group should only be displayed when:
! is_empty(Q1.NAOK == 9) OR ! is_empty(Q1.NAOK == 3) AND (Q2 != "waidhofen an der ybbs" OR Q2 != "allhartsberg")

Can it be that the "!=" in the equation makes troubles? Q1 is a radio (list) question and Q2 is a short free text question. When I check Q1_3 and write "waidhofen an der ybbs" or "allhartsberg", the question group that should be hidden is still displayed.

When I write instead of unequal ("!="), the equal sign ("==") it works. But I would need the unequal sign.
I've been tinkering with it for a long time, but I just cannot find the mistake.

A sample survey (.lss) with this is attached.

LS Version: 3.14


File Attachment:

File Name: limesurvey...4415.lss
File Size:20 KB

Cheers kompetenzz
Attachments:
Last edit: 8 months 2 days ago by KompetenzZ.

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
8 months 2 days ago #176907 by tpartner
There us no reason to use is_empty() when trying to determine the value of a list-radio question. It should be Q1.NAOK == 'x'.

Shouldn't that be an AND between the 'does not equal' statements?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Please Log in or Create an account to join the conversation.

More
8 months 1 day ago - 8 months 1 day ago #176925 by Joffm
Hi,
1. as Tony said
"Q1==9" gives a result of true or false (1 or 0). So it is never empty.


2. (Q2 != "waidhofen an der ybbs" OR Q2 != "allhartsberg")
Tony already mentioned it.
This way you will get everything, even "allhartsberg"; it is unequal to "waidhausen..."
Just to remind:
NOT ( A OR B ) == ( NOT A ) AND ( NOT B )
NOT ( A AND B ) == ( NOT A ) OR ( NOT B )

Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 8 months 1 day ago by Joffm.

Please Log in or Create an account to join the conversation.

More
8 months 1 day ago #176928 by KompetenzZ
As far as I understand it, compared to an equation with EQUAL (as mentioned in the first post) the NOT EQUAL makes it neccessary to change the logical operator between the != from OR to AND.
Yes the is_empty was also misplaced.
This is probably easy for most folks here, but for myself this would not have come to my mind. Thank you very much.
Just for information, this is the adapted equation:
Q1.NAOK == 9 OR Q1.NAOK == 3 AND (Q2 != "waidhofen an der ybbs" AND Q2 != "allhartsberg")

Cheers kompetenzz

Please Log in or Create an account to join the conversation.

More
8 months 1 day ago #176930 by DenisChenu
Without brace it's unclear :
You want
(Q1.NAOK == 9 OR Q1.NAOK == 3) AND Q2.NAOK != "waidhofen an der ybbs" AND Q2.NAOK != "allhartsberg"
or
Q1.NAOK == 9 OR (Q1.NAOK == 3 AND Q2.NAOK != "waidhofen an der ybbs" AND Q2.NAOK != "allhartsberg")
or really
Q1.NAOK == 9 OR (Q1.NAOK == 3 AND Q2.NAOK != "waidhofen an der ybbs" AND Q2.NAOK != "allhartsberg")

And with the current script : there are a lack of trigger action when user select an option : sample : gitlab.com/SondagesPro/QuestionSettingsT...-autocomplete.js#L29

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

More
8 months 1 day ago #176935 by KompetenzZ
I cannot find any difference between your second and third equation but yes these are those equations that I need, thank you for sharing you knowledge.

Regarding your last sentence: Is it that you mean that the script of the autocomplete question I asked www.limesurvey.org/forum/design-issues/1...uestion-on-same-page is not possible to implement?

Cheers kompetenzz

Please Log in or Create an account to join the conversation.

More
8 months 1 day ago #176941 by DenisChenu
The script didn't trigger action when user select a value : you must add it manually.

In 3.X : autocomplete are devbridgeAutocomplete

Then maybe something like this
			$('#question'+qID+' input[type="text"]').autocomplete({
				source: province,
				onSelect: function (suggestion) {
					$('#question'+qID+' input[type="text"]').val(suggestion.data).trigger("keyup");
				}
			});

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

More
8 months 1 day ago #176949 by KompetenzZ
Well I don't have experience with gitlab.com, I try to ask as few question as I can:

1. Do I have to add the limesurvey-autocomplete.js from gitlab.com/SondagesPro/QuestionSettingsT...-autocomplete.js#L29 at the end of my autocomplete question?

2. Do I have to add the limesurvey-autocomplete.css from gitlab.com/SondagesPro/QuestionSettingsT...vey-autocomplete.css to the end of custom.css in my theme?

3. Where do I have to add the path to the csv lists where the autocomplete entries are stored? I don't know, I tried to find something like:
var url = surveyRoot+"upload/themes/survey/extends_bootswatch/autocomplete_list.csv";

4. Where do I have to add the code for the trigger action of your previous post?


If it's less complicated instead of answering these questions, rather adapt the test survey (.lss).

File Attachment:

File Name: limesurvey...1-15.lss
File Size:20 KB

File Attachment:

File Name: extends1_b...1-15.zip
File Size:287 KB

Cheers kompetenzz
Attachments:

Please Log in or Create an account to join the conversation.

More
8 months 1 day ago #176966 by DenisChenu
The pluugin is another way to do …

Where i need to trigger the event when user select something …

Then maube some code can inspire see www.limesurvey.org/fr/forum/design-issue...ance-equation#176941

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

More
8 months 20 hours ago #177010 by KompetenzZ
Sorry, I don't have the experience to do that.

Cheers kompetenzz

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!