Changeset 996


Ignore:
Timestamp:
01/22/09 17:03:58 (3 years ago)
Author:
bogdan2412
Message:

Detailed feedback

  • Moved (and renamed) task parameters "tests", "testgroups", "okfiles" and "evaluator" to ia_task (they will be common to every task type anyway). Only memlimit and timelimit remain in ia_parameter_value for tasks.
  • Added 'public_tests' column to ia_task in which you can specify tests for detailed feedback in the same format as a group in 'test_groups'
  • Added "job-view-partial-feedback" permission. Users should only be able to see their own feedback, not that of others.
  • Added UI for job_detail to show results on public tests
  • Made monitor show when detailed feedback is available for a job

Extra

  • Moved score and size hiding in monitor from view to controller
  • Added "job-view-score" permission check to job_view_source controller

Reviewed: http://reviewboard.infoarena.ro/r/46/

Location:
trunk
Files:
1 added
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/common/db/job.php

    r979 r996  
    358358} 
    359359 
     360// Returns an array of public test informations for a job 
     361function job_test_get_public($job_id) { 
     362    $query = sprintf(" 
     363        SELECT `test_count`, `public_tests` FROM `ia_task` 
     364        WHERE `id` = ( 
     365            SELECT `task_id` FROM `ia_job` 
     366            WHERE `id` = %s 
     367        )", db_quote($job_id)); 
     368 
     369    $task = db_fetch($query); 
     370    log_assert(!is_null($task)); 
     371 
     372    $test_ids = task_parse_test_group($task["public_tests"], $task["test_count"]); 
     373    if (!count($test_ids)) { 
     374        return array(); 
     375    } 
     376 
     377    $query = sprintf(" 
     378        SELECT * FROM `ia_job_test` 
     379        WHERE `job_id` = %s AND `test_number` IN (%s) 
     380        ORDER BY `test_number`", 
     381        db_quote($job_id), 
     382        implode(", ", array_map("db_quote", array_values($test_ids)))); 
     383    return db_fetch_all($query); 
     384} 
     385 
    360386?> 
  • trunk/common/parameter.php

    r852 r996  
    99// $value           raw value string stored in database 
    1010function parameter_decode($parameter_id, $value) { 
    11     $booleans = array('unique_output', 'okfiles', 'rating_update'); 
    12     $ints = array('memlimit', 'tests', 'rating_timestamp'); 
     11    $booleans = array('rating_update'); 
     12    $ints = array('memlimit', 'rating_timestamp'); 
    1313    $floats = array('timelimit'); 
    14     $strings = array('evaluator'); 
     14    $strings = array(); 
    1515 
    1616    if (in_array($parameter_id, $booleans)) { 
  • trunk/common/security.php

    r981 r996  
    159159        case 'job-view-source-size': 
    160160        case 'job-view-score': 
     161        case 'job-view-partial-feedback': 
    161162            return $action; 
    162163 
     
    518519                            $can_view_source; 
    519520    $can_view_score = ($job['round_public_eval'] == true) || $is_task_owner || $is_admin; 
     521    $can_view_partial_feedback = $is_owner || $is_admin; 
    520522 
    521523    // Log query response. 
     
    545547            return $can_view_job && $can_view_score; 
    546548 
     549        case 'job-view-partial-feedback': 
     550            return $can_view_job && $can_view_partial_feedback; 
     551 
    547552        default: 
    548553            log_error('Invalid job action: '.$action); 
  • trunk/common/task.php

    r943 r996  
    1515function task_get_parameter_infos() { 
    1616    return array( 
    17             'classic' => array( 
    18                 'timelimit' => array( 
    19                         'description' => "Limita de timp (in secunde)", 
    20                         'default' => 1, 
    21                         'type' => 'float', 
    22                         'name' => 'Limita de timp', 
    23                 ), 
    24                 'memlimit' => array( 
    25                         'description' => "Limita de memorie (in kilobytes)", 
    26                         'default' => 16384, 
    27                         'type' => 'integer', 
    28                         'name' => 'Limita de memorie', 
    29                 ), 
    30                 'tests' => array( 
    31                         'description' => "Numar de teste", 
    32                         'default' => 10, 
    33                         'type' => 'integer', 
    34                         'name' => "Numar de teste", 
    35                 ), 
    36                 'testgroups' => array( 
    37                         'description' => "Descrierea gruparii testelor.", 
    38                         'default' => '1;2;3;4;5;6;7;8;9;10', 
    39                         'type' => 'string', 
    40                         'name' => "Grupare teste", 
    41  
     17        'classic' => array( 
     18            'timelimit' => array( 
     19                    'description' => "Limita de timp (in secunde)", 
     20                    'default' => 1, 
     21                    'type' => 'float', 
     22                    'name' => 'Limita de timp', 
    4223            ), 
    43             'okfiles' => array( 
    44                     'description' => "Daca evaluator-ul foloseste fisiere .ok", 
    45                     'default' => '0', 
    46                     'type' => 'bool', 
    47                     'name' => "Foloseste .ok", 
     24            'memlimit' => array( 
     25                    'description' => "Limita de memorie (in kilobytes)", 
     26                    'default' => 16384, 
     27                    'type' => 'integer', 
     28                    'name' => 'Limita de memorie', 
    4829            ), 
    49             'evaluator' => array( 
    50                     'description' => "Sursa evaluatorului. Poate fi omis pentru evaluare cu diff", 
    51                     'default' => 'eval.c', 
    52                     'type' => 'string', 
    53                     'name' => "Evaluator", 
    54             ), 
    55     ), 
    56     'output-only' => array( 
    57             'tests' => array( 
    58                     'description' => "Numar de teste", 
    59                     'default' => 10, 
    60                     'type' => 'integer', 
    61                     'name' => "Numar de teste", 
    62             ), 
    63             'testgroups' => array( 
    64                     'description' => "Descrierea gruparii testelor.", 
    65                     'default' => '1;2;3;4;5;6;7;8;9;10', 
    66                     'type' => 'string', 
    67                     'name' => "Grupare teste", 
    68             ), 
    69             'okfiles' => array( 
    70                     'description' => "Daca evaluator-ul foloseste fisiere .ok", 
    71                     'default' => '0', 
    72                     'type' => 'bool', 
    73                     'name' => "Foloseste .ok", 
    74             ), 
    75             'evaluator' => array( 
    76                     'description' => "Sursa evaluatorului. Poate fi omis pentru evaluare cu diff", 
    77                     'default' => 'eval.c', 
    78                     'type' => 'string', 
    79                     'name' => "Evaluator", 
    80             ), 
    81     ), 
    82 ); 
     30        ), 
     31        'output-only' => array( 
     32        ), 
     33    ); 
    8334} 
    8435 
     
    9445            'open_source' => 0, 
    9546            'open_tests' => 0, 
     47            'test_count' => 10, 
     48            'test_groups' => NULL, 
     49            'public_tests' => NULL, 
     50            'evaluator' => NULL, 
     51            'use_ok_files' => 1, 
    9652    ); 
    9753 
     
    153109    } 
    154110 
     111    if (!is_whole_number($task['test_count'])) { 
     112        $errors['test_count'] = "Numarul de teste trebuie sa fie un numar."; 
     113    } else if ($task['test_count'] < 1) { 
     114        $errors['test_count'] = "Minim 1 test."; 
     115    } else if ($task['test_count'] > 100) { 
     116        $errors['test_count'] = "Maxim 100 de teste."; 
     117    } 
     118 
     119    if ($task['use_ok_files'] != '0' && $task['use_ok_files'] != '1') { 
     120        $errors['use_ok_files'] = "0/1 only"; 
     121    } 
     122 
     123    if ($task['evaluator'] == "") { 
     124        if (!$task['use_ok_files']) { 
     125            $errors['evaluator'] = "Pentru evaluare cu diff e nevoie e fisiere .ok"; 
     126        } 
     127    } else { 
     128        if (!is_attachment_name($task['evaluator'])) { 
     129            $errors['evaluator'] = "Nume de fisier invalid."; 
     130        } 
     131    } 
     132 
     133    if (task_get_testgroups($task) === false) { 
     134        $errors['test_groups'] = "Eroare de sintaxa in expresie."; 
     135    } 
     136 
     137    if (task_parse_test_group($task["public_tests"], $task["test_count"]) === false) { 
     138        $errors['public_tests'] = "Eroare de sintaxa in expresie."; 
     139    } 
     140 
    155141    return $errors; 
    156142} 
    157143 
    158 // Parse test grouping expression from task parameters and returns groups as an array 
     144// Parse test grouping expression from task and returns groups as an array 
    159145// If there is no grouping parameter defined it returns a group for each test by default 
    160146// If the expression string contains errors the function returns false 
    161147// Expression syntax: 
    162 // item: number | number-number  
     148// item: number | number-number 
    163149// group: item | item,group 
    164150// groups: group | group;groups 
    165 function task_get_testgroups($parameters) { 
    166     $test_count = $parameters['tests']; 
     151function task_parse_test_group($string, $test_count) { 
     152    if (strlen($string) == 0) 
     153        return array(); 
     154 
     155    $current_group = array(); 
     156    $items = explode(',', $string); 
     157    $used_count = array(); 
     158    for ($test = 1; $test <= $test_count; $test++) { 
     159        $used_count[$test]  = 0; 
     160    } 
     161 
     162    foreach ($items as &$item) { 
     163        $tests = explode('-', $item); 
     164        if (count($tests) < 1 || count($tests) > 2) { 
     165            return false; 
     166        } 
     167        foreach ($tests as &$test) { 
     168            $test = trim($test); 
     169            if (!is_whole_number($test)) { 
     170                return false; 
     171            } 
     172        } 
     173        if (count($tests) == 1) { 
     174            if ($tests[0] < 1 || $tests[0] > $test_count) { 
     175                return false; 
     176            } 
     177            $current_group[] = $tests[0]; 
     178            $used_count[$tests[0]] = 1; 
     179        } else { 
     180            $left = (int) $tests[0]; 
     181            $right = (int) $tests[1]; 
     182            if ($left < 1 || $right < 1 || $left > $test_count || $right > $test_count) { 
     183                return false; 
     184            } 
     185            for ($test = min($left, $right); $test <= max($left, $right); $test++) { 
     186                $current_group[] = $test; 
     187                $used_count[$test]++; 
     188            } 
     189        } 
     190    } 
     191 
     192    for ($test = 1; $test <= $test_count; $test++) { 
     193        if ($used_count[$test] > 1) { 
     194            return false; 
     195        } 
     196    } 
     197 
     198    return $current_group; 
     199} 
     200 
     201function task_get_testgroups($task) { 
     202    $test_count = $task['test_count']; 
    167203    if (!is_whole_number($test_count)) { 
    168204        return false; 
    169205    } 
    170     if (is_null(getattr($parameters, 'testgroups'))) { 
     206    if (!getattr($task, 'test_groups')) { 
    171207        $testgroups = array(); 
    172208        for ($test = 1; $test <= $test_count; $test++) { 
     
    182218    } 
    183219    $testgroups = array(); 
    184     $groups = explode(';', $parameters['testgroups']); 
     220    $groups = explode(';', $task['test_groups']); 
    185221    foreach ($groups as &$group) { 
    186         $current_group = array(); 
    187         $items = explode(',', $group); 
    188         foreach ($items as &$item) { 
    189             $tests = explode('-', $item); 
    190             if (count($tests) < 1 || count($tests) > 2) { 
    191                 return false; 
    192             } 
    193             foreach ($tests as &$test) { 
    194                 $test = trim($test); 
    195                 if (!is_whole_number($test)) { 
    196                     return false; 
    197                 } 
    198             } 
    199             if (count($tests) == 1) { 
    200                 if ($tests[0] < 1 || $tests[0] > $test_count) { 
    201                     return false; 
    202                 } 
    203                 $current_group[] = $tests[0]; 
    204                 $used_count[$tests[0]]++; 
    205             } 
    206             else { 
    207                 $left = (int) $tests[0]; 
    208                 $right = (int) $tests[1]; 
    209                 if ($left < 1 || $right < 1 || $left > $test_count || $right > $test_count) { 
    210                     return false; 
    211                 } 
    212                 for ($test = min($left, $right); $test <= max($left, $right); $test++) { 
    213                     $current_group[] = $test; 
    214                     $used_count[$test]++; 
    215                 } 
    216             } 
     222        $current_group = task_parse_test_group($group, $test_count); 
     223        if (!$current_group) { 
     224            return false; 
     225        } 
     226        foreach ($current_group as $test) { 
     227            $used_count[$test]++; 
    217228        } 
    218229        $testgroups[] = $current_group; 
     
    247258            $errors['memlimit'] = "Maxim 128 megabytes."; 
    248259        } 
    249  
    250         if (!is_whole_number($parameters['tests'])) { 
    251             $errors['tests'] = "Numarul de teste trebuie sa fie un numar."; 
    252         } else if ($parameters['tests'] < 1) { 
    253             $errors['tests'] = "Minim 1 test."; 
    254         } else if ($parameters['tests'] > 100) { 
    255  
    256             $errors['tests'] = "Maxim 100 de teste."; 
    257         } 
    258  
    259         if ($parameters['okfiles'] != '0' && $parameters['okfiles'] != '1') { 
    260             $errors['okfiles'] = "0/1 only"; 
    261         } 
    262  
    263         if ($parameters['evaluator'] == "") { 
    264             if (!$parameters['okfiles']) { 
    265                 $errors['evaluator'] = "Pentru evaluare cu diff e nevoie e fisiere .ok"; 
    266             } 
    267         } else { 
    268             if (!is_attachment_name($parameters['evaluator'])) { 
    269                 $errors['evaluator'] = "Nume de fisier invalid."; 
    270             } 
    271         } 
    272  
    273         if (task_get_testgroups($parameters) === false) { 
    274             $errors['testgroups'] = "Eroare de sintaxa in expresie."; 
    275         } 
    276  
    277260    } else if ($task_type == 'output-only') { 
    278         if ($parameters['okfiles'] != '0' && $parameters['okfiles'] != '1') { 
    279             $errors['okfiles'] = "0/1 only"; 
    280         } 
    281  
    282         if (!is_whole_number($parameters['tests'])) { 
    283             $errors['tests'] = "Numarul de teste trebuie sa fie un numar."; 
    284         } else if ($parameters['tests'] < 1) { 
    285             $errors['tests'] = "Minim 1 test."; 
    286         } else if ($parameters['tests'] > 100) { 
    287             $errors['tests'] = "Maxim 100 de teste."; 
    288         } 
    289  
    290         if ($parameters['evaluator'] == "") { 
    291             if (!$parameters['okfiles']) { 
    292                 $errors['evaluator'] = "Pentru evaluare cu diff e nevoie e fisiere .ok"; 
    293             } 
    294         } else { 
    295             if (!is_attachment_name($parameters['evaluator'])) { 
    296                 $errors['evaluator'] = "Nume de fisier invalid."; 
    297             } 
    298         } 
    299  
    300         if (task_get_testgroups($parameters) === false) { 
    301             $errors['testgroups'] = "Eroare de sintaxa in expresie."; 
    302         } 
     261        // Nothing to validate 
    303262    } else { 
    304263        log_error("Bad task_type"); 
  • trunk/eval/classic_grader.php

    r993 r996  
    2121    // Compile custom evaluator. 
    2222    // Don't send system error, send custom message 
    23     if ($tparams['evaluator'] !== '') { 
    24         if (!copy_grader_file($task, $tparams['evaluator'], 
    25                     IA_ROOT_DIR.'eval/temp/'.$tparams['evaluator'])) { 
     23    if ($task['evaluator']) { 
     24        if (!copy_grader_file($task, $task['evaluator'], 
     25                    IA_ROOT_DIR.'eval/temp/'.$task['evaluator'])) { 
    2626            log_print('Task eval not found'); 
    2727            $result['message'] = 'Eroare in setarile problemei'; 
    2828            $result['log'] = "Lipseste evaluatorul problemei.\n"; 
    2929            $result['log'] .= "Ar trebui sa existe un atasament". 
    30                 " 'grader_{$tparams['evaluator']}' ". 
     30                " 'grader_{$task['evaluator']}' ". 
    3131                "la pagina cu enuntul problemei"; 
    3232            return $result; 
    3333        } 
    3434 
    35         if (!compile_file($tparams['evaluator'], 'eval', $compiler_messages)) { 
     35        if (!compile_file($task['evaluator'], 'eval', $compiler_messages)) { 
    3636            log_print('Task eval compile error'); 
    3737            $result['message'] = 'Eroare de compilare in evaluator'; 
     
    6868    // Running tests. 
    6969    $test_score = array(); 
    70     for ($testno = 1; $testno <= $tparams['tests']; ++$testno) { 
     70    for ($testno = 1; $testno <= $task['test_count']; ++$testno) { 
    7171        $test_score[$testno] = 0; 
    7272    } 
    73     $test_groups = task_get_testgroups($tparams); 
     73    $test_groups = task_get_testgroups($task); 
    7474    $group_idx = 0; 
    7575    foreach ($test_groups as $group) { 
     
    139139 
    140140            // Copy ok file, if used. 
    141             if ($tparams['okfiles']) { 
     141            if ($task['use_ok_files']) { 
    142142                if (!copy_grader_file($task , 'test' . $testno . '.ok', $okfile)) { 
    143143                    log_print("Test $testno: .ok file not found"); 
     
    152152            } 
    153153 
    154             if ($tparams['evaluator'] === '') { 
     154            if (!$task['evaluator']) { 
    155155                // Diff grading, trivial. 
    156156                if (is_readable($outfile)) { 
     
    158158                    if ($diff_output == '') { 
    159159                        log_print("Test $testno: Diff eval: Files identical");  
    160                         $score = 100 / $tparams['tests']; 
     160                        $score = 100 / $task['test_count']; 
    161161                        $test_msg = "OK"; 
    162162                        $test_score[$testno] = $score; 
  • trunk/www/controllers/job_detail.php

    r915 r996  
    3636    $view['title'] = 'Borderou de evaluare (job #'.$job_id.')'; 
    3737    $view['job'] = $job; 
    38     $view['group_count'] = 0; 
    3938    $view['tests'] = array(); 
    4039 
    4140    if (identity_can('job-view-score', $job)) { 
     41        $view['group_tests'] = true; 
     42        $view['group_count'] = 0; 
     43 
    4244        $view['tests'] = job_test_get_all($job_id); 
    4345        foreach ($view['tests'] as $test) { 
     
    6365        } 
    6466    } else { 
    65         $view['job']['score'] = "Ascuns"; 
     67        $view['group_tests'] = false; 
     68        $view['job']['score'] = NULL; 
     69        if (identity_can("job-view-partial-feedback", $job)) { 
     70            $view['tests'] = job_test_get_public($job_id); 
     71        } 
    6672    } 
    6773 
     
    7177    execute_view_die('views/job_detail.php', $view); 
    7278} 
    73  
    7479 
    7580function controller_job_view_source($job_id) { 
     
    8792 
    8893    identity_require('job-view-source', $job); 
     94    if (!identity_can("job-view-score", $job)) { 
     95        $job['score'] = NULL; 
     96    } 
    8997 
    9098    $view = array(); 
  • trunk/www/controllers/monitor.php

    r980 r996  
    33require_once(IA_ROOT_DIR."www/format/pager.php"); 
    44require_once(IA_ROOT_DIR."common/db/job.php"); 
     5require_once(IA_ROOT_DIR."common/db/task.php"); 
    56require_once(IA_ROOT_DIR."www/controllers/job_filters.php"); 
    67 
     
    1617    $options = pager_init_options(array('display_entries' => 25)); 
    1718 
     19    $job_data = job_get_range($view['filters'], $options['first_entry'], $options['display_entries']); 
     20    $jobs = array(); 
     21    foreach ($job_data as $job) { 
     22        if (!identity_can("job-view-score", $job)) { 
     23            $job["score"] = NULL; 
     24            if (identity_can("job-view-partial-feedback", $job)) { 
     25                $task = task_get($job["task_id"]); 
     26                if ($task["public_tests"]) { 
     27                    $job["feedback_available"] = true; 
     28                } 
     29            } 
     30        } 
     31        if (!identity_can('job-view-source-size', $job)) { 
     32            $job["job_size"] = NULL; 
     33        } 
     34 
     35        $jobs[] = $job; 
     36    } 
     37 
    1838    $view['title'] = 'Monitorul de evaluare'; 
    19     $view['jobs'] = job_get_range($view['filters'], $options['first_entry'], $options['display_entries']); 
     39    $view['jobs'] = $jobs; 
    2040    $view['total_entries'] = job_get_count($view['filters']); 
    2141    $view['first_entry'] = $options['first_entry']; 
  • trunk/www/controllers/task.php

    r962 r996  
    4343 
    4444    // Fill in form values from request, defaults in $task 
    45     $values['author'] = request('author', $task['author']); 
    46     $values['type'] = request('type', $task['type']); 
    47     $values['source'] = request('source', $task['source']); 
    48     $values['hidden'] = request('hidden', $task['hidden']); 
    49     $values['title'] = request('title', $task['title']); 
    50     $values['page_name'] = request('page_name', $task['page_name']); 
    51     $values['open_source'] = request('open_source', $task['open_source']); 
    52     $values['open_tests'] = request('open_tests', $task['open_tests']); 
     45    $fields = array('author', 'type', 'source', 'hidden', 'title', 'page_name', 
     46                    'open_source', 'open_tests', 'test_count', 'test_groups', 
     47                    'evaluator', 'use_ok_files', 'public_tests'); 
     48 
     49    foreach ($fields as $field) { 
     50        $values[$field] = request($field, $task[$field]); 
     51    } 
    5352 
    5453    // Parameter values, for all possible types of tasks. 
     
    7271        // Build new task 
    7372        $new_task = $task; 
    74         $new_task['title'] = $values['title']; 
    75         $new_task['page_name'] = $values['page_name']; 
    76         $new_task['author'] = $values['author']; 
    77         $new_task['source'] = $values['source']; 
    78         $new_task['type'] = $values['type']; 
    79         $new_task['hidden'] = $values['hidden']; 
    80         $new_task['open_source'] = $values['open_source']; 
    81         $new_task['open_tests'] = $values['open_tests']; 
     73        foreach ($fields as $field) { 
     74            $new_task[$field] = $values[$field]; 
     75        } 
    8276 
    8377        $task_errors = task_validate($new_task); 
  • trunk/www/macros/macro_taskparam.php

    r934 r996  
    6464            return html_escape($task['id']); 
    6565 
    66         case 'owner':        
    67             if( $task['user_id']=='0' ) { 
    68                 return ''; 
    69             } 
    70             $user = user_get_by_id( $task['user_id'] );      
     66        case 'owner': 
     67            if ($task['user_id'] == '0') { 
     68                return ''; 
     69            } 
     70            $user = user_get_by_id($task['user_id']); 
    7171            return html_escape($user['full_name']); 
    7272 
    7373        case 'formatted_owner': 
    74             if( $task['user_id']=='0' ) { 
    75                 return ''; 
    76             } 
    77             $user = user_get_by_id( $task['user_id'] ); 
    78             return format_user_tiny($user['username'], $user['full_name'], 
    79                                     $user['rating_cache']); 
     74            if ($task['user_id'] == '0') { 
     75                return ''; 
     76            } 
     77            $user = user_get_by_id($task['user_id']); 
     78            return format_user_tiny($user['username'], $user['full_name'], 
     79                                    $user['rating_cache']); 
    8080 
    8181        default: 
  • trunk/www/views/job_detail.php

    r934 r996  
    66 
    77// display group sum column? 
    8 $show_groups = ($view['group_count'] < count($view['tests'])); 
     8$show_groups = $view['group_tests'] && 
     9               ($view['group_count'] < count($view['tests'])); 
    910 
    1011?> 
     
    2324    <td class="task-id"><?= format_link(url_textblock($job['task_page_name']), $job['task_title']) ?></td> 
    2425    <th class="score">Scor</th> 
    25     <td class="score"><?= html_escape($job['score']) ?></td> 
     26    <td class="score"><?= html_escape(is_null($job['score']) ? "Ascuns" : $job['score']) ?></td> 
    2627</tr> 
    2728</tr> 
     
    7172<?php 
    7273    $last_group = 0; 
     74    if (!$view["group_tests"]) { 
     75        $test_row = 0; 
     76    } 
    7377    foreach ($view['tests'] as $test) { 
    74         echo '<tr class="'.($test['test_group'] % 2 == 1 ? "odd" : "even").'">'; 
     78        if ($view["group_tests"]) { 
     79            echo '<tr class="'.($test['test_group'] % 2 == 1 ? "odd" : "even").'">'; 
     80        } else { 
     81            echo '<tr class="'.($test_row % 2 == 1 ? "odd" : "even").'">'; 
     82            $test_row++; 
     83        } 
    7584        echo '<td class="number">'.$test['test_number'].'</td>'; 
    7685        echo '<td class="number">'.$test['exec_time'].'ms</td>'; 
     
    8695        echo '</tr>'; 
    8796    } 
    88     echo '<tr><td colspan="'.($show_groups ? 5 : 4).'">'. 
    89          'Punctaj total</td><td class="total_score number">'.$job['score'].'</td></tr>'; 
     97    if (!is_null($job['score'])) { 
     98        echo '<tr><td colspan="'.($show_groups ? 5 : 4).'">'. 
     99             'Punctaj total</td><td class="total_score number">'.$job['score'].'</td></tr>'; 
     100    } 
    90101?> 
    91102</tbody> 
  • trunk/www/views/job_view_source.php

    r934 r996  
    1818    <td class="task-id"><?= format_link(url_textblock($job['task_page_name']), $job['task_title']) ?></td> 
    1919    <th class="score">Scor</th> 
    20     <td class="score"><?= html_escape($job['score']) ?></td> 
     20    <td class="score"><?= html_escape(is_null($job['score']) ? "Ascuns" : $job['score']) ?></td> 
    2121</tr> 
    2222</tr> 
  • trunk/www/views/monitor.php

    r979 r996  
    6868        $url = url_job_detail($row['id']); 
    6969        if ($row['status'] == 'done') { 
    70             if (identity_can("job-view-score", $row)) { 
     70            if (!is_null($row['score'])) { 
    7171                $msg = html_escape(sprintf("%s: %s puncte", 
    7272                    $row['eval_message'], $row['score'])); 
    7373            } else { 
    7474                $msg = html_escape($row['eval_message']); 
     75                if (isset($row["feedback_available"])) { 
     76                    $msg .= ": rezultate partiale disponibile"; 
     77                } 
    7578            } 
    7679            $msg = "<span style=\"job-status-done\">$msg</span>"; 
     
    125128    // For the size column. 
    126129    function format_size($row) { 
    127         if (!identity_can('job-view-source-size', $row)) { 
     130        if (is_null($row['job_size'])) { 
    128131            return "..."; 
    129132        } 
  • trunk/www/views/task_edit.php

    r962 r996  
    5959                'type' => 'bool' 
    6060        ), 
     61        'test_count' => array( 
     62                'description' => "Numar de teste", 
     63                'default' => 10, 
     64                'type' => 'integer', 
     65                'name' => "Numar de teste", 
     66        ), 
     67        'test_groups' => array( 
     68                'description' => "Descrierea gruparii testelor.", 
     69                'default' => '1;2;3;4;5;6;7;8;9;10', 
     70                'type' => 'string', 
     71                'name' => "Grupare teste", 
     72        ), 
     73        'public_tests' => array( 
     74                'description' => "Lista de teste pe care utilizatorii pot vedea rezultatele in concursuri.", 
     75                'default' => '', 
     76                'type' => 'string', 
     77                'name' => "Detailed feedback", 
     78        ), 
     79        'use_ok_files' => array( 
     80                'description' => "Daca evaluator-ul foloseste fisiere .ok", 
     81                'default' => '0', 
     82                'type' => 'bool', 
     83                'name' => "Foloseste .ok", 
     84        ), 
     85        'evaluator' => array( 
     86                'description' => "Sursa evaluatorului. Poate fi omis pentru evaluare cu diff", 
     87                'default' => 'eval.c', 
     88                'type' => 'string', 
     89                'name' => "Evaluator", 
     90        ), 
    6191); 
    6292 
     
    108138    <legend>Detalii despre evaluare</legend> 
    109139    <ul class="form"> 
     140        <?= view_form_field_li($form_fields['test_count'], 'test_count') ?> 
     141        <?= view_form_field_li($form_fields['test_groups'], 'test_groups') ?> 
     142        <?= view_form_field_li($form_fields['public_tests'], 'public_tests') ?> 
     143        <?= view_form_field_li($form_fields['use_ok_files'], 'use_ok_files') ?> 
     144        <?= view_form_field_li($form_fields['evaluator'], 'evaluator') ?> 
     145 
    110146        <?= view_form_field_li($form_fields['type'], 'type') ?> 
    111147        <li><hr /></li> 
Note: See TracChangeset for help on using the changeset viewer.