openwebwork/pg — pull request #177 by dpvc (2014-12-01 17:18:10+00:00)
Title: Fix Compute() to create correct answer string from the parsed answer

Fix `Compute()` to use the stringified version of the original string for the correct answer, just like it does for the LaTeX string. This will make sure they are consistent (now that the LaTeX string is the one actually shown). This also fixes the problem of how to handle alternate formats like commas for decimal separator, and backward brackets for intervals.

Also update some of the documentation.

In the past, the string passed to `Compute()` was used directly as the correct answer, but this pull request changes that to be the stringified version of the parsed equation (without combining constants or adding extra parentheses). This was discussed in [this pull request](https://github.com/openwebwork/pg/pull/141#issuecomment-47999379). Note that an author who wants to override this can use

$ans = Compute("...")->with(correct_ans=>"...", correct_ans_latex_string=>"...");

to provide his or her own answer strings.