PREP 2014 Question Authoring - Archived

How are mathematical expressions displayed with radio button options?

Re: How are mathematical expressions displayed with radio button options?

by Davide Cervone -
Number of replies: 0
The RadioButton object doesn't supper math in its entries. The reason is that the button text is used as the value of the button (in the HTML that is produced) and math would mess that up. In addition, the object has to produce both a text version and a TeX version for the result table, and that is much more complicated if you can mix math and text.

The reason you are seeing the results that you are is that commands are performed before math is processed within BEGIN_TEXT/END_TEXT, so after the RadioButton menu is inserted into the problem, with something like

  <input type="radio button" value="\(\frac{2x}{3x}\)"> \(\frac{2x}{3x}
both copies of the math are processed, and that inserted HTML into the value attribute, which is illegal, and it turns out that it ends the <input> element early, leaving part of the rest of the HTML as plain text rather than tags. This is why you see things like "> or [math] with a second copy of the math.

I will need to see what I can do with the RadioButton object to improve the situation, but haven't had the chance to work on it yet.