Moodle
  1. Moodle
  2. MDL-34054

Can't access quiz reports (Using $this not in object context)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3.1
    • Component/s: Quiz
    • Labels:
    • Testing Instructions:
      Hide

      1. Create a quiz with review options set to no show Marks to students.
      2. Attempt the quiz as a student.
      3. As a teacher (not admin) try to view the quiz reports.

      Show
      1. Create a quiz with review options set to no show Marks to students. 2. Attempt the quiz as a student. 3. As a teacher (not admin) try to view the quiz reports.
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      42356

      Description

      I am not sure how to reproduce this bug, but try:

      1. Create a quiz, with a question and do not start/do any attempt
      2. Go to the gradebook and grade a student
      3. Go to the quiz and view the attempts
      Fatal error: Using $this when not in object context in /home/fred/www/repositories/stable_master/moodle/mod/quiz/report/reportlib.php on line 416 
      

      These are the lines in context:

          return quiz_has_grades($quiz) &&
                  ($reviewoptions->marks >= question_display_options::MARK_AND_MAX ||
                  has_capability('moodle/grade:viewhidden', $this->context));
      

        Issue Links

          Activity

          Hide
          Tim Hunt added a comment -

          Oops! clearly I screwed up in some of the re-factoring I tried to do for 2.3. I'll try to fix this today.

          Show
          Tim Hunt added a comment - Oops! clearly I screwed up in some of the re-factoring I tried to do for 2.3. I'll try to fix this today.
          Hide
          Tim Hunt added a comment -

          Oops! I nearly forgot about this.

          Show
          Tim Hunt added a comment - Oops! I nearly forgot about this.
          Hide
          Dan Poltawski added a comment -

          Thanks Tim,
          Integrated to 23_STABLE and master.

          Show
          Dan Poltawski added a comment - Thanks Tim, Integrated to 23_STABLE and master.
          Hide
          Andrew Davis added a comment -

          Ive raised the trivial bug MDL-34164 but otherwise this works fine. Passing.

          Show
          Andrew Davis added a comment - Ive raised the trivial bug MDL-34164 but otherwise this works fine. Passing.
          Hide
          Sam Hemelryk added a comment -

          Congratulations your code is upstream - gold star for you!

          This issue + 79 others made it in in time for the minor releases.
          Thank you everyone involved for your exuberant efforts.

          Show
          Sam Hemelryk added a comment - Congratulations your code is upstream - gold star for you! This issue + 79 others made it in in time for the minor releases. Thank you everyone involved for your exuberant efforts.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: