Code Duplication    Length = 11-11 lines in 2 locations

main/inc/lib/tracking.lib.php 2 locations

@@ 5776-5786 (lines=11) @@
5773
            return null;
5774
        }
5775
5776
        foreach ($attempts as $attempt) {
5777
            if (api_get_user_id() == $attempt['exe_user_id']) {
5778
                if ($attempt['exe_weighting'] != 0) {
5779
                    $my_exercise_result_array[] = $attempt['exe_result'] / $attempt['exe_weighting'];
5780
                }
5781
            } else {
5782
                if ($attempt['exe_weighting'] != 0) {
5783
                    $exercise_result[] = $attempt['exe_result'] / $attempt['exe_weighting'];
5784
                }
5785
            }
5786
        }
5787
5788
        //Getting best result
5789
        rsort($my_exercise_result_array);
@@ 5964-5974 (lines=11) @@
5961
        if (empty($attempts)) {
5962
            return null;
5963
        }
5964
        foreach ($attempts as $attempt) {
5965
            if (api_get_user_id() == $attempt['exe_user_id']) {
5966
                if ($attempt['exe_weighting'] != 0) {
5967
                    $my_exercise_result_array[] = $attempt['exe_result'] / $attempt['exe_weighting'];
5968
                }
5969
            } else {
5970
                if ($attempt['exe_weighting'] != 0) {
5971
                    $exercise_result[] = $attempt['exe_result'] / $attempt['exe_weighting'];
5972
                }
5973
            }
5974
        }
5975
5976
        //Getting best result
5977
        rsort($my_exercise_result_array);