Changeset 1046


Ignore:
Timestamp:
06/21/09 14:19:51 (3 years ago)
Author:
bogdan2412
Message:

Merge changes from eval

Fixes virtual contest task hideing issues and eval hanging on jobs with no rounds.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/common/round.php

    r1006 r1046  
    134134    $round['state'] = 'running'; 
    135135    round_update($round); 
    136     round_unhide_all_tasks($round['id']); 
     136    // User defined rounds always contain already visible tasks. 
     137    if ($round["type"] != "user-defined") { 
     138        round_unhide_all_tasks($round['id']); 
     139    } 
    137140} 
    138141 
     
    142145    log_print("CONTEST LOGIC: Stopping round {$round['id']}."); 
    143146    $round['state'] = 'complete'; 
    144     $round['public_eval'] = 1; 
     147    // Results should be immediately visible after a round ends 
     148    // if it's type is not classic. 
     149    if ($round["type"] != "classic") { 
     150        $round['public_eval'] = 1; 
     151    } 
    145152    round_update($round); 
    146153} 
     
    152159    $round['state'] = 'waiting'; 
    153160    round_update($round); 
    154     round_hide_all_tasks($round['id']); 
     161    // User defined rounds always contain already visible tasks. 
     162    // If such a round is postponed, do not (re)hide the tasks 
     163    // like for classic rounds, where the tasks are not visible 
     164    // before the round starts. 
     165    if ($round["type"] != "user-defined") { 
     166        round_hide_all_tasks($round['id']); 
     167    } 
    155168} 
    156169 
  • trunk/common/score.php

    r1040 r1046  
    77function score_update_for_job($score, $time, $user_id, $task_id, $round_id) 
    88{ 
    9     $round = round_get($round_id); 
    10     round_event_job_score($round, $score, $time, $user_id, $task_id); 
     9    if ($round_id) { 
     10        $round = round_get($round_id); 
     11        round_event_job_score($round, $score, $time, $user_id, $task_id); 
     12    } 
    1113} 
    1214 
  • trunk/eval/utilities.php

    r993 r1046  
    8282{ 
    8383    if (!preg_match("/^(ERROR|FAIL|OK):\ (.*)$/", $message, $matches)) { 
     84        log_warn("Invalid jrun output: $message"); 
    8485        return false; 
    8586    } 
     
    161162    //$cmdline .= " --verbose"; 
    162163 
    163     //log_print("Running $cmdline"); 
     164    log_print("Running $cmdline"); 
    164165    $message = shell_exec($cmdline); 
    165166 
Note: See TracChangeset for help on using the changeset viewer.