
Type: Bug

Status: CLOSED

Priority: Major

Resolution: Fixed

Affects Version/s: 12.0

Fix Version/s: 11.5 [Tentative], 12.0, 19.0

Component/s: Tests & Quizzes (Samigo)

Labels:None

12 status:Resolved

11 status:Resolved

Previous Issue Keys:SAM3258

Test Plan:
There appears to be a regression caused by the switch to BigDecimal in calculated questions (SAM3227).
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.
 depends on

SAK35348 Calculated questions' automatic scientific notation conversion threshold too low
 CLOSED
 is related to

SAK34217 samigo: Calculated Question  Confusing error message when variable is included in division
 OPEN
 relates to

SAK37112 Bug with calculated question's upper threshold on converting to scientific notation
 Verified