numbas / Numbas

A completely browser-based e-assessment/e-learning system, with an emphasis on mathematics
http://www.numbas.org.uk
Apache License 2.0
198 stars 118 forks source link

Use an <output> tag for the JME part preview #997

Closed christianp closed 10 months ago

christianp commented 1 year ago

Who knew there's an <output> tag?

Sukhendu2002 commented 1 year ago

Hey @christianp, Can you elaborate on it more, I want to work on this

christianp commented 1 year ago

The template in the default theme for the 'mathematical expression' part type (known as 'jme' in code) contains a <span class="jme-preview"> tag, which contains another span marked with aria-live containing a rendering of the student's answer. I think that that <span aria-live> tag could instead be an <output> tag, which the browser will automatically mark as aria-live. The <output> tag should really have a for attribute referring to the corresponding input, but at the moment we don't give id attributes to part inputs. We should do this - the part's path combined with the question number will be a unique identifier.