diff --git a/question/type/ddmarker/lang/en/qtype_ddmarker.php b/question/type/ddmarker/lang/en/qtype_ddmarker.php index 4ed2e888a61..8bf6b42f6da 100644 --- a/question/type/ddmarker/lang/en/qtype_ddmarker.php +++ b/question/type/ddmarker/lang/en/qtype_ddmarker.php @@ -42,7 +42,7 @@ $string['dropzone'] = 'Drop zone {$a}'; $string['dropzoneheader'] = 'Drop zones'; $string['editingddmarker'] = 'Editing drag and drop markers'; $string['followingarewrong'] = 'The following markers have been placed in the wrong area : {$a}.'; -$string['followingarewrongandhighlighted'] = 'The following markers need to be placed in the correct area : {$a}. The areas they should have been placed in are shown above.
Click on the markers above to see the areas they should have been placed in highlighted.'; +$string['followingarewrongandhighlighted'] = 'The following markers were not placed in the correct area : {$a}. The areas they should have been placed in are shown above.
Click on the markers above to see the areas they should have been placed in highlighted.'; $string['formerror_nobgimage'] = 'You need to select an image to use as the background for the drag and drop area.'; $string['formerror_noitemselected'] = 'You have specified a drop zone but not chosen a marker that must be dragged to the zone'; $string['formerror_nosemicolons'] = 'There are no semicolons in your coordinates string. Your coordinates for a {$a->shape} should be expressed as - {$a->coordsstring}.'; diff --git a/question/type/ddmarker/question.php b/question/type/ddmarker/question.php index 20cca84915e..0b6eb5fc82f 100644 --- a/question/type/ddmarker/question.php +++ b/question/type/ddmarker/question.php @@ -71,8 +71,9 @@ class qtype_ddmarker_question extends qtype_ddtoimage_question_base { return $vars; } public function is_complete_response(array $response) { - foreach ($this->choices[1] as $choice => $notused) { - if ('' != trim($response[$this->choice($choice)])) { + foreach ($this->choices[1] as $choiceno => $notused) { + if (isset($response[$this->choice($choiceno)]) + && '' != trim($response[$this->choice($choiceno)])) { return true; } } @@ -352,7 +353,8 @@ class qtype_ddmarker_question extends qtype_ddtoimage_question_base { $goodhits = array(); foreach ($this->places as $placeno => $place) { if (isset($hits[$placeno])) { - $choice = $this->choices[$this->get_right_choice_for($placeno)]; + $shuffledchoiceno = $this->get_right_choice_for($placeno); + $choice = $this->get_selected_choice(1, $shuffledchoiceno); $goodhits[] = "{".$place->summarise()." -> ". $choice->summarise(). "}"; } } diff --git a/question/type/ddmarker/renderer.php b/question/type/ddmarker/renderer.php index 56e35804426..d2b3d4e9413 100644 --- a/question/type/ddmarker/renderer.php +++ b/question/type/ddmarker/renderer.php @@ -131,6 +131,7 @@ class qtype_ddmarker_renderer extends qtype_ddtoimage_renderer_base { } protected function hint(question_attempt $qa, question_hint $hint) { + $output = ''; $question = $qa->get_question(); $response = $qa->get_last_qt_data(); if ($hint->statewhichincorrect) {