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!
This commit is contained in:
@@ -786,7 +786,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
|
||||
|
||||
@@ -411,7 +411,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 ' ';
|
||||
|
||||
Reference in New Issue
Block a user