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

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

    Details

    • 19 status:
      Resolved
    • 12 status:
      Resolved
    • Test Plan:
      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

          Attachments

          1. create_calc_q.gif
            15 kB
            Andrea Schmidt
          2. saved_calc_q.gif
            4 kB
            Andrea Schmidt

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Git Source Code