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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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:

      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));

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            timhunt 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
            timhunt 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
            timhunt Tim Hunt added a comment -

            Oops! I nearly forgot about this.

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

            Thanks Tim,
            Integrated to 23_STABLE and master.

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

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

            Show
            andyjdavis Andrew Davis added a comment - Ive raised the trivial bug MDL-34164 but otherwise this works fine. Passing.
            Hide
            samhemelryk 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
            samhemelryk 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:
                  Fix Release Date:
                  9/Jul/12