Code Duplication    Length = 11-11 lines in 2 locations

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

@@ 5111-5121 (lines=11) @@
5108
            return null;
5109
        }
5110
5111
        foreach ($attempts as $attempt) {
5112
            if (api_get_user_id() == $attempt['exe_user_id']) {
5113
                if ($attempt['exe_weighting'] != 0 ) {
5114
                    $my_exercise_result_array[]= $attempt['exe_result']/$attempt['exe_weighting'];
5115
                }
5116
            } else {
5117
                if ($attempt['exe_weighting'] != 0 ) {
5118
                    $exercise_result[]=  $attempt['exe_result']/$attempt['exe_weighting'];
5119
                }
5120
            }
5121
        }
5122
5123
        //Getting best result
5124
        rsort($my_exercise_result_array);
@@ 5286-5296 (lines=11) @@
5283
        if (empty($attempts)) {
5284
            return null;
5285
        }
5286
        foreach ($attempts as $attempt) {
5287
            if (api_get_user_id() == $attempt['exe_user_id']) {
5288
                if ($attempt['exe_weighting'] != 0 ) {
5289
                    $my_exercise_result_array[]= $attempt['exe_result']/$attempt['exe_weighting'];
5290
                }
5291
            } else {
5292
                if ($attempt['exe_weighting'] != 0 ) {
5293
                    $exercise_result[]=  $attempt['exe_result']/$attempt['exe_weighting'];
5294
                }
5295
            }
5296
        }
5297
5298
        //Getting best result
5299
        rsort($my_exercise_result_array);