From 7df5ccc871b63d0a1022430dff68358d6ebc5823 Mon Sep 17 00:00:00 2001 From: vyshane Date: Thu, 15 Feb 2007 06:05:01 +0000 Subject: [PATCH] Fix for MDL-8072 - 'In the "Quiz" activity with the "Adaptive Mode" on, the "Multiple Choice" a message informing the student was penalized with the Penalty Factor is displayed when the answer given by the student is correct.' --- question/type/questiontype.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/question/type/questiontype.php b/question/type/questiontype.php index 9ebda4c79cd..53a7f8fab5f 100644 --- a/question/type/questiontype.php +++ b/question/type/questiontype.php @@ -705,7 +705,9 @@ class default_questiontype { } // print info about new penalty // penalty is relevant only if the answer is not correct and further attempts are possible - if (($state->last_graded->raw_grade < $question->maxgrade) and (QUESTION_EVENTCLOSEANDGRADE !== $state->event)) { + if (($state->last_graded->raw_grade < $question->maxgrade / 1.01) + and (QUESTION_EVENTCLOSEANDGRADE !== $state->event)) { + if ('' !== $state->last_graded->penalty && ((float)$state->last_graded->penalty) > 0.0) { // A penalty was applied so display it echo ' ';