]> git.mjollnir.org Git - moodle.git/commitdiff
qtypes: MDL-18559 questions showing penalty information when they shouldn't.
authortjhunt <tjhunt>
Mon, 16 Mar 2009 01:52:47 +0000 (01:52 +0000)
committertjhunt <tjhunt>
Mon, 16 Mar 2009 01:52:47 +0000 (01:52 +0000)
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!

question/type/questiontype.php
question/type/shortanswer/questiontype.php

index ed801bd9f01640b1be8938e0cdaef3af677de39d..e7c018c4eabb9b4e57eb701853a2291bb8a9fbd4 100644 (file)
@@ -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
index 15d616add44efa86039e887981bbad732bc4556d..12eb435a363c4d4c0720e58337cc631a6229113c 100644 (file)
@@ -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 ' ';