Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 1645ad22d8adf15dff5913bb534d884c5c04f873 1 parent e793379
@timhunt timhunt authored
View
2  question/engine/upgrade/behaviourconverters.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;
View
1  question/engine/upgrade/upgradelib.php
@@ -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) {
Please sign in to comment.
Something went wrong with that request. Please try again.