Code Duplication    Length = 5-5 lines in 4 locations

main/inc/lib/myspace.lib.php 4 locations

@@ 996-1000 (lines=5) @@
993
        } else {
994
            $last_login_date = '-';
995
        }
996
        if ($total_score_possible > 0) {
997
            $total_score_percentage = round($total_score_obtained / $total_score_possible * 100, 2);
998
        } else {
999
            $total_score_percentage = 0;
1000
        }
1001
        if ($total_score_percentage > 0) {
1002
            $total_score = $total_score_obtained.'/'.$total_score_possible.' ('.$total_score_percentage.' %)';
1003
        } else {
@@ 1146-1150 (lines=5) @@
1143
            } else {
1144
                $last_login_date = '-';
1145
            }
1146
            if($total_score_possible > 0) {
1147
                $total_score_percentage = round($total_score_obtained / $total_score_possible * 100, 2);
1148
            } else {
1149
                $total_score_percentage = 0;
1150
            }
1151
            // time spent in the course
1152
            $csv_row[] = api_time_to_hms($time_spent);
1153
            // student progress in course
@@ 1352-1356 (lines=5) @@
1349
            } else {
1350
                $last_login_date = '-';
1351
            }
1352
            if ($total_score_possible > 0) {
1353
                $total_score_percentage = round($total_score_obtained / $total_score_possible * 100, 2);
1354
            } else {
1355
                $total_score_percentage = 0;
1356
            }
1357
            if ($total_score_percentage > 0) {
1358
                $total_score = $total_score_obtained.'/'.$total_score_possible.' ('.$total_score_percentage.' %)';
1359
            } else {
@@ 1526-1530 (lines=5) @@
1523
                } else {
1524
                    $last_login_date = '-';
1525
                }
1526
                if($total_score_possible > 0) {
1527
                    $total_score_percentage = round($total_score_obtained / $total_score_possible * 100, 2);
1528
                } else {
1529
                    $total_score_percentage = 0;
1530
                }
1531
                if($total_score_percentage > 0) {
1532
                    $total_score = $total_score_obtained.'/'.$total_score_possible.' ('.$total_score_percentage.' %)';
1533
                } else {