Changeset 1120
- Timestamp:
- 03/26/10 00:37:03 (2 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
common/db/round.php (modified) (1 diff)
-
common/db/task.php (modified) (3 diffs)
-
www/views/task_filter_results.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/common/db/round.php
r1119 r1120 535 535 db_query($query); 536 536 537 // Delete entries from ia_score 538 $query = sprintf("DELETE FROM `ia_score` 537 // Delete entries from ia_score_user_round 538 $query = sprintf("DELETE FROM `ia_score_user_round` 539 WHERE `round_id` = %s", 540 db_quote($round_id)); 541 db_query($query); 542 543 // Delete entries from ia_score_user_round_task 544 $query = sprintf("DELETE FROM `ia_score_user_round_task` 545 WHERE `round_id` = %s", 546 db_quote($round_id)); 547 db_query($query); 548 549 // Delete entries from ia_rating 550 $query = sprintf("DELETE FROM `ia_rating` 539 551 WHERE `round_id` = %s", 540 552 db_quote($round_id)); -
trunk/common/db/task.php
r1110 r1120 218 218 $score_fields = ""; 219 219 } else { 220 $join_score = "LEFT JOIN ia_score ON ia_score.user_id = ".db_quote($user_id)." AND221 ia_score.round_id = round.idAND222 ia_score.task_id = ia_task.idAND223 ia_score.name = 'score'";224 $score_fields = " ia_score.score,";220 $join_score = "LEFT JOIN ia_score_user_round_task AS score ON 221 score.`user_id` = ".db_quote($user_id)." AND 222 score.`round_id` = round_task.`round_id` AND 223 score.`task_id` = round_task.`task_id`"; 224 $score_fields = "score.`score` AS `score`,"; 225 225 } 226 226 … … 231 231 ia_task.open_source AS open_source, 232 232 ia_task.open_tests AS open_tests, 233 ia_task.rating AS rating, 233 234 round.id AS round_id, 234 235 $score_fields … … 241 242 AND ia_task.hidden = '0' $tag_filter 242 243 ORDER BY round.id DESC, ia_task.order"; 244 243 245 $tasks = db_fetch_all($query); 244 246 -
trunk/www/views/task_filter_results.php
r1099 r1120 1 1 <?php 2 require_once(IA_ROOT_DIR . "www/macros/macro_stars.php"); 3 2 4 include('header.php'); 3 5 include('format/table.php'); … … 18 20 } else { 19 21 return round($val); 22 } 23 } 24 25 function format_rating_column($val) { 26 if (is_null($val)) { 27 return 'N/A'; 28 } else { 29 $stars_args = array( 30 'rating' => $val, 31 'scale' => 5, 32 'type' => 'normal' 33 ); 34 return macro_stars($stars_args); 20 35 } 21 36 } … … 109 124 'css_class' => 'source', 110 125 'key' => 'round_title'); 126 $column_infos[] = array( 127 'title' => 'Dificultate', 128 'css_class' => 'rating', 129 'key' => 'rating', 130 'valform' => 'format_rating_column'); 111 131 if (!is_null($user_id)) { 112 132 $column_infos[] = array ( 113 133 'title' => 'Scorul tău', 114 'css_class' => ' numberscore',134 'css_class' => 'score', 115 135 'key' => 'score', 116 136 'valform' => 'format_score_column');
Note: See TracChangeset
for help on using the changeset viewer.
![[infoarena] development](/chrome/site/logo.png)