Skip to content

Commit

Permalink
Merge branch 'MDL-70422-310' of https://github.com/paulholden/moodle
Browse files Browse the repository at this point in the history
…into MOODLE_310_STABLE
  • Loading branch information
sarjona committed Dec 15, 2020
2 parents e7a53e9 + c8e335f commit cc87756
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions backup/tests/quiz_restore_decode_links_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,17 @@ public function test_restore_quiz_decode_links() {

$newcm = duplicate_module($course, get_fast_modinfo($course)->get_cm($quiz->cmid));

$sql = "SELECT qa.answer
$sql = "SELECT qa.id, qa.answer
FROM {quiz} q
LEFT JOIN {quiz_slots} qs ON qs.quizid = q.id
LEFT JOIN {question_answers} qa ON qa.question = qs.questionid
WHERE q.id = :quizid";
$params = array('quizid' => $newcm->instance);
$answers = $DB->get_fieldset_sql($sql, $params);
$this->assertEquals($CFG->wwwroot . '/course/view.php?id=' . $course->id, $answers[0]);
$this->assertEquals($CFG->wwwroot . '/mod/quiz/view.php?id=' . $quiz->cmid, $answers[1]);
$this->assertEquals($CFG->wwwroot . '/grade/report/index.php?id=' . $quiz->cmid, $answers[2]);
$this->assertEquals($CFG->wwwroot . '/mod/quiz/index.php?id=' . $quiz->cmid, $answers[3]);
$answers = $DB->get_records_sql_menu($sql, $params);

$this->assertEquals($CFG->wwwroot . '/course/view.php?id=' . $course->id, $answers[$firstanswer->id]);
$this->assertEquals($CFG->wwwroot . '/mod/quiz/view.php?id=' . $quiz->cmid, $answers[$secondanswer->id]);
$this->assertEquals($CFG->wwwroot . '/grade/report/index.php?id=' . $quiz->cmid, $answers[$thirdanswer->id]);
$this->assertEquals($CFG->wwwroot . '/mod/quiz/index.php?id=' . $quiz->cmid, $answers[$fourthanswer->id]);
}
}

0 comments on commit cc87756

Please sign in to comment.