Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-4753

Numerical qtype: Recognize more number formats and expression

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 2.1
    • Questions
    • All
    • MOODLE_21_STABLE

      I would like the choices: ”strict national” ”generous” with option “accept expressions”

      Strict: 3,000.50 (US) or 3.000,50 (Sweden); etc

      Generous: all strict variants plus “3 000.50” or “3 000,50” (I’d like to add 3,0005E+3 3,0005*10^3 even 3000½)

      Expressions: 3E3+12/2

      I’ve used a numerical tutorial quiz written in PERL to which I added a reg expression filter to process the input string before evaluating it numerically. I’m not sure what numerical formats PHP uses natively but for perl I used:

      , becomes . (this would make problems with thousands separators unless it checked first for both) ^ becomes ** E becomes 10* and even ½ becomes .5 (though it would be good to warn students that it’s not a good idea to use ½.)

      Another possibility would be to have a filtering choice in the individual question before processing the answer string which could have simple: make [,] become [.] or maybe even som reg exp possibility.

      It would be good to have a JavaScript warning when users try to use characters that will make problems (not be understood).

            Unassigned Unassigned
            imported Imported (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.