Fixed
Details
Details
Priority
Affects versions
Fix versions
Components
Assignee
David Bauer
David BauerReporter
David Bauer
David BauerCreated September 25, 2017 at 10:55 AM
Updated April 17, 2018 at 8:26 AM
Resolved September 26, 2017 at 10:06 AM
There appears to be a regression caused by the switch to BigDecimal in calculated questions (SAM-3227).
Calling BigDecimal.divide without a rounding mode specified will throw an ArithmeticException if the result of the division cannot be truly represented without rounding e.g. the answer is a repeating decimal 0.333333....
Samigo doesn't catch the ArithmeticException so the result is a "500: Unknown Error" when trying to save.
It looks like simply setting a rounding mode and the number of decimal places needed for the division fixes the issue.