Numbas icon indicating copy to clipboard operation
Numbas copied to clipboard

Substitute variables into the alt attribute without eval-alt

Open christianp opened this issue 2 years ago • 4 comments

In HTML which has JME values substituted into it, such as the question statement, you can set an attribute on a tag from a JME expression by adding eval- to the attribute name.

For example, in

<p eval-class="{classname}"></p>

the class attribute will use the value of the classname question variable.

For images, the alt attribute is set by the rich text editor, but it'd be nice to have it sub in variable values instead.

So, in DOMcontentsubber.sub_element, I think that the attribute alt should have the same behaviour as attributes matching the regex eval-(.*)

christianp avatar Jun 27 '22 19:06 christianp

Can I try for this issue?

lawrencetheabhorrence avatar Jun 30 '22 03:06 lawrencetheabhorrence

@lawrencetheabhorrence thanks for offering! Please have a look at our guide on contributing to Numbas, and instructions on setting up a development environment

christianp avatar Jul 05 '22 10:07 christianp

I see that this issue has been open for quite a while. So is it ok if I take this up?

prakha avatar Sep 03 '22 15:09 prakha

Hi @prakha thanks for offering! Yes, please have a go at this.

christianp avatar Sep 20 '22 12:09 christianp