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]
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