Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-41001

This kind of math expression "sin(+(1.2))" in a calculated question breaks Sakai

    XMLWordPrintable

Details

    • Bug
    • Status: Verified
    • Major
    • Resolution: Fixed
    • 12.5, 19.0, 20.0
    • 12.6, 19.0, 20.0
    • None
    • Merged
    • Merged
    • Hide

      1. Create a new assessment.

      2. Add this calculated question to the assessment:

      Question text: "{{x}} {a}"
      
      Var {a} => values from 1 to 2
      
      Formula x => "sin(+({a}))"
      

      3. Try to save the question. It works ok.

      Show
      1. Create a new assessment. 2. Add this calculated question to the assessment: Question text: "{{x}} {a}" Var {a} => values from 1 to 2 Formula x => "sin(+({a}))" 3. Try to save the question. It works ok.

    Description

      Steps to reproduce the issue:

      1. Create a new assessment.

      2. Add this calculated question to the assessment:

      Question text: "{{x}} {a}"
      
      Var {a} => values from 1 to 2
      
      Formula {{x}} => "sin(+({a}))"
      

      3. Try to save the question. This action breaks Sakai. You need to reload the page to continue.

      The problem is in this line: "e.calculate()" from "org.sakaiproject.tool.assessment.util.SamigoExpressionParser.parse(String, int)" because the method "org.mariuszgromada.math.mxparser.Expression.calculate()" does not work when it tries to parse this kind of expression: "sin(+(1.2))".

      Gliffy Diagrams

        Zeplin

          Attachments

            Activity

              People

                bergarvi Bernardo Garcia Vila
                raulsv Raúl Sánchez Vegas
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Git Integration