Can expression manager print cursor return and line feed?

More
1 month 3 weeks ago #203742 by jma6610
I have a multiple choice question and want to print out the answers that are checked in a later question- one per line, but don't want to have blank lines. Can expression manager print cursor returns and line feeds so this can be done? E.g,. Chr(13), Chr(10) .

If so, can you give me an example?

Thanks in advance.

Jeff

Please Log in to join the conversation.

LimeSurvey Partners
More
1 month 3 weeks ago #203743 by Joffm
You want to have the subquestion text?


{join(if(Q1_SQ001=="Y",Q1_SQ001.question+'<br />',""), if(Q1_SQ002=="Y",Q1_SQ002.question+'<br />',""), if(Q1_SQ003=="Y",Q1_SQ003.question+'<br />',""), if(Q1_SQ004=="Y",Q1_SQ004.question+'<br />',""), if(Q1_SQ005=="Y",Q1_SQ005.question+'<br />',""), if(Q1_SQ006=="Y",Q1_SQ006.question+'<br />',""), if(Q1_SQ007=="Y",Q1_SQ007.question+'<br />',""))}

Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Attachments:

Please Log in to join the conversation.

More
1 month 3 weeks ago #203777 by jma6610
That works as long as I enter this into the source area of the question edit box and don't open it again. If the edit is re-opened, the editor automatically alters by executing the <br /> and messes up the syntax. Is there a work-around or alternative ?

Please Log in to join the conversation.

More
1 month 3 weeks ago - 1 month 3 weeks ago #203778 by Joffm
Exactly.
The rule is: Enter it and don't touch it again.
The editor has its own special behaviour.

But as far as I see, there is no change if you enter the equation in source code mode.

Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 month 3 weeks ago by Joffm.

Please Log in to join the conversation.

More
1 month 3 weeks ago - 1 month 3 weeks ago #203783 by Joffm
Well, the syntax is not "messed up".
It is only the display in HTML mode. Here the "<br>" is rendered.

But you may use a different - and shorter - approach.
In the "Implemeted Functions" of the manual you find these two functions.
"list" and "str_replace".

So you may use:
{str_replace(", ",'<br />',list(that.Q1.shown))}

Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 month 3 weeks ago by Joffm.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now