- Posts: 74
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
use end url and attributes to redirect - problem when resuming later
- asilbering
- Topic Author
- Offline
- Senior Member
Less
More
4 years 6 months ago #190326
by asilbering
Replied by asilbering on topic use end url and attributes to redirect users to fill survey more than once?
I found the problem! I was not using the right syntax for EM, and now I corrected it and the redirection works fine.
But if the attribute is NA the survey fails to go to the end page (the "command" COMPLETED doesn't work).
Any ideas?
Thanks!
Ana
But if the attribute is NA the survey fails to go to the end page (the "command" COMPLETED doesn't work).
Any ideas?
Thanks!
Ana
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
4 years 6 months ago #190327
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic use end url and attributes to redirect users to fill survey more than once?
There is no "command" COMPLETED. Try leaving that out.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- asilbering
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 74
- Thank you received: 1
4 years 6 months ago #190328
by asilbering
Replied by asilbering on topic use end url and attributes to redirect users to fill survey more than once?
Thanks for the quick reply.
As far as I understood I always need to have an expression in case the condition is not met. What should I write there in this case, i.e. how do I indicate that the survey has to finish with its end page?
Thanks!
Ana
As far as I understood I always need to have an expression in case the condition is not met. What should I write there in this case, i.e. how do I indicate that the survey has to finish with its end page?
Thanks!
Ana
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
4 years 6 months ago #190331
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic use end url and attributes to redirect users to fill survey more than once?
In 3.x, you don't need a value for a failed condition but try empty quotes.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- asilbering
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 74
- Thank you received: 1
4 years 6 months ago #190332
by asilbering
Replied by asilbering on topic use end url and attributes to redirect users to fill survey more than once?
I tried empty quotes and nothing at all and the result is that I get redirected to the survey registration page where I get asked for a token to start the survey again...
What I need is the survey to go to then end page where I thank the participant if the attribute is NA.
Thanks!
Ana
What I need is the survey to go to then end page where I thank the participant if the attribute is NA.
Thanks!
Ana
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11660
- Thank you received: 2742
4 years 6 months ago #190337
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 use end url and attributes to redirect users to fill survey more than once?
The problem is that you are basically already on the end page, when the end url is triggered.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11660
- Thank you received: 2742
4 years 6 months ago #190339
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 use end url and attributes to redirect users to fill survey more than once?
I was playing around with the demo and something is really strange:
This doesn't work in the End URL field on the demo (LS 3.19.3) at all.
Seems like the XSS filter is hitting the END URL field or something.
Code:
{if(Q1==1,"http://google.com")}
This doesn't work in the End URL field on the demo (LS 3.19.3) at all.
Seems like the XSS filter is hitting the END URL field or something.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
4 years 6 months ago #190340
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic use end url and attributes to redirect users to fill survey more than once?
In that case, you may need to use a JavaScript redirect in the end message instead of the survey end URL.
Something like this:
Something like this:
Code:
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ $('.completed-wrapper').hide(); if('{TOKEN:ATTRIBUTE_2}' != 'NA') { window.location.href = 'http://web-test.xxx.ch/index.php?r=survey/index&sid={SID}&token={TOKEN:ATTRIBUTE_2}&newtest=Y'; } else { $('.completed-wrapper').show(); } }); </script>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- asilbering
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 74
- Thank you received: 1
4 years 6 months ago #190343
by asilbering
Replied by asilbering on topic use end url and attributes to redirect users to fill survey more than once?
Thanks holch and tpartner for your feedback!
I will try with the java script then.
Best regards
Ana
I will try with the java script then.
Best regards
Ana
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
4 years 6 months ago - 4 years 6 months ago #190366
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 use end url and attributes to redirect users to fill survey more than once?
I always use a Equation question for endUrl …
then i can do anything, and update/checking/validate etc … is really more easy : no need to activate survey …
And if you need w or > etc …
Use alterna te solution can work
See : manual.limesurvey.org/Expression_Manager#HTML_editor_issue
then i can do anything, and update/checking/validate etc … is really more easy : no need to activate survey …
And if you need w or > etc …
Use alterna te solution can work
Code:
{if(Q1 lt 1,"http://example.com")}
See : manual.limesurvey.org/Expression_Manager#HTML_editor_issue
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.
Last edit: 4 years 6 months ago by DenisChenu. Reason: https://manual.limesurvey.org/Expression_Manager#HTML_editor_issue
The following user(s) said Thank You: tpartner
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
4 years 6 months ago #190368
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic use end url and attributes to redirect users to fill survey more than once?
I agree, defining the end URL in an equation question is good practice.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- asilbering
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 74
- Thank you received: 1
4 years 6 months ago #190371
by asilbering
Replied by asilbering on topic use end url and attributes to redirect users to fill survey more than once?
Hi Denis,
could you please be a little bit more specific? (I am still quite a beginner).
What I was doing before (and was working fine in LS 2.05) was to direct to an equation question in the end url field ({myURL}) and then having an if clause in myURL.
This is not working in LS 3.19 anymore.
So your suggestion would be that :
1- I write an if clause in the end url field ({if(Q1 lt 1," example.com ")})
2 - and then the condition related to the attribute in the equation question Q1 ({TOKEN:ATTRIBUTE_2=="NA"})
Did I get it right?
I have tried this with {TOKEN:ATTRIBUTE_2=="NA"} and {TOKEN:ATTRIBUTE_2!="NA"} in Q1 and in both cases after I complete the survey I am directed to the end message, although the attribute is not NA.
Otherwise I will try with the java in the end message field...
Thanks in advance!
Best regards,
Ana
could you please be a little bit more specific? (I am still quite a beginner).
What I was doing before (and was working fine in LS 2.05) was to direct to an equation question in the end url field ({myURL}) and then having an if clause in myURL.
This is not working in LS 3.19 anymore.
So your suggestion would be that :
1- I write an if clause in the end url field ({if(Q1 lt 1," example.com ")})
2 - and then the condition related to the attribute in the equation question Q1 ({TOKEN:ATTRIBUTE_2=="NA"})
Did I get it right?
I have tried this with {TOKEN:ATTRIBUTE_2=="NA"} and {TOKEN:ATTRIBUTE_2!="NA"} in Q1 and in both cases after I complete the survey I am directed to the end message, although the attribute is not NA.
Otherwise I will try with the java in the end message field...
Thanks in advance!
Best regards,
Ana
The topic has been locked.