diff --git a/question/behaviour/adaptive/renderer.php b/question/behaviour/adaptive/renderer.php index f5a984e91d9..34954d17885 100644 --- a/question/behaviour/adaptive/renderer.php +++ b/question/behaviour/adaptive/renderer.php @@ -88,7 +88,9 @@ class qbehaviour_adaptive_renderer extends qbehaviour_renderer { */ protected function penalty_info(question_attempt $qa, $mark, question_display_options $options) { - if (!$qa->get_question()->penalty) { + + $currentpenalty = $qa->get_question()->penalty * $qa->get_max_mark(); + if ($currentpenalty == 0) { return ''; } $output = ''; @@ -101,7 +103,7 @@ class qbehaviour_adaptive_renderer extends qbehaviour_renderer { // Print information about any new penalty, only relevant if the answer can be improved. if ($qa->get_behaviour()->is_state_improvable($qa->get_state())) { $output .= ' ' . get_string('gradingdetailspenalty', 'qbehaviour_adaptive', - format_float($qa->get_question()->penalty, $options->markdp)); + format_float($currentpenalty, $options->markdp)); } return $output; diff --git a/question/behaviour/adaptive/simpletest/testwalkthrough.php b/question/behaviour/adaptive/simpletest/testwalkthrough.php index 6a6e27c6b0d..e8f16f29c05 100644 --- a/question/behaviour/adaptive/simpletest/testwalkthrough.php +++ b/question/behaviour/adaptive/simpletest/testwalkthrough.php @@ -85,7 +85,7 @@ class qbehaviour_adaptive_walkthrough_test extends qbehaviour_walkthrough_test_b $this->get_contains_mc_radio_expectation(($wrongindex + 1) % 3, true, false), $this->get_contains_mc_radio_expectation(($wrongindex + 2) % 3, true, false), $this->get_contains_incorrect_expectation(), - $this->get_contains_penalty_info_expectation(0.33)); + $this->get_contains_penalty_info_expectation(1.00)); $this->assertPattern('/B|C/', $this->quba->get_response_summary($this->slot));