[SAK36586] Use mxParser library instead of SamigoExpressionParser for calculated questions Created: 18Dec2017 Updated: 17Apr2018 Resolved: 02Jan2018 

Status:  Verified 
Project:  Sakai 
Component/s:  Tests & Quizzes (Samigo) 
Affects Version/s:  11.4, 12.0 
Fix Version/s:  11.5 [Tentative], 12.0, 19.0 
Type:  Bug  Priority:  Critical 
Reporter:  Sam Ottenhoff  Assignee:  Core Team 
Resolution:  Fixed  Votes:  0 
Labels:  math  
Remaining Estimate:  Not Specified  
Time Spent:  Not Specified  
Original Estimate:  Not Specified 
Issue Links: 


12 status:  Resolved  
11 status:  Resolved  
Previous Issue Keys:  SAM3330  
Test Plan:  In Samigo add a calculated question. More calculated questions should calculate correctly now. For example any trig method that includes sin(pi)* {x} or tan(pi)*{x}should be correct now. And examples should better respect order of operation like ( {x}*1000*3.8/1200)/(11/(1+3.8/1200)^360) 
Description 
The Calculated Question parser has problems. Here is a complex formula that should come up with 866.2 but custom SamigoExpressionParser comes up with 894: (185.9*1000*3.8/1200)/(11/(1+3.8/1200)^360)
Here are some simple examples from the current tests that also seem to be incorrect: sin(PI) previously calculated as 1.23E16 tan(PI) previously calculated as 1.23E16 Github repo: License is BSD 2 
Comments 
Comment by Neal Caidin [ 09Jan2018 ] 
Verified on Sakai  4149f3ce1  Sakai 13SNAPSHOT  Server ip172316159 nightly master mysql QA server Setting to critical priority since it can affect grades.

Comment by Matthew Jones [ 09Jan2018 ] 
Merged this to 12.x. Will need a little manual code resolution to get this into 11. 