mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Fixed a division by zero error
This commit is contained in:
parent
253e647478
commit
f64fdf3f9d
@ -298,7 +298,11 @@ class block_quiz_results extends block_base {
|
||||
break;
|
||||
default:
|
||||
case GRADE_FORMAT_PCT:
|
||||
$this->content->text .= round((float)$grades[$gradeid]->grade / (float)$quiz->grade * 100).'%';
|
||||
if ($quiz->grade) {
|
||||
$this->content->text .= round((float)$grades[$gradeid]->grade / (float)$quiz->grade * 100).'%';
|
||||
} else {
|
||||
$this->content->text .= '--%';
|
||||
}
|
||||
break;
|
||||
}
|
||||
$this->content->text .= '</td></tr>';
|
||||
|
Loading…
x
Reference in New Issue
Block a user