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