Escaping is inconsistent in text input answers

Description

I have a text input problem with "<P/2 M>" as expected result.

Now, when I use the studio to define the problem, I cannot get escaping right.
I have tried three alternatives in the <stringresponse answer="XXX" type="ci"> line:

  1.  

    this does not work because angle brackets must be escaped.

  2.  

    this accepts "<P/2 M>" as a valid input, but does not display correctly as an anwser (see below).

  3.  

    (double escape) this does render correctly as an answer, but accepts only "&amp;lt;P/2 M&amp;gt;" as a valid input.

At the moment, I use an additional_answer to get the advantage of 2. and 3.

With this I get one correctly displayed answer, and I accept the required input.
Of course, I also get a "Answer: <P/2 M> or " with an empty alternative, and my text input problem accepts "&amp;lt;P/2 M&amp;gt;" as an answer.

The issue is that answer="&amp;lt;P/2 M&amp;gt;" is rendered as "<p 2="" m=""></p>" by the internal html sanitizer.

As an example, this is how the answer for the above problem is rendered in html:

PS: Please bear with me, and forgive errors in this report. To encode "&amp;amp;lt;P/2 M&amp;amp;gt;", I had to write "&amp;amp;amp;lt;P/2 M&amp;amp;amp;gt;" ...
PS2: And to write the above sentence, I had to write... Well, you get the idea

Steps to Reproduce

<problem>
<!-- We need two different answers. -->
<!-- The first is escaped twice to ensure proper display in the "answer" section. -->
<!-- The second is escaped only once to match input from students. -->
<stringresponse answer="&amp;lt;P/2 M&amp;gt;" type="ci">
<additional_answer answer="&lt;P/2 M&gt;"/>
<label>What is printed with: {Browse M}</label>
<description>Try to answer by yourself and then use Mozart to see if the result is the one you expected.</description>
<textline size="20"/>
</stringresponse>
<solution>
<div class="detailed-solution">
<p>Explanation</p>
<p>We have browsed M, a procedure of 2 arguments.</p>
</div>
</solution>
</problem>

Current Behavior

None

Expected Behavior

None

Reason for Variance

None

Release Notes

None

User Impact Summary

None

Assignee

Unassigned

Reporter

Guillaume Maudoux

Labels

Reach

None

Impact

None

Platform Area

None

Customer

Partner Manager

None

URL

None

Contributor Name

None

Groups with Read-Only Access

None

Actual Points

None

Category of Work

None

Platform Map Area (Levels 1 &amp; 2)

None

Platform Map Area (Levels 3 &amp; 4)

None

Priority

Unset
Configure