drlippman / IMathAS

IMathAS Online Math Assessment
Other
112 stars 99 forks source link

support for percent as a unit #282

Closed nick-chura closed 3 years ago

nick-chura commented 3 years ago

Added support for "%" and "percent" as a unit, acting only as a numerical factor.

Example: $answer = "5 percent" will accept "5%" or "5 percent"

Not sure if you think there should be any other checks for where "percent" is used. As it sits, since these are now proper units, one may even type "0.05 hectopercent" or even "500 percent^2". Unlikely as those are, they also seem correct(ish), so I don't know how I feel about needing to produce error messages.