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

Quiz cron fatal error: Class 'completion_info' not found

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.8.5, 2.9.3, 3.0
    • Fix Version/s: 2.9.4, 3.0.2
    • Component/s: Quiz
    • Labels:
    • Testing Instructions:
      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
    • Affected Branches:
      MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE, MOODLE_30_STABLE
    • Pull Master Branch:
      MDL-49758-master

      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

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/Jan/16