Moodle
  1. Moodle
  2. MDL-33048

Quiz with a close time causes a Fatal Error on MyMoodle

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3
    • Component/s: My home, Quiz
    • Labels:
      None
    • Environment:
      Apache2, php5, mysql5.5
    • Database:
      MySQL
    • Testing Instructions:
      Hide

      You need a course with quizzes with closing time set but with the closing time not passed, and you need a student user enrolled in that course who has attempted some quizzes.

      Logged in as that student, go to the My Moodle page.

      Show
      You need a course with quizzes with closing time set but with the closing time not passed, and you need a student user enrolled in that course who has attempted some quizzes. Logged in as that student, go to the My Moodle page.
    • Workaround:
      Hide

      Disable the quiz close time, or hide the quiz from view

      Show
      Disable the quiz close time, or hide the quiz from view
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      40228

      Description

      An open quiz with a closing time set causes the following debug error on an enrolled student's MyMoodle page:

      Fatal error: Class 'quiz_attempt' not found in /var/www/moodle/mod/quiz/lib.php on line 496

      This prevents the page from rendering any blocks, so the student is unable to navigate, and can only log out.

        Issue Links

          Activity

          Hide
          Michael de Raadt added a comment -

          I was able to reproduce this in master.

          Show
          Michael de Raadt added a comment - I was able to reproduce this in master.
          Hide
          Chad Bergeron added a comment - - edited

          Adding the link to locallib also requires pulling in global $CFG on line 486

          But with that variable scoped in, the issue is resolved in my testing.

          Show
          Chad Bergeron added a comment - - edited Adding the link to locallib also requires pulling in global $CFG on line 486 But with that variable scoped in, the issue is resolved in my testing.
          Hide
          Tim Hunt added a comment -

          Doh! sorry. Tim === idiot. Commit amended.

          Show
          Tim Hunt added a comment - Doh! sorry. Tim === idiot. Commit amended.
          Hide
          Dan Poltawski added a comment -

          I've integrated this now

          Show
          Dan Poltawski added a comment - I've integrated this now
          Hide
          Dan Poltawski added a comment -

          And tested during the integration.

          (Note: I had to look at the code to work out what the quiz setup needed to be to reproduce the error before testing )

          Show
          Dan Poltawski added a comment - And tested during the integration. (Note: I had to look at the code to work out what the quiz setup needed to be to reproduce the error before testing )
          Hide
          Eloy Lafuente (stronk7) added a comment -

          U P S T R E A M I Z E D !

          Many thanks for the hard work, closing this as fixed.

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - U P S T R E A M I Z E D ! Many thanks for the hard work, closing this as fixed. Ciao

            People

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

              Dates

              • Created:
                Updated:
                Resolved: