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

inconsitent constant types in questionlib.php

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8.8, 1.9.4
    • Fix Version/s: 1.8.9, 1.9.5
    • Component/s: Quiz
    • Labels:
      None
    • Environment:
      any
    • Affected Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE
    • Fixed Branches:
      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 !=.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/May/09