Merge branch 'MDL-29772-21' of git://github.com/bostelm/moodle into MOODLE_21_STABLE

This commit is contained in:
Aparup Banerjee
2011-12-13 17:07:56 +08:00
2 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -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;
@@ -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));