ndunand / moodle-qtype_matrix

Source code of https://moodle.org/plugins/qtype_matrix
2 stars 10 forks source link

Import / Export as XML fails due to lack of HTML escaping in the items' text #65

Open a-kempka opened 8 months ago

a-kempka commented 8 months ago

When I export a kprime question containing HTML-tags in the items (inside <row><shortext>) as Moodle-XML the HTML is not escaped. Upon importing the XML as another question, the import fails or the items are imported as the text "Array".

For example an item like <span class="myclass"> is not escaped.

Manually escaping the HTML as <![CDATA[ ... ]]> fixes the problem.

Could you please implement proper escaping in the items? The <questiontext><text> is escaped properly.