Welcome to the LimeSurvey Community Forum

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

Conditional end message

  • spiceaw
  • spiceaw's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 1 month ago #163738 by spiceaw
Conditional end message was created by spiceaw
Hi,

I'm trying to set a conditional end message, where based on earlier questions I define what to display in end message.

I followed a previous recommandation from Denis :
- Defined a text question (Positive), hidden, with content I want displayed (contains img and script)
- I define for that text question conditions (e.g. question 3 to yes)
- I put in end message {Positive}

If I don't hide my Positive text question, this one appears properly when the condition is met.
But when I hide it and get to the end of the survey, I don't have Positive displayed.

Is there a restriction on what kind of content can be visible in the end message?

Thanks,
Julien
The topic has been locked.
More
6 years 1 month ago - 6 years 1 month ago #163741 by Ben_V
Replied by Ben_V on topic Conditional end message
Hi,
try to hide your question using javascript rather than advanced setting (set always visible).

Please paste this snippet in the help textarea for this question
Code:
<script>  
  $(document).ready(function() {
    $('#question{QID}').hide();
  });    
</script>

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Last edit: 6 years 1 month ago by Ben_V.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 1 month ago - 6 years 1 month ago #163743 by holch
Replied by holch on topic Conditional end message
[strike]You don't actually need to hide the question. If you use the correct condition or relevance equation (better!) the question only appears if a certain condition is met. If you hide the question via the system it will NEVER be shown, no matter what the condition says.[/strike]
Sorry, I didn't think this through. The hiding is necessary because of the usage in the end message.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Last edit: 6 years 1 month ago by holch.
The topic has been locked.
  • spiceaw
  • spiceaw's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 1 month ago #163756 by spiceaw
Replied by spiceaw on topic Conditional end message
Thanks for your suggestions.

I tried setting the question visible and put the js in the help. It doesn't hide the question.
In any case, I still don't see the question text in my end message.

I did a basic testing with
Code:
Code:  Test
Question:  Test is working
Help:  
Type:  Text display

In the end Message I have
Code:
We thank you for completing this survey.
{Test}

Test is not displayed in the End Message.
It must be the way I'm calling the question text that is not correct.
Is {Test} not the way to do it?
The topic has been locked.
More
6 years 1 month ago #163760 by jelo
Replied by jelo on topic Conditional end message
Please attach a small survey with the relevant parts.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • spiceaw
  • spiceaw's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 1 month ago #163761 by spiceaw
Replied by spiceaw on topic Conditional end message
Here is an export of the relevant part

File Attachment:

File Name: limesurvey...6182.lss
File Size:37 KB
The topic has been locked.
More
6 years 1 month ago #163777 by jelo
Replied by jelo on topic Conditional end message

Ben_V wrote: try to hide your question using javascript rather than advanced setting (set always visible). $('#question{QID}').hide();

Is that still working under LS 3.0?

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
More
6 years 1 month ago #163781 by jelo
Replied by jelo on topic Conditional end message
What version of LimeSurvey is used?

You can hide the question via CSS.



BTW:The English End message html code is a bit broken. Javascript and DIVs.


Can you point me to the workaround Denis showed you?
To me it looks like LS 3.X has a bug. The editor is showing the piping, but the end-message is not containing the variable content.


Under LS 3.2.1. I cannot get the endmessage in preview, only when I activate the survey. Strange.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • spiceaw
  • spiceaw's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 1 month ago #163795 by spiceaw
Replied by spiceaw on topic Conditional end message
I'm using Version 3.0.3+180112

Here is what Denis explained me by email once :

Le plus simple étant directement d'ajouter 2 questions de type texte + 1 question Équation.:
TEXTEoui: le texte pour oui
TEXTEnon: le texte pour non
EQUATION: {if(QCODE=="OUI",TEXTEoui.question,TEXTEnon.question)}

Message de fin : {EQUATION}
The topic has been locked.
More
6 years 1 month ago #163806 by jelo
Replied by jelo on topic Conditional end message
And why didn't you follow his instruction? I cannot see any equation question in your survey.
You directly piped a textdisplay question. Any reason why?

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • spiceaw
  • spiceaw's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 1 month ago #163818 by spiceaw
Replied by spiceaw on topic Conditional end message
The question Positive has conditions.
But since I couldn't get it displayed in the end message, I tried adding a Test question without conditions to check if the issue was from the conditions.

Isn't it possible to directly pipe a Text Display question?
The topic has been locked.
  • spiceaw
  • spiceaw's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 1 month ago #163831 by spiceaw
Replied by spiceaw on topic Conditional end message
Thanks all for looking into my problem.

Finally I found what the issue was.
It wasn't due to the question type, just the way I was calling it in the end message.

If someone faces the same issue one day, don't write {Positive} but {Positive.question}
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose