MDL-23540 improved matching question options and fixed displayed jumps

This commit is contained in:
Petr Skoda 2010-07-28 13:32:32 +00:00
parent cb2c196306
commit 0493240903

View File

@ -70,7 +70,7 @@ class lesson_page_type_matching extends lesson_page {
}
}
$responseoptions = array();
$responseoptions = array(''=>get_string('choosedots'));
if (!empty($responses)) {
shuffle($responses);
$responses = array_unique($responses);
@ -416,8 +416,7 @@ class lesson_page_type_matching extends lesson_page {
// The jumps for matching question type is stored
// in the 3rd and 4rth answer record.
$jumps = array();
$params = array ("lessonid" => $this->lesson->id, "pageid" => $this->properties->id);
if ($answers = $DB->get_records_select("lesson_answers", "lessonid = :lessonid and pageid = :pageid", $params, 'id', '*', '2', '2')) {
if ($answers = $DB->get_records("lesson_answers", array("lessonid" => $this->lesson->id, "pageid" => $this->properties->id), 'id', '*', 0, 2)) {
foreach ($answers as $answer) {
$jumps[] = $this->get_jump_name($answer->jumpto);
}