Suppose a problem has an answer like 1/2 min. If you use parserNumberWithUnits.pl, it won't keep the fraction form, and that is important in a certain pedagogical context I am working with.
So I tried something like this, combining parserFormulaWithUnits.pl and contextFraction.pl.
DOCUMENT();
loadMacros(qw(PGstandard.pl PGML.pl parserFormulaWithUnits.pl contextFraction.pl));
Context("Fraction");
$answer = FormulaWithUnits("1/2 min");
BEGIN_PGML
Enter [|1/2 min|]*.
[_]{$answer}{16}
END_PGML
ENDDOCUMENT();
And submitting the correct answer, it is not accepted as correct. I think #1107 might make this moot, in that it could offer a better way to have a fraction with units. Also, it looks like I can accomplish what I want with FormulaWithUnits and Numeric context where I set reduceConstants to 0. But this did seem like a possible bug to report.
Suppose a problem has an answer like
1/2 min. If you useparserNumberWithUnits.pl, it won't keep the fraction form, and that is important in a certain pedagogical context I am working with.So I tried something like this, combining
parserFormulaWithUnits.plandcontextFraction.pl.And submitting the correct answer, it is not accepted as correct. I think #1107 might make this moot, in that it could offer a better way to have a fraction with units. Also, it looks like I can accomplish what I want with
FormulaWithUnitsandNumericcontext where I setreduceConstantsto 0. But this did seem like a possible bug to report.