]> iEval git - gruntmaster-daemon.git/commitdiff
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 82da6b8924791d53388d43191b4b8d26023bc6b4..7166a4238a5d4809ed0b2cf49d1584af48242fae 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 fe64241213d1665daa54654401d1935ac47a1dae..f83c7c88f143ffae49cb41a33bf343a036932392 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.030677 seconds and 4 git commands to generate.