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

Quiz cron fatal error: Class 'completion_info' not found

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.8.5, 2.9.3, 3.0
    • 2.9.4, 3.0.2
    • Quiz
    • MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE
    • MOODLE_29_STABLE, MOODLE_30_STABLE
    • MDL-49758-master
    • Hide

      Manual tests

      1. As a teacher, create a quiz activity with the following settings:
        • Close the quiz: Enable (1 hour from current time)
        • When time expires: "Open attempts are submitted automatically"
        • Edit quiz and add one Essay question
      2. As a student, Attempt the quiz, answer the question and click next but do not submit the question
      3. From the database, modify the following columns to be past timestamps (1 day earlier):
        • quiz: timeclose
        • quiz_attempt: timecheckstate
      4. Run the cron
        Assert that there's no PHP error

      Unit tests

      1. Run mod_quiz unit tests :

        vendor/bin/phpunit --testsuite mod_quiz_testsuite
        

      Show
      Manual tests As a teacher, create a quiz activity with the following settings: Close the quiz: Enable (1 hour from current time) When time expires: "Open attempts are submitted automatically" Edit quiz and add one Essay question As a student, Attempt the quiz, answer the question and click next but do not submit the question From the database, modify the following columns to be past timestamps (1 day earlier): quiz: timeclose quiz_attempt: timecheckstate Run the cron Assert that there's no PHP error Unit tests Run mod_quiz unit tests : vendor/bin/phpunit --testsuite mod_quiz_testsuite

    Description

      When running cron from browser, received the following fatal error:

      Processing module function quiz_cron ...
      Looking for quiz overdue quiz attempts...
      Fatal error: Class 'completion_info' not found
      in mod/quiz/locallib.php on line 1639

      Workaround was to add the following lines to
      function quiz_attempt_submitted_handler($event)
      in "mod/quiz/locallib.php" (around line 1624),

      global $CFG
      require_once($CFG->dirroot.'/lib/completionlib.php');

      Attachments

        Activity

          People

            gaudreaj Jean-Philippe Gaudreau
            xxxxxxx Gordon Bateson
            Tim Hunt Tim Hunt
            David Monllaó David Monllaó
            Jun Pataleta Jun Pataleta
            Tim Hunt, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              11/Jan/16