Skip to content

Fraction context and FormulaWithUnits #1137

Open
@Alex-Jordan

Description

@Alex-Jordan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions