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

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

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.6.3
    • Fix Version/s: 3.7
    • Component/s: Questions
    • Labels:

      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

              Assignee:
              timhunt Tim Hunt
              Reporter:
              timhunt Tim Hunt
              Peer reviewer:
              Simey Lameze
              Integrator:
              Andrew Nicols
              Tester:
              CiBoT
              Participants:
              Component watchers:
              Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                20/May/19

                  Time Tracking

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