Support problem parameters outside meta
authorMarius Gavrilescu <marius@ieval.ro>
Sun, 9 Feb 2014 17:25:54 +0000 (19:25 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Sun, 9 Feb 2014 17:25:54 +0000 (19:25 +0200)
lib/Gruntmaster/Daemon.pm
t/FakeData.pm

index 82da6b8..7166a42 100644 (file)
@@ -58,9 +58,19 @@ sub process{
   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};
        }
 
index fe64241..f83c7c8 100644 (file)
@@ -18,8 +18,14 @@ sub set_job_results          { $jobs[$_[0]]{results} = $_[1] };
 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]] }
 
This page took 0.031353 seconds and 4 git commands to generate.