Skip to content

Commit 0fe5a99

Browse files
committed
Zero division fix when no tasks and no students
1 parent 47ceb2b commit 0fe5a99

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/WebTaskSubmitter/View.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ sub tasklist_page() {
249249
$out .= "</tr>\n";
250250
}
251251

252-
my $pp = $student_points/$max_points;
252+
my $pp = 0;
253+
$pp = $student_points/$max_points if $max_points > 0;
253254

254255
$out .= sprintf "<tr><th colspan='2'>$texts->{tasklist_total_points}</th><th>%d / %d (%.1f%%)</th><th colspan='2'>%s</th></tr>\n",
255256
$student_points, $max_points, $pp * 100,

0 commit comments

Comments
 (0)