From: tjhunt Date: Mon, 16 Mar 2009 01:52:47 +0000 (+0000) Subject: qtypes: MDL-18559 questions showing penalty information when they shouldn't. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=5995f17f72a7a437b65494af2c36e634b5967661;p=moodle.git qtypes: MDL-18559 questions showing penalty information when they shouldn't. We had a !== when it should have been !=, and our constants were defined as strings not ints. This problem has been there since forever, but no one had noticed before. Thanks to Alan Trick for finally spotting it! --- diff --git a/question/type/questiontype.php b/question/type/questiontype.php index ed801bd9f0..e7c018c4ea 100644 --- a/question/type/questiontype.php +++ b/question/type/questiontype.php @@ -1172,7 +1172,7 @@ 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 / 1.01) - and (QUESTION_EVENTCLOSEANDGRADE !== $state->event)) { + and (QUESTION_EVENTCLOSEANDGRADE != $state->event)) { if ('' !== $state->last_graded->penalty && ((float)$state->last_graded->penalty) > 0.0) { // A penalty was applied so display it diff --git a/question/type/shortanswer/questiontype.php b/question/type/shortanswer/questiontype.php index 15d616add4..12eb435a36 100644 --- a/question/type/shortanswer/questiontype.php +++ b/question/type/shortanswer/questiontype.php @@ -339,7 +339,7 @@ class question_shortanswer_qtype extends 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) 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 ' ';