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