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

Question engine: sometimes step data is a string, and sometimes an int

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.6.3
    • 3.7
    • Questions

    Description

      If, as in, qtype_multichoice, get_expected_data() says that some expected data is PARAM_INT, then when handling the request where the data is submitted, the value will be in int.

      However, later, once the data has been saved to the database, and loaded back (for example when re-grading the attempt) it will be treated as a string.

      If question types are using === to compare resonses, this could lead to very subtle bugs.

      It would be better if the value was consistently a string always.

      Attachments

        Issue Links

          Activity

            People

              timhunt Tim Hunt
              timhunt Tim Hunt
              Simey Lameze Simey Lameze
              Andrew Lyons Andrew Lyons
              CiBoT CiBoT
              Safat Shahin, Tim Hunt, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                20/May/19

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 45 minutes
                  45m