Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'MDL-31143_21' of https://github.com/timhunt/moodle into…

… MOODLE_21_STABLE
  • Loading branch information...
commit df2842cc6beb4c2123b2cb1e26a404aaf02b8969 2 parents 94a763c + 9d2921b
Aparup Banerjee nebgor authored

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. +3 3 mod/quiz/report/overview/overview_table.php
6 mod/quiz/report/overview/overview_table.php
@@ -81,7 +81,7 @@ protected function add_average_row($label, $users) {
81 81 SELECT AVG(quiza.sumgrades) AS grade, COUNT(quiza.sumgrades) AS numaveraged
82 82 FROM $from
83 83 WHERE $where", $params);
84   - $record->grade = quiz_rescale_grade($record->grade, $this->quiz);
  84 + $record->grade = quiz_rescale_grade($record->grade, $this->quiz, false);
85 85
86 86 if ($this->is_downloading()) {
87 87 $namekey = 'lastname';
@@ -127,7 +127,7 @@ protected function format_average_grade_for_questions($gradeaverages) {
127 127 } else {
128 128 $record = new stdClass();
129 129 $record->grade = null;
130   - $record->numaveraged = null;
  130 + $record->numaveraged = 0;
131 131 }
132 132
133 133 $row['qsgrade' . $question->slot] = $this->format_average($record, true);
@@ -151,7 +151,7 @@ protected function format_average($record, $question = false) {
151 151
152 152 if ($this->download) {
153 153 return $average;
154   - } else if (is_null($record->numaveraged)) {
  154 + } else if (is_null($record->numaveraged) || $record->numaveraged == 0) {
155 155 return html_writer::tag('span', html_writer::tag('span',
156 156 $average, array('class' => 'average')), array('class' => 'avgcell'));
157 157 } else {

0 comments on commit df2842c

Please sign in to comment.
Something went wrong with that request. Please try again.