Welcome to the LimeSurvey Community Forum

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

Conditional end message

More
6 years 2 months 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 2 months 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 2 months 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 2 months 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 2 months 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 2 months 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.
More
6 years 2 months ago #163833 by jelo
Replied by jelo on topic Conditional end message
There are a lot of things which should be working, but aren't.

First issue: There seems to be a bug, that you cannot get a endmessage in preview.
So you need to activate the survey to see a endmessage.

Second issue: Hiding the question is not working via the javascript in the helptext.
Use CSS class hidden as shown in the screenshot

Third issue: Piping seems not to work as intended.
Change type of question "Positive" to equation. Just change and save. No need to edit question content itself.

Fourth issue:
Piping seems to work with equation type, but it not transporting everything (embedded javascripts seem to be stripped, haven't investigated)



Is there a reason, why Denis isn't suggesting Expression Manager in the endmessage?
Perhaps there is a issue too, bug when trying to show different content depending on answers my first idea would be using Expression manager in the endmessage.

I have submitted bug reports, but that won't help you now.
bugs.limesurvey.org/view.php?id=13317
bugs.limesurvey.org/view.php?id=13320

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 2 months ago - 6 years 2 months ago #163857 by spiceaw
Replied by spiceaw on topic Conditional end message
Thanks for reporting those issues Jelo.

I managed displaying an end message with media and js from a "text display" question but the condition was not followed. So it was displayed in all cases.

I changed the solution by using an "equation" question to analyze the condition.
I got it to work properly to display a basic True/False text.
So I can test if media and js work too, how would you call in place of "true" a text display content in the following expression?
Code:
{if(((WouldRecommend.NAOK == "Y") and (( ! is_empty(OverallExperience_1.NAOK) && (OverallExperience_1.NAOK == 1)) or ( ! is_empty(OverallExperience_1.NAOK) && (OverallExperience_1.NAOK == 2)) or ( ! is_empty(OverallExperience_1.NAOK) && (OverallExperience_1.NAOK == 3)))),"TRUE","FALSE")}
Last edit: 6 years 2 months ago by spiceaw. Reason: edit
The topic has been locked.
  • spiceaw
  • spiceaw's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 2 months ago #163863 by spiceaw
Replied by spiceaw on topic Conditional end message

jelo wrote:
Fourth issue:
Piping seems to work with equation type, but it not transporting everything (embedded javascripts seem to be stripped, haven't investigated)


You are right.
I found the way to pipe the content I wanted but all html code and script got stripped out.
So I'm stuck at this stage.

How would you go with using EM in the End Message?

Thanks
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 2 months ago - 6 years 2 months ago #164108 by DenisChenu
Replied by DenisChenu on topic Conditional end message
Hi,

usage of QCODE.question work in 2.6lts, surely in 2.73 , but 3.0 can have issue with this.

And it's really better than usage of equation for such purpose : allow html (equation disallow it), take less part in DB etc …
You can hide it using included 'hide this question'

I make some quick test to see if it's a LS issue or not.
Come back after

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: 6 years 2 months ago by DenisChenu.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 2 months ago - 6 years 2 months ago #164110 by DenisChenu
Replied by DenisChenu on topic Conditional end message
There are an issue with 3.3.1 (i advice my clients to stay on 2.6lts or 2.73 since they need some specific system).


2.6lts : demonstration.sondages.pro/853122
2.72.1 : on 2.7X
3.3.1 (git master) : master.sondages.pro/index.php/survey/ind...22/newtest/Y/lang/en

I report the bug

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: 6 years 2 months ago by DenisChenu.
The topic has been locked.
  • spiceaw
  • spiceaw's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 2 months ago #164468 by spiceaw
Replied by spiceaw on topic Conditional end message
Hi Denis,

Thanks for your reply.
I have updated to 3.4 since I noticed that the bugs you reported were fixed in that release.

When I use QCODE.question, the html is properly displayed (I used text display as question type for QCODE).
But I am still not able to set a condition to display that HTML or not.

Here is what I try :
I have a Yes/No question.
I have a hidden HTML text question with conditional display based on the Yes/No. If the answer was Yes, the HTML question is displayed.
I use HTML.question in the end message. The HTML code is properly displayed but it gets displayed all the time even if the answer was no.

How would you solve this case?

Thanks
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose