Code Duplication    Length = 11-11 lines in 2 locations

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

@@ 5151-5161 (lines=11) @@
5148
            return null;
5149
        }
5150
5151
        foreach ($attempts as $attempt) {
5152
            if (api_get_user_id() == $attempt['exe_user_id']) {
5153
                if ($attempt['exe_weighting'] != 0 ) {
5154
                    $my_exercise_result_array[]= $attempt['exe_result']/$attempt['exe_weighting'];
5155
                }
5156
            } else {
5157
                if ($attempt['exe_weighting'] != 0 ) {
5158
                    $exercise_result[]=  $attempt['exe_result']/$attempt['exe_weighting'];
5159
                }
5160
            }
5161
        }
5162
5163
        //Getting best result
5164
        rsort($my_exercise_result_array);
@@ 5326-5336 (lines=11) @@
5323
        if (empty($attempts)) {
5324
            return null;
5325
        }
5326
        foreach ($attempts as $attempt) {
5327
            if (api_get_user_id() == $attempt['exe_user_id']) {
5328
                if ($attempt['exe_weighting'] != 0 ) {
5329
                    $my_exercise_result_array[]= $attempt['exe_result']/$attempt['exe_weighting'];
5330
                }
5331
            } else {
5332
                if ($attempt['exe_weighting'] != 0 ) {
5333
                    $exercise_result[]=  $attempt['exe_result']/$attempt['exe_weighting'];
5334
                }
5335
            }
5336
        }
5337
5338
        //Getting best result
5339
        rsort($my_exercise_result_array);