Skip to content

Commit

Permalink
Some fixes for displaying empty grades in quizzes
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Jan 18, 2004
1 parent 6090461 commit b0be6c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion mod/quiz/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@
$gradecol = "";
}
} else {
$gradecol = "$bestgrade / $quiz->grade";
if ($bestgrade === "" or $quiz->grade == 0) {
$gradecol = "";
} else {
$gradecol = "$bestgrade / $quiz->grade";
}
}

if ($course->format == "weeks" or $course->format == "topics") {
Expand Down
2 changes: 1 addition & 1 deletion mod/quiz/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1426,7 +1426,7 @@ function quiz_get_user_attempts_string($quiz, $attempts, $bestgrade) {
function quiz_get_best_grade($quizid, $userid) {
/// Get the best current grade for a particular user in a quiz
if (!$grade = get_record("quiz_grades", "quiz", $quizid, "userid", $userid)) {
return 0;
return "";
}

return (round($grade->grade,0));
Expand Down

0 comments on commit b0be6c7

Please sign in to comment.