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

inconsitent constant types in questionlib.php

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.8.8, 1.9.4
    • 1.8.9, 1.9.5
    • Quiz
    • None
    • any
    • MOODLE_18_STABLE, MOODLE_19_STABLE
    • MOODLE_18_STABLE, MOODLE_19_STABLE

    Description

      The constants in questionlib.php (http://cvs.moodle.org/moodle/lib/questionlib.php?annotate=1.189#l26) are defined as strings.

      However, in questiontype.php (http://cvs.moodle.org/moodle/question/type/questiontype.php?annotate=1.123#l1175) it is expected to be an integer ($state->event is an integer and it's using "!=="). As a result, line 1175 evaluates to true, even though the quiz is over and it should be false. If we don't know what types we will get from the database, then change !== to !=.

      Attachments

        Activity

          People

            timhunt Tim Hunt
            trick Alan Trick
            Jérôme Mouneyrac Jérôme Mouneyrac
            Tim Hunt, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              13/May/09