From f9d271aca6c59030cf421aca3f3b2afda78c09f5 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Wed, 15 Mar 2017 17:05:11 -0500 Subject: [PATCH] Fix division by zero - refs BT#12212 --- main/mySpace/myStudents.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/mySpace/myStudents.php b/main/mySpace/myStudents.php index b21a2d13d3..712da1643f 100755 --- a/main/mySpace/myStudents.php +++ b/main/mySpace/myStudents.php @@ -701,7 +701,7 @@ if (!empty($student_id)) { $scoretotal_display = round($scoretotal[0], 1 ).'/'. round($scoretotal[1], 1). - ' ('.round(($scoretotal[0] / $scoretotal[1]) * 100, 2).' %)'; + ' ('.round(($scoretotal[0] / ($scoretotal[1] ? $scoretotal[1] : 1)) * 100, 2).' %)'; } $progress = Tracking::get_avg_student_progress($user_info['user_id'], $courseCodeItem, null, $sessionId);