Welcome to the LimeSurvey Community Forum

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

Conditions and scenarios

  • Petteri66
  • Petteri66's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 4 months ago #191194 by Petteri66
Conditions and scenarios was created 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
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 months ago - 4 years 4 months ago #191210 by tpartner
Replied by tpartner on topic Conditions and scenarios
Try using Qcode.relevanceStatus - manual.limesurvey.org/Expression_Manager...#Access_to_variables

Code:
((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.
Last edit: 4 years 4 months ago by tpartner.
The topic has been locked.
  • Petteri66
  • Petteri66's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 4 months 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
The topic has been locked.
  • Petteri66
  • Petteri66's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 4 months 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.
The topic has been locked.
More
4 years 4 months 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
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 months 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.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • Petteri66
  • Petteri66's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 4 months 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
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose