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

Cron task never finishes. Gets to line 'Looking for quiz overdue quiz attempts between Wednesday, 31 December 1969, 6:00 PM...' then never advances

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3
    • 2.3.1
    • Quiz

    Description

      Recent upgrade to Moodle 2.3. Set 'When time expires' to 'open attempts are submitted automatically'.

      The cron job has been allowed to run for ~four hours and does not advance. As you trace it, the problem seems to hit an endless loop in 'question/engine/questionusage.php' in the loop (line 716):

      while ($record && $record->qubaid == $qubaid && !is_null($record->slot)) {
      $quba->questionattempts[$record->slot] =
      question_attempt::load_from_records($records,
      $record->questionattemptid, $quba->observer,
      $quba->get_preferred_behaviour());
      if ($records->valid())

      { $record = $records->current(); }

      else

      { $record = false; }

      }

      When I have it spit out the value of '$record', it seems to end up in an endless loop caused by a missing question. It never leaves this loop. It sets $record to the same value forever, never able to leave the loop.

      stdClass Object
      (
      [qubaid] => 26856
      [contextid] => 15506
      [component] => mod_quiz
      [preferredbehaviour] => adaptivenopenalty
      [questionattemptid] => 257042
      [questionusageid] => 26856
      [slot] => 12
      [behaviour] => adaptivenopenalty
      [questionid] => 0
      [variant] => 1
      [maxmark] => 1.0000000
      [minfraction] => 0.0000000
      [flagged] => 0
      [questionsummary] => This question is missing. Unable to display anything.
      [rightanswer] =>
      [responsesummary] =>
      [timemodified] => 0
      [attemptstepid] =>
      [sequencenumber] =>
      [state] =>
      [fraction] =>
      [timecreated] =>
      [userid] =>
      [name] =>
      [value] =>
      )

      It seems like the loop needs a check for missing questions.

      Let me know if I can provide further information. Seems to be the same problem as: http://moodle.org/mod/forum/discuss.php?d=205668

      Attachments

        1. mdl_quiz_attempts.csv
          299 kB
        2. mdl_quiz_attempts.csv
          299 kB
        3. mdl_quiz_attempts.csv
          299 kB
        4. mdl_quiz_attempts.sql
          282 kB
        5. query.txt
          2 kB
        6. query.txt
          2 kB

        Issue Links

          Activity

            People

              timhunt Tim Hunt
              mulroony Patrick Mulrooney
              Dan Poltawski Dan Poltawski
              Adrian Greeve Adrian Greeve
              Tim Hunt, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                9/Jul/12