- Posts: 40
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Conditional End Screen Text Syntax
- joeschwab
- Topic Author
- Offline
- Senior Member
Less
More
2 years 2 months ago #223338
by joeschwab
Conditional End Screen Text Syntax was created 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.
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:
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11756
- Thank you received: 2753
2 years 2 months ago #223339
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Conditional End Screen Text Syntax
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.
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
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
2 years 2 months ago #223403
by DenisChenu
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.
Replied by DenisChenu on topic Conditional End Screen Text Syntax
Dis you try replace " by ' ? and woithout the refredh for strating ?
Code:
{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.
The topic has been locked.