stemiwe / moodle-qformat_printout

Moodle question format plugin to print out questions for review
GNU General Public License v3.0
0 stars 1 forks source link

strip_tags may not be optimal for formatting output text #3

Closed mudrd8mz closed 5 years ago

mudrd8mz commented 5 years ago

When exporting the question name and text, the plugin seems to simply call strip_tags() on both the question name and the content.

This may not always lead to the expected result. For example, the HTML formatting may be essential to correctly understand the question.

There are also other cases - such as multilang strings. The question content can be defined such as

<p><span class="multilang" lang="en">English text</span><span class="multilang" lang="cs">Czech text</span></p>

and the quiz can have the multilang filter enabled. In this case, the export gets it as "English textCzech text".

I am not myself sure what would be the best behaviour. Just making sure it is reported as a potential issue.

stemiwe commented 5 years ago

yeah, i'm aware it might lead to issues, however, without it the format of multiple choice answers is broken too frequently, mostly by useless <p></p> tags inserted by atto.

i think the best right now is to leave it as it is and just put the information somewhere that html exporting is not supported.