[SAK-36586] Use mxParser library instead of SamigoExpressionParser for calculated questions Created: 18-Dec-2017  Updated: 17-Apr-2018  Resolved: 02-Jan-2018

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:
Depend
is depended on by SAK-33810 Update documentation for calculated q... RESOLVED
depends on SAK-35348 Calculated questions' automatic scien... CLOSED
depends on SAK-32707 NumberFormatException: For input stri... Verified
12 status: Resolved
11 status: Resolved
Previous Issue Keys: SAM-3330
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)/(1-1/(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)/(1-1/(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.23E-16

tan(PI) previously calculated as -1.23E-16

Github repo:
https://github.com/redbito/MathParser.org-mXparser

License is BSD 2



 Comments   
Comment by Neal Caidin [ 09-Jan-2018 ]

Verified on Sakai - 4149f3ce1 - Sakai 13-SNAPSHOT - Server ip-172-31-6-159 

nightly master mysql QA server

Setting to critical priority since it can affect grades. 

 

Comment by Matthew Jones [ 09-Jan-2018 ]

Merged this to 12.x. Will need a little manual code resolution to get this into 11.

Generated at Mon Sep 16 16:30:40 CDT 2019 using Jira 8.0.3#800011-sha1:073e8b433c2c0e389c609c14a045ffa7abaca10d.