MDL-47494 ddmarker: Merge branch 'master' of git://github.com/jamiepratt/moodle-qtype_ddmarker

Conflicts:
	question.php
This commit is contained in:
Jamie Pratt
2011-11-18 18:37:57 +07:00
3 changed files with 7 additions and 4 deletions
@@ -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.<br />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.<br />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}.';
+5 -3
View File
@@ -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(). "}";
}
}
+1
View File
@@ -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) {