Hi Markus
Ah yes, of course. I misunderstood - or perhaps forgot - the purpose of your ___textareaid___ macro.
I've pulled your change into Master and also into the development branch I'm working on. I've added the following documentation - please check if it's correct.
=======================
The textareaid macro
A problem arises if the HTML supplied by the question author contains elements with explicit id attributes, as might be required if there is also JavaScript present that needs to refer to the new elements. If the review options allow display of the question author's answer then when the student reviews their quiz, the student answer and the author's answer will both include the new elements, resulting in a conflict of id. Apart from being invalid HTML, this is likely to result in wrong results when any JavaScript code referencing the elements runs.
A workaround for this problem is to include the special macro string
___textareaid___
as part of any new ids. Note that there are THREE (3) underscores at both the start and end of the macro string.
When the HTML UI inserts the global extra html into the question, that macro is replaced everywhere by the actual ID of the answer box's text-area, which is different for the student and author answers. This technique can also be used to ensure that the names given to elements like radio buttons are different in the two answers.
Thanks Markus Gafner for this workaround.
========================I did think of wrapping the inserted HTML in a form to prevent cross-contamination of radio button names between the student and author answers, but the HTML5 standard doesn't allow forms to be nested and entire quiz review page is wrapped in a form. I don't wish to create illegal HTML or depend on unspecified and possibly browser-dependent behaviour.
Thanks for the contribution
Richard