- Posts: 103
- Thank you received: 5
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Keep question editor from changing formatted question text entered in sourcemode
- socius
- Topic Author
- Offline
- Premium Member
Less
More
6 years 7 months ago - 6 years 7 months ago #158234
by socius
Keep question editor from changing formatted question text entered in sourcemode was created by socius
Dear all,
I have some trouble with the question editor and formatted dynamic output via EM. (And sorry: I think this topic should be filed somewhere else and not under "Can I do this ...")
I'd like to dynamically formulate the question text - which usually works perfectly with the EM.
But: This time I want to use formatting, more specific: an unordered list with bullet points - one bulletpoint appearing for every specific answer the respondent gave in a multiple choice question before, i.e.
q1: Where did you eat at?
A
B
C
D
E
F
q2: What did you eat at [and now the according bullet points]
I write this code into the "Source" field. Now the Problem is, that every time I save this question the automatic formatting destroys the code and makes the source look like the code below - if I save the question again (which I do frequently because of formulation details, etc.) the question does not work any more.
Is there a way to preserve the code as it is and keep the editor from formatting it? I hope I did not overlook such a functionality.
Thanks for your time!
Best, G
I have some trouble with the question editor and formatted dynamic output via EM. (And sorry: I think this topic should be filed somewhere else and not under "Can I do this ...")
I'd like to dynamically formulate the question text - which usually works perfectly with the EM.
But: This time I want to use formatting, more specific: an unordered list with bullet points - one bulletpoint appearing for every specific answer the respondent gave in a multiple choice question before, i.e.
q1: Where did you eat at?
A
B
C
D
E
F
q2: What did you eat at [and now the according bullet points]
Code:
<ul> {implode('', if(q1_1.NAOK == 'Y','<li>q1_1.shown</li>',''), if(q1_2.NAOK == 'Y','<li>q1_2.shown</li>',''), if(q1_3.NAOK == 'Y','<li>q1_3.shown</li>',''), if(q1_4.NAOK == 'Y','<li>q1_4.shown</li>',''), if(q1_5.NAOK == 'Y','<li>q1_5.shown</li>',''), if(q1_6.NAOK == 'Y','<li>q1_6.shown</li>',''))} </ul>
I write this code into the "Source" field. Now the Problem is, that every time I save this question the automatic formatting destroys the code and makes the source look like the code below - if I save the question again (which I do frequently because of formulation details, etc.) the question does not work any more.
Code:
<ul> <li> {implode('', if(q1_1.NAOK == 'Y','</li> <li> q1_1.shown</li> <li> ',''), if(q1_2.NAOK == 'Y','</li> <li> q1_2.shown</li> <li> ',''), if(q1_3.NAOK == 'Y','</li> <li> q1_3.shown</li> <li> ',''), if(q1_4.NAOK == 'Y','</li> <li> q1_4.shown</li> <li> ',''), if(q1_5.NAOK == 'Y','</li> <li> q1_5.shown</li> <li> ',''), if(q1_6.NAOK == 'Y','</li> <li> q1_6.shown</li> <li> ',''))}</li> </ul>
Is there a way to preserve the code as it is and keep the editor from formatting it? I hope I did not overlook such a functionality.
Thanks for your time!
Best, G
Last edit: 6 years 7 months ago by socius. Reason: Added a salutation and an intro :-) - and finally a subject
The topic has been locked.
- LouisGac
- Visitor
6 years 7 months ago #158238
by LouisGac
Replied by LouisGac on topic Keep question editor from changing formatted question text entered in sourcemode
in your account setting, you can disable HTML mode for editor
The topic has been locked.
- socius
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 103
- Thank you received: 5
6 years 7 months ago #158241
by socius
Replied by socius on topic Keep question editor from changing formatted question text entered in sourcemode
Hi @LouisGac
Thank you! That works well - it seems I can't have it all (preservation of code with some formatting and html-editor), right? Or could I use something like a wrapper around the code that keeps the editor from to adding tags (which is actually really nice - but just not in this case).
Best, G
Thank you! That works well - it seems I can't have it all (preservation of code with some formatting and html-editor), right? Or could I use something like a wrapper around the code that keeps the editor from to adding tags (which is actually really nice - but just not in this case).
Best, G
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
6 years 7 months ago #158247
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Keep question editor from changing formatted question text entered in sourcemode
Unfortunately, as far as I know, not without disabling the editor.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: socius
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
6 years 7 months ago #158248
by DenisChenu
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.
Replied by DenisChenu on topic Keep question editor from changing formatted question text entered in sourcemode
Set HTML editor in popup. Clearly : i really think it's always the best option.
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.
The following user(s) said Thank You: socius
The topic has been locked.
- socius
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 103
- Thank you received: 5
6 years 7 months ago #158251
by socius
Replied by socius on topic Keep question editor from changing formatted question text entered in sourcemode
Thanks to @tpartner and @DenisChenu!
Yes, I also think that the popup html-editor works best - the code stays untouched if I do not explicitly call the html-editor and in case I have to, I just copy the sensitive parts before calling it and put them back in afterwards.
Thanks for your help!
Best, G
Yes, I also think that the popup html-editor works best - the code stays untouched if I do not explicitly call the html-editor and in case I have to, I just copy the sensitive parts before calling it and put them back in afterwards.
Thanks for your help!
Best, G
The topic has been locked.