Welcome to the LimeSurvey Community Forum

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

Can expression manager print cursor return and line feed?

  • jma6610
  • jma6610's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 8 months 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
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 8 months 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
The topic has been locked.
  • jma6610
  • jma6610's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 8 months 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 ?
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 8 months ago - 3 years 8 months 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: 3 years 8 months ago by Joffm.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 8 months ago - 3 years 8 months 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: 3 years 8 months ago by Joffm.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose