| @@ 5194-5204 (lines=11) @@ | ||
| 5191 | return null; |
|
| 5192 | } |
|
| 5193 | ||
| 5194 | foreach ($attempts as $attempt) { |
|
| 5195 | if (api_get_user_id() == $attempt['exe_user_id']) { |
|
| 5196 | if ($attempt['exe_weighting'] != 0 ) { |
|
| 5197 | $my_exercise_result_array[]= $attempt['exe_result']/$attempt['exe_weighting']; |
|
| 5198 | } |
|
| 5199 | } else { |
|
| 5200 | if ($attempt['exe_weighting'] != 0 ) { |
|
| 5201 | $exercise_result[]= $attempt['exe_result']/$attempt['exe_weighting']; |
|
| 5202 | } |
|
| 5203 | } |
|
| 5204 | } |
|
| 5205 | ||
| 5206 | //Getting best result |
|
| 5207 | rsort($my_exercise_result_array); |
|
| @@ 5369-5379 (lines=11) @@ | ||
| 5366 | if (empty($attempts)) { |
|
| 5367 | return null; |
|
| 5368 | } |
|
| 5369 | foreach ($attempts as $attempt) { |
|
| 5370 | if (api_get_user_id() == $attempt['exe_user_id']) { |
|
| 5371 | if ($attempt['exe_weighting'] != 0 ) { |
|
| 5372 | $my_exercise_result_array[]= $attempt['exe_result']/$attempt['exe_weighting']; |
|
| 5373 | } |
|
| 5374 | } else { |
|
| 5375 | if ($attempt['exe_weighting'] != 0 ) { |
|
| 5376 | $exercise_result[]= $attempt['exe_result']/$attempt['exe_weighting']; |
|
| 5377 | } |
|
| 5378 | } |
|
| 5379 | } |
|
| 5380 | ||
| 5381 | //Getting best result |
|
| 5382 | rsort($my_exercise_result_array); |
|