WeBWorK Main Forum

MathQuill units issue (not the parentheses one!)

MathQuill units issue (not the parentheses one!)

by Spencer Bagley -
Number of replies: 2

Hi webwork friends,

I bumped into the following surprising MathQuill units issue today. The problem /Library/LoyolaChicago/Precalc/Chap6Sec1/Q28.pg asks you to enter a couple of things as numbers with units, and a couple of the things it wants are temperatures in Celsius, for which the correct unit is "degC". This is enforced by the answer checker in the following way:

ANS(NumberWithUnits("$mid","degC")->cmp() );

So then the issue is that if a student types in literally "degC", MathQuill renders "deg" into some internal representation of "degree", but then thinks that you are multiplying by the literal "C".

The usual workaround of clicking into text mode works fine (with the usual caveats). I just wonder if there's a way to get the NumberWithUnits parser to recognize "deg C" as equivalent to "degC", or to get MathQuill to recognize that "degC" is in itself a units string in certain contexts.

Thanks!
Spencer

In reply to Spencer Bagley

Re: MathQuill units issue (not the parentheses one!)

by Glenn Rice -

I assume you are using a version of WeBWorK prior to version 2.18.

All I can tell you is that this issue has been fixed for WeBWorK 2.18.  If you type "deg" in a MathQuill answer box it turns into a degree symbol for WeBWorK 2.18 and submits that to webwork as the unicode degree symbol °.  Furthermore, WeBWorK now accepts °C for degC where the degree symbol in that is the unicode degree symbol.  Similarly °F is accepted for degF.

This was discussed elsewhere in this forum before the 2.18 release which led to the fix.

In reply to Glenn Rice

Re: MathQuill units issue (not the parentheses one!)

by Spencer Bagley -
Ah, yep, I'm on 2.17. Thanks for the update, and sorry I wasn't able to search up those posts on my original forum trawl!