Permalink
Browse files

MDL-29758 make Cloze question feedback display more informative

as it was in Moodle 1.9
  • Loading branch information...
1 parent 43ded67 commit da4bd770f2bb9dafb8aa6214a848265ff8e6dbbe Jean-Michel Vedrine committed Apr 22, 2013
Showing with 10 additions and 1 deletion.
  1. +10 −1 question/behaviour/adaptive/behaviour.php
@@ -70,10 +70,19 @@ public function get_right_answer_summary() {
}
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;
+
}
}

0 comments on commit da4bd77

Please sign in to comment.