Rating update interface
Review Request #83 - Created March 16, 2009 and updated
Information | |
---|---|
Victor Rusu | |
infoarena | |
Reviewers | |
hackers | |
A new field in `ia_round` named `rated` holds the rating state of the round as follows: 0 - rating not updated 1 - rating updated 2 - marked for rating update 3 - marked for rating reset (when the first round is set to this state the rating for all rounds will be reset) The interface builds a table with the rounds and a rating update button for each round. The table respects the condition that to update rating for a specific round, all rounds before it must be updated first. The eval does the job of extracting rounds marked for update or reset and executing the update-rating script.
-
trunk/www/format/form.php (Diff revision 1) -
add 'class' => 'button' or 'button important', it looks nicer.
Using numeric values (0, 1, 2, 3) is to confusing when looking over the code. Let's just use strings, like we do with the round state ('running', 'waiting', etc.)
-
trunk/www/controllers/rating.php (Diff revision 1) -
Check for request_is_post() (see how we do it in other controllers).
-
trunk/www/controllers/rating.php (Diff revision 1) -
Shouldn't there be a simpler way than doing 3 statements to update the round? Maybe a function round_update_rated() that does a simple UPDATE SET rated = ...
-
trunk/www/views/rating.php (Diff revision 1) -
This should say "Data rundei".
-
trunk/common/db/round.php (Diff revision 2) -
round rated status
-
trunk/common/db/round.php (Diff revision 2) -
log_assert(is_rated_status(...))
-
trunk/common/round.php (Diff revision 2) -
You should make a function "is_rated_status" in common/common.php for this.
-
trunk/common/round.php (Diff revision 2) -
This should be done with an SQL query, since it's an expensive task that will be run on the eval every 0.1 seconds.
-
trunk/www/controllers/rating.php (Diff revision 2) -
if (...) { }