Code Duplication    Length = 11-11 lines in 2 locations

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

@@ 5062-5072 (lines=11) @@
5059
            return null;
5060
        }
5061
5062
        foreach ($attempts as $attempt) {
5063
            if (api_get_user_id() == $attempt['exe_user_id']) {
5064
                if ($attempt['exe_weighting'] != 0 ) {
5065
                    $my_exercise_result_array[]= $attempt['exe_result']/$attempt['exe_weighting'];
5066
                }
5067
            } else {
5068
                if ($attempt['exe_weighting'] != 0 ) {
5069
                    $exercise_result[]=  $attempt['exe_result']/$attempt['exe_weighting'];
5070
                }
5071
            }
5072
        }
5073
5074
        //Getting best result
5075
        rsort($my_exercise_result_array);
@@ 5237-5247 (lines=11) @@
5234
        if (empty($attempts)) {
5235
            return null;
5236
        }
5237
        foreach ($attempts as $attempt) {
5238
            if (api_get_user_id() == $attempt['exe_user_id']) {
5239
                if ($attempt['exe_weighting'] != 0 ) {
5240
                    $my_exercise_result_array[]= $attempt['exe_result']/$attempt['exe_weighting'];
5241
                }
5242
            } else {
5243
                if ($attempt['exe_weighting'] != 0 ) {
5244
                    $exercise_result[]=  $attempt['exe_result']/$attempt['exe_weighting'];
5245
                }
5246
            }
5247
        }
5248
5249
        //Getting best result
5250
        rsort($my_exercise_result_array);