- Posts: 10633
- Thank you received: 3697
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
- tpartner
- Away
- LimeSurvey Community Team
Less
More
4 years 5 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 5 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: 11757
- Thank you received: 2753
4 years 5 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: 11757
- Thank you received: 2753
4 years 5 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
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10633
- Thank you received: 3697
4 years 5 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 5 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: 13935
- Thank you received: 2551
4 years 5 months ago - 4 years 5 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 5 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
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10633
- Thank you received: 3697
4 years 5 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 5 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.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
4 years 5 months ago #190380
by DenisChenu
Sometimes i have 3 equations question at start of the survey
EndUrl
QuotaOutUrl
OptOutUrl
If it don,'t work on 3.19 : it's really a major issue and must be reported.
EndUrl equation hidden question
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?
It's my advice : didn't use an eaquation in end url, but create an equation questionasilbering wrote: 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.
Sometimes i have 3 equations question at start of the survey
EndUrl
QuotaOutUrl
OptOutUrl
If it don,'t work on 3.19 : it's really a major issue and must be reported.
No …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"})
EndUrl equation hidden question
Code:
{ if({TOKEN:ATTRIBUTE_2}!="NA","example.org/survey/212/token/"+{TOKEN}+"/val/"{TOKEN:ATTRIBUTE_2},""}
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.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11757
- Thank you received: 2753
4 years 5 months ago #190389
by holch
So it seems like equations in the end URL feature don't really work (or I have some kind of wrong setting, but XSS filter was switched off).
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 quick with the end url field and equations and I wasn't able to make it work (within the end url field). Limesurvey did always subsitute parts of the equation (within the end url field directly) with some html code. This happened both, in the demo version and in my own installation.If it don,'t work on 3.19 : it's really a major issue and must be reported.
So it seems like equations in the end URL feature don't really work (or I have some kind of wrong setting, but XSS filter was switched off).
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.
- asilbering
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 74
- Thank you received: 1
4 years 5 months ago #190390
by asilbering
Replied by asilbering on topic use end url and attributes to redirect users to fill survey more than once?
Thanks Denis and Holch,
I have tried a bit with both approaches (equation in the endurl field and endurl field directing to an equation question with the if clause) and was not able to make it work. I will send a sample survey tomorrow (no time to prepare it today), maybe someone can spot an error... Otherwise I will file a report.
Best regards,
Ana
I have tried a bit with both approaches (equation in the endurl field and endurl field directing to an equation question with the if clause) and was not able to make it work. I will send a sample survey tomorrow (no time to prepare it today), maybe someone can spot an error... Otherwise I will file a report.
Best regards,
Ana
The topic has been locked.