Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'MDL-30033_21' of git://github.com/timhunt/moodle into M…

…OODLE_21_STABLE
  • Loading branch information...
commit b5c2f105677822ae43e2f301bf1c2e46906a487d 2 parents e06a172 + 1ee150e
@stronk7 stronk7 authored
Showing with 8 additions and 0 deletions.
  1. +4 −0 mod/quiz/locallib.php
  2. +4 −0 mod/quiz/report/reportlib.php
View
4 mod/quiz/locallib.php
@@ -362,6 +362,10 @@ function quiz_feedback_for_grade($grade, $quiz, $context) {
return '';
}
+ // With CBM etc, it is possible to get -ve grades, which would then not match
+ // any feedback. Therefore, we replace -ve grades with 0.
+ $grade = max($grade, 0);
+
$feedback = $DB->get_record_select('quiz_feedback',
'quizid = ? AND mingrade <= ? AND ? < maxgrade', array($quiz->id, $grade, $grade));
View
4 mod/quiz/report/reportlib.php
@@ -265,6 +265,10 @@ function quiz_report_feedback_for_grade($grade, $quizid, $context) {
$feedbackcache[$quizid] = $DB->get_records('quiz_feedback', array('quizid' => $quizid));
}
+ // With CBM etc, it is possible to get -ve grades, which would then not match
+ // any feedback. Therefore, we replace -ve grades with 0.
+ $grade = max($grade, 0);
+
$feedbacks = $feedbackcache[$quizid];
$feedbackid = 0;
$feedbacktext = '';
Please sign in to comment.
Something went wrong with that request. Please try again.