From da4bd770f2bb9dafb8aa6214a848265ff8e6dbbe Mon Sep 17 00:00:00 2001 From: Jean-Michel Vedrine Date: Mon, 22 Apr 2013 20:41:57 +0200 Subject: [PATCH] MDL-29758 make Cloze question feedback display more informative as it was in Moodle 1.9 --- question/behaviour/adaptive/behaviour.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/question/behaviour/adaptive/behaviour.php b/question/behaviour/adaptive/behaviour.php index 84bcd0b7c88..b2f25d88f47 100644 --- a/question/behaviour/adaptive/behaviour.php +++ b/question/behaviour/adaptive/behaviour.php @@ -70,10 +70,19 @@ class qbehaviour_adaptive extends question_behaviour_with_save { } public function adjust_display_options(question_display_options $options) { + // Save some bits so we can put them back later. + $save = clone($options); + + // Do the default thing. parent::adjust_display_options($options); + + // Then, if they have just Checked an answer, show them the applicable bits of feedback. if (!$this->qa->get_state()->is_finished() && $this->qa->get_last_behaviour_var('_try')) { - $options->feedback = true; + $options->feedback = $save->feedback; + $options->correctness = $save->correctness; + $options->numpartscorrect = $save->numpartscorrect; + } }