try {
$meta = job_inmeta $job;
if (job_problem $job) {
- my $pbmeta = problem_meta job_problem $job;
+ local $_ = job_problem $job;
+ my $pbmeta = problem_meta;
my %files = exists $meta->{files} ? %{$meta->{files}} : ();
- $meta = {%$meta, %$pbmeta};
+ $meta = {
+ %$meta,
+ (defined problem_generator() ? (generator => problem_generator) : ()),
+ (defined problem_runner() ? (runner => problem_runner) : ()),
+ (defined problem_judge() ? (judge => problem_judge) : ()),
+ (defined problem_testcnt() ? (testcnt => problem_testcnt) : ()),
+ (defined problem_timeout() ? (timeout => problem_timeout) : ()),
+ (defined problem_olimit() ? (olimit => problem_olimit) : ()),
+ %$pbmeta
+ };
$meta->{files} = {%files, %{$pbmeta->{files}}} if exists $pbmeta->{files};
}
sub set_job_errors { $jobs[$_[0]]{errors} = $_[1] };
sub set_job_daemon { $jobs[$_[0]]{daemon} = $_[1] };
-sub problem_meta { $problems{$_[0]}{meta} }
+sub problem_meta { $problems{$_}{meta} }
sub set_problem_meta { $problems{$_[0]}{meta} = $_[1] }
+sub problem_generator {}
+sub problem_runner {}
+sub problem_judge {}
+sub problem_testcnt {}
+sub problem_timeout {}
+sub problem_olimit {}
sub get_job { $jobs[$_[0]] }