Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.4, 2.3.1, 2.4
    • Fix Version/s: 2.2.5, 2.3.2
    • Component/s: Quiz
    • Labels:
    • Testing Instructions:
      Hide

      [If a tester with php 5.4 can be found, this would be best, but regression testing on <5.4 is also sufficient]

      1. For a quiz with attempts, go to Results -> Grades in the navigation.

      2. Verify that the graph at the bottom of the page appears.

      Show
      [If a tester with php 5.4 can be found, this would be best, but regression testing on <5.4 is also sufficient] 1. For a quiz with attempts, go to Results -> Grades in the navigation. 2. Verify that the graph at the bottom of the page appears.
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      Matthew Davidson reported in MDL-34164:

      After some testing, the problem seems to be with the line in reportlib.php, function quiz_report_grade_bands():

      unset($data[$bands]);

      There is definitely a PHP 5.4 issue here. I have made a small script to show this issue. I'll submit it to PHP to get this fixed. It has something to do with how $bands or $foo in this case is cast. It starts as a string, then becomes a double, but something is wrong with it because if you cast the variable as anything the unset() statement will work as intended. Event casting it as a double works:

      $test = array("5"=>"bar");
      $foo = "10.0000"; // gettype($foo) = "string"
      $foo /= 2; //Makes $foo = 5 but still gettype($foo) = "double"
      echo gettype($foo);
      unset($test[$foo]);

      However, if Moodle would like to be proactive in this, it could be fixed on your end by casting the variable $bands like so...

      unset($data[(int) $bands]);

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    10/Sep/12