| Revision 1110,
798 bytes
checked in by savin.tiberiu@…, 23 months ago
(diff) |
|
The long awaited moment. *drumroll*
Split ia score.
Scores are now separated from the ratings. Also the rankings macro can take detail_round and detail_task parameters to add more columns.
REVIEW URL: http://reviewboard.infoarena.ro/r/64/
|
-
Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | require_once(IA_ROOT_DIR . "common/db/score.php"); |
|---|
| 4 | require_once(IA_ROOT_DIR . "common/db/round.php"); |
|---|
| 5 | require_once(IA_ROOT_DIR . "common/db/task.php"); |
|---|
| 6 | |
|---|
| 7 | function score_update_for_job($score, $time, $user_id, $task_id, $round_id) |
|---|
| 8 | { |
|---|
| 9 | if ($round_id) { |
|---|
| 10 | $round = round_get($round_id); |
|---|
| 11 | round_event_job_score($round, $score, $time, $user_id, $task_id); |
|---|
| 12 | } |
|---|
| 13 | } |
|---|
| 14 | |
|---|
| 15 | function round_event_job_score($round, $score, $time, $user_id, $task_id) { |
|---|
| 16 | $rparams = round_get_parameters($round['id']); |
|---|
| 17 | $time = db_date_parse($time); |
|---|
| 18 | $rstart = db_date_parse($round['start_time']); |
|---|
| 19 | $rduration = getattr($rparams, 'duration', 10000000) * 60 * 60; |
|---|
| 20 | if ($time >= $rstart && $time <= $rstart + $rduration) { |
|---|
| 21 | score_update($user_id, $task_id, $round['id'], $score); |
|---|
| 22 | } |
|---|
| 23 | } |
|---|
| 24 | |
|---|
| 25 | ?> |
|---|
Note: See
TracBrowser
for help on using the repository browser.