Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

qtypes: MDL-18559 questions showing penalty information when they sho…

…uldn'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!
  • Loading branch information...
commit d20f688bbb50df8fec03c28d9dc5d3620a7cf23d 1 parent cf3ea39
tjhunt authored
View
2  question/type/questiontype.php
@@ -786,7 +786,7 @@ function print_question_grading_details(&$question, &$state, $cmoptions, $option
// 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
View
2  question/type/shortanswer/questiontype.php
@@ -411,7 +411,7 @@ function print_question_grading_details(&$question, &$state, $cmoptions, $option
}
// 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 ' ';
Please sign in to comment.
Something went wrong with that request. Please try again.