Conditions and scenarios

More
2 months 1 week ago #191194 by Petteri66
Hello,

my knowledge of "code language" is rather limited, and I would need some help. At the end of a survey I have some special questions which should be shown only for participants who have answered in a certain way earlier BUT who has not been shown a questions (an array type). For the last questions I have a lot of conditions with several scenarios, which are working fine, but somehow I can’t figure out how to add the condition “the question Q00070 was not shown”.

Here is a sample of one of the conditions with 4 scenarios, where the specific HAS NOT BEEN SHOWN should be added.

((Q00004.NAOK == "A2") and (Q00075.NAOK == "A2")) or
((( ! is_empty(Q00032_SQ001.NAOK) && (Q00032_SQ001.NAOK < 2))) and (( ! is_empty(Q00034_SQ001.NAOK) && (Q00034_SQ001.NAOK == 1))) and (Q00075.NAOK == "A2")) or
((( ! is_empty(Q00032_SQ001.NAOK) && (Q00032_SQ001.NAOK < 2))) and (( ! is_empty(Q00032_SQ002.NAOK) && (Q00032_SQ002.NAOK < 1))) and (Q00075.NAOK == "A2")) or
((( ! is_empty(Q00032_SQ001.NAOK) && (Q00032_SQ001.NAOK < 3))) and (( ! is_empty(Q00033_SQ001.NAOK) && (Q00033_SQ001.NAOK == 1))) and (Q00075.NAOK == "A2"))


Somehow I should get in all scenarios the condition Q00070 HAS NOT BEEN SHOWN. I really would appreciate some help here :) .

BR,

Petteri

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

LimeSurvey Partners
More
2 months 1 week ago - 2 months 1 week ago #191210 by tpartner
Replied by tpartner on topic Conditions and scenarios
Try using Qcode.relevanceStatus - manual.limesurvey.org/Expression_Manager...#Access_to_variables

((Q00004.NAOK == "A2") AND (Q00075.NAOK == "A2") AND (Q00070.relevanceStatus.NAOK < 1)) 
OR
(((!is_empty(Q00032_SQ001.NAOK) AND (Q00032_SQ001.NAOK < 2))) AND ((!is_empty(Q00034_SQ001.NAOK) AND (Q00034_SQ001.NAOK == 1))) AND (Q00075.NAOK == "A2") AND (Q00070.relevanceStatus.NAOK < 1)) 
OR
(((!is_empty(Q00032_SQ001.NAOK) AND (Q00032_SQ001.NAOK < 2))) AND ((!is_empty(Q00032_SQ002.NAOK) AND (Q00032_SQ002.NAOK < 1))) AND (Q00075.NAOK == "A2") AND (Q00070.relevanceStatus.NAOK < 1)) 
OR
(((!is_empty(Q00032_SQ001.NAOK) AND (Q00032_SQ001.NAOK < 3))) AND ((!is_empty(Q00033_SQ001.NAOK) AND (Q00033_SQ001.NAOK == 1))) AND (Q00075.NAOK == "A2") AND (Q00070.relevanceStatus.NAOK < 1))

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Last edit: 2 months 1 week ago by tpartner.

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

More
2 months 6 days ago #191231 by Petteri66
Replied by Petteri66 on topic Conditions and scenarios
Hi Tony,

thank you for the help. When I add the RelevanceStatus I get red text "undefinied variable":

((Q00004.NAOK == "A2") AND (Q00075.NAOK == "A2") AND (Q00070.relevance.NAOK < 1)) or ((( ! is_empty(Q00032_SQ001.NAOK) AND (Q00032_SQ001.NAOK < 2))) AND (( ! is_empty(Q00034_SQ001.NAOK) AND (Q00034_SQ001.NAOK == 1))) AND (Q00075.NAOK == "A2") AND (Q00070.relevance.NAOK < 1)) or ((( ! is_empty(Q00032_SQ001.NAOK) AND (Q00032_SQ001.NAOK < 2))) AND (( ! is_empty(Q00032_SQ002.NAOK) AND (Q00032_SQ002.NAOK < 1))) AND (Q00075.NAOK == "A2") AND (Q00070.relevance.NAOK < 1)) or ((( ! is_empty(Q00032_SQ001.NAOK) AND (Q00032_SQ001.NAOK < 3))) AND (( ! is_empty(Q00033_SQ001.NAOK) AND (Q00033_SQ001.NAOK == 1))) AND (Q00075.NAOK == "A2") AND (Q00070.relevance.NAOK < 1))

I'll try by trial and error some varitions, but would be very thankful for some future ideas.

Cheers,

Petteri

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

More
2 months 6 days ago #191232 by Petteri66
Replied by Petteri66 on topic Conditions and scenarios
ff. First I tried with RelavanceStatus as you wrote, but also there I got "undefined variable", thus then I tried with Relavance only.

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

More
2 months 6 days ago #191234 by jelo
Replied by jelo on topic Conditions and scenarios
It might help to post the exact LimeSurvey version you use. Attach an LSS-Export of the relevant questions if you still have issues.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users

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

More
2 months 5 days ago #191249 by tpartner
Replied by tpartner on topic Conditions and scenarios
Note that variable names are case-sensitive, yes, please attach a small sample survey containing only the relevant questions.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
The following user(s) said Thank You: DenisChenu

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

More
2 months 4 days ago #191270 by Petteri66
Replied by Petteri66 on topic Conditions and scenarios
Hi Tony and jelo,


thanks for your replies. I think I solved the issue, thanks to Tonys first advice with RelavanceStatus. It seems to work in my "tests". I first made an mistake with that RelavanceStatus-code B) .

Cheers,

Petteri

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!