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
197 stars 118 forks source link

Bracketing gets lost when substituting an expression variable into the expected answer for a mathematical expression part #1005

Closed christianp closed 1 year ago

christianp commented 1 year ago

An example.

There's a variable d = expression("a*b*c*d"), and a mathematical expression part whose answer is x/({d}). The bracketing is lost, so the displayed answer is (x/a)b*c*d.

If you define the whole expression as a variable and just use that, the display is better: x/(a*b*c*d).

christianp commented 1 year ago

This was the same problem as #1011 (and I even gave it pretty much the same name!)