Permalink
Browse files

MDL-28103 code to deal with missing question_attempts was buggy.

  • Loading branch information...
timhunt committed Jul 1, 2011
1 parent e793379 commit 1645ad22d8adf15dff5913bb534d884c5c04f873
Showing with 2 additions and 1 deletion.
  1. +1 −1 question/engine/upgrade/behaviourconverters.php
  2. +1 −0 question/engine/upgrade/upgradelib.php
@@ -112,7 +112,7 @@ protected function create_missing_first_step() {
$step->state = 'todo';
$step->data = array();
$step->fraction = null;
- $step->timecreated = $this->attempt->timestart;
+ $step->timecreated = $this->attempt->timestart ? $this->attempt->timestart : time();
$step->userid = $this->attempt->userid;
$this->qtypeupdater->supply_missing_first_step_data($step->data);
return $step;
@@ -209,6 +209,7 @@ protected function convert_quiz_attempt($quiz, $attempt, moodle_recordset $quest
question {$questionid} in attempt {$attempt->id} at quiz
{$attempt->quiz}, since the session was missing.", $attempt->id);
try {
+ $question = $this->load_question($questionid, $quiz->id);
$qas[$questionid] = $this->supply_missing_question_attempt(
$quiz, $attempt, $question);
} catch (Exception $e) {

0 comments on commit 1645ad2

Please sign in to comment.