Conditional End Screen Text Syntax

More
4 months 3 weeks ago #223338 by joeschwab
Please help us help you and fill where relevant:
Your LimeSurvey version: Version 3.18.0+190923
Own server or LimeSurvey hosting: Own server
Theme: fruity

==================


Hello, we are using the end screen message to apply some logic that either displays a thank you message if a user is not eligible, and a meta refresh redirect if they are eligible. This is working for us with simpler single logic statement. I have a new scenario where we need more logic checks, and I am unsure of the syntax for multiple statements. I think I may just have a an issue with the number of parenthesis.

My code looks like this:

{if((Qage.NAOK <= 13) or (Qage.NAOK > 18) and (CTA5attempt1.NAOK == '4') or (CTA5attempt2.NAOK == '4') or (CTA5attempt3.NAOK == '4'),"<h2>Thank you for your interest in our study.</h2><p>We appreciate you taking the time to answer our questions.</p>","<meta http-equiv='refresh'content='0;url=https://anothersite.com'>")}

I am getting red highlighted syntax error (attached)

Any help would be greatly appreciated.
 
Attachments:

Please Log in to join the conversation.

More
4 months 3 weeks ago #223339 by holch
I think the problem is probably the HTML code in the syntax, this is always a good source of error.

Personally, I would probably do all the calculations in a hidden equation question on the previous "page" which will just have something like "eligible" or "screenout" or something.

I probably would even go a totally different route and create a real screenout via zero quota for those that are non eligible with their own end message through the quota and only let those get to the real end message that actually qualify, then you can use the end URL feature for redirection.

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: joeschwab

Please Log in to join the conversation.

More
4 months 3 weeks ago #223403 by DenisChenu
Dis you try replace " by ' ? and woithout the refredh for strating ?
{if((Qage.NAOK <= 13) or (Qage.NAOK > 18) and (CTA5attempt1.NAOK == '4') or (CTA5attempt2.NAOK == '4') or (CTA5attempt3.NAOK == '4'),'<h2>Thank you for your interest in our study.</h2><p>We appreciate you taking the time to answer our questions.</p>')}

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.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now