Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure saved correct answer has units in NumberWithUnits() #365

Merged
merged 1 commit into from
Jul 23, 2018

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Jul 22, 2018

This fixes a problem with NumberWithUnits() when passed a Real MathObject created by Compute() reported in this forum post.

To test, use

loadMacros("parserNumberWithUnits.pl");
$v = Compute("sqrt(23)");
$n = NumberWithUnits($v, "m/s");

BEGIN_TEXT
$n->{correct_ans} and \($n->{correct_ans_latex_string}\)
END_TEXT

With the patch, both values should include units; without the patch, they will just be the square root with no units.

@mgage mgage changed the base branch from develop to rel-PG-2.14 July 23, 2018 00:13
@mgage mgage merged commit aade52c into openwebwork:rel-PG-2.14 Jul 23, 2018
@dpvc dpvc deleted the fix-num-with-unit branch May 19, 2020 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants