- Posts: 43
- Thank you received: 0
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
- Topic Author
- Offline
- Senior Member
Less
More
3 years 8 months ago #203742
by jma6610
Can expression manager print cursor return and line feed? was created 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
If so, can you give me an example?
Thanks in advance.
Jeff
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12941
- Thank you received: 3979
3 years 8 months ago #203743
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Can expression manager print cursor return and line feed?
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
{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
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 43
- Thank you received: 0
3 years 8 months ago #203777
by jma6610
Replied by jma6610 on topic Can expression manager print cursor return and line feed?
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12941
- Thank you received: 3979
3 years 8 months ago - 3 years 8 months ago #203778
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Can expression manager print cursor return and line feed?
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
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12941
- Thank you received: 3979
3 years 8 months ago - 3 years 8 months ago #203783
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Can expression manager print cursor return and line feed?
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
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.