| @@ 5184-5194 (lines=11) @@ | ||
| 5181 | return null; |
|
| 5182 | } |
|
| 5183 | ||
| 5184 | foreach ($attempts as $attempt) { |
|
| 5185 | if (api_get_user_id() == $attempt['exe_user_id']) { |
|
| 5186 | if ($attempt['exe_weighting'] != 0 ) { |
|
| 5187 | $my_exercise_result_array[]= $attempt['exe_result']/$attempt['exe_weighting']; |
|
| 5188 | } |
|
| 5189 | } else { |
|
| 5190 | if ($attempt['exe_weighting'] != 0 ) { |
|
| 5191 | $exercise_result[]= $attempt['exe_result']/$attempt['exe_weighting']; |
|
| 5192 | } |
|
| 5193 | } |
|
| 5194 | } |
|
| 5195 | ||
| 5196 | //Getting best result |
|
| 5197 | rsort($my_exercise_result_array); |
|
| @@ 5359-5369 (lines=11) @@ | ||
| 5356 | if (empty($attempts)) { |
|
| 5357 | return null; |
|
| 5358 | } |
|
| 5359 | foreach ($attempts as $attempt) { |
|
| 5360 | if (api_get_user_id() == $attempt['exe_user_id']) { |
|
| 5361 | if ($attempt['exe_weighting'] != 0 ) { |
|
| 5362 | $my_exercise_result_array[]= $attempt['exe_result']/$attempt['exe_weighting']; |
|
| 5363 | } |
|
| 5364 | } else { |
|
| 5365 | if ($attempt['exe_weighting'] != 0 ) { |
|
| 5366 | $exercise_result[]= $attempt['exe_result']/$attempt['exe_weighting']; |
|
| 5367 | } |
|
| 5368 | } |
|
| 5369 | } |
|
| 5370 | ||
| 5371 | //Getting best result |
|
| 5372 | rsort($my_exercise_result_array); |
|