Welcome to the LimeSurvey Community Forum

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

Text displays with multiple conditions won't show up...

  • proaudience
  • proaudience's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 6 months ago #127309 by proaudience
Hi,

I've the following sample survey to ask you something about. There are three questions and a simple text display at the end. The text display refuses to show up, however, with its present relevance equation/ conditions. The only possible way of making it be visible is to assign it a single condition, but adding any new scenarios beyond that (as it stands right now) would only make it go invisible. So, what I've been missing here?

survey.proaudience.com/index.php/265842?lang=en

This doesn't work...

test
t1: [1] test1?
t2: [((t1.NAOK == "A1"))] test2?
t3: [((t2.NAOK == "A1"))] test3?
t4: [((t1.NAOK == "A2") and (t2.NAOK == "A2") and (t3.NAOK == "A2"))] thanks

The following would surely work, however, if implemented...

test
t1: [1] test1?
t2: [((t1.NAOK == "A1"))] test2?
t3: [((t2.NAOK == "A1"))] test3?
t4: [((t1.NAOK == "A2"))] thanks

Look forward to some guidance here.

Thanks,
Pankaj Mohan
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 6 months ago #127313 by tpartner
As far as I can see, the relevance for t4 can never be true. You cannot have all of t1, t2 and t3 equal "A2" because t2 and t3 are only relevant if their preceding questions equal "A1".

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: proaudience
The topic has been locked.
  • proaudience
  • proaudience's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 6 months ago #127315 by proaudience
Thanks for your response, tpartner.

Now does it mean, creating three separate text displays for each of those conditions is the only way forward? I've already implemented this plan (separate text displays) in yet another survey, which I'm currently working with, and it seems to be working fine up to this juncture.
The topic has been locked.
  • proaudience
  • proaudience's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 6 months ago #127317 by proaudience
I got it working with the following Regular Expression by simply adding OR in those places, where AND logic was being used. So my problem is solved for the time being...


test
t1: [1] test1?
t2: [((t1.NAOK == "A1"))] test2?
t3: [((t2.NAOK == "A1"))] test3?
t4: [((regexMatch( " / t1 : test1 ? (qid50)equalsno(A2) or t2 : test2 ? (qid51)equalsno(A2) or t3 : test3 ? (qid52)equalsno(A2)Addcondition / " , t3.NAOK)))] thanks
The topic has been locked.
  • proaudience
  • proaudience's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 6 months ago #127356 by proaudience
My last attempt proved to be a huge embarrassment in the end. :silly:

It worked simply by chance in this particular case.

I'll stick with the 'separate text displays' in my case for now, which provides a practical solution for my immediate requirements.
The topic has been locked.
  • proaudience
  • proaudience's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 5 months ago #127713 by proaudience
This update is specially meant for those, who may not be well-acquainted in enforcing conditions, just like me. I was able to set a range of conditions by using the 'Scenario' option judiciously. So, for example, my earlier nonsensical piece of code transformed into the following one.

t1: [1] test1?
t2: [((t1.NAOK == "A1"))] test2?
t3: [((t2.NAOK == "A1"))] test3?
t4: [((t2.NAOK == "A2")) or ((t1.NAOK == "A2")) or ((t3.NAOK == "A2"))] thanks

The trick is to simply add 'or' (or rather replace with 'or', since the default condition is set at 'and') in the input field for scenario, and go on adding numbers thereafter, when required. The same way, one could even use a combination of 'and' and 'or' for carrying out more complex operations as well. I've created a functioning survey from the same method at the following link now... B)

Stock Market Survey For The Indian Retail Investors...
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose