]> iEval git - gruntmaster-data.git/blobdiff - lib/Gruntmaster/Data/Result/Problem.pm
Add non-DBIC versions of all methods and a benchmark script
[gruntmaster-data.git] / lib / Gruntmaster / Data / Result / Problem.pm
index fe5523d62ced72ae2b9fa3316a63244eeffdacfe..c067c765886a8edd5858cbddd0207f0721e68c7d 100644 (file)
@@ -115,6 +115,13 @@ Statement (HTML)
 
 Number of tests
 
+=head2 precnt
+
+  data_type: 'integer'
+  is_nullable: 1
+
+Number of pretests. NULL indicates full feedback.
+
 =head2 tests
 
   data_type: 'text'
@@ -195,6 +202,8 @@ __PACKAGE__->add_columns(
   { data_type => "text", is_nullable => 0 },
   "testcnt",
   { data_type => "integer", is_nullable => 0 },
+  "precnt",
+  { data_type => "integer", is_nullable => 1 },
   "tests",
   { data_type => "text", is_nullable => 1 },
   "timeout",
@@ -255,6 +264,21 @@ __PACKAGE__->has_many(
   { cascade_copy => 0, cascade_delete => 0 },
 );
 
+=head2 limits
+
+Type: has_many
+
+Related object: L<Gruntmaster::Data::Result::Limit>
+
+=cut
+
+__PACKAGE__->has_many(
+  "limits",
+  "Gruntmaster::Data::Result::Limit",
+  { "foreign.problem" => "self.id" },
+  { cascade_copy => 0, cascade_delete => 0 },
+);
+
 =head2 opens
 
 Type: has_many
@@ -311,8 +335,8 @@ Composing rels: L</contest_problems> -> contest
 __PACKAGE__->many_to_many("contests", "contest_problems", "contest");
 
 
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-19 16:54:00
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QZHyWOWaPmTm/EQ5M22CGA
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-03-16 17:16:58
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:N7cuqDEGSn5rf8V5GovRQQ
 
 use Class::Method::Modifiers qw/after/;
 
@@ -320,19 +344,9 @@ after qw/insert update delete/ => sub {
        my ($self) = @_;
        Gruntmaster::Data::purge '/pb/';
        Gruntmaster::Data::purge '/pb/' . $self->id;
+       Gruntmaster::Data::purge '/sol/' . $self->id;
 };
 
-sub is_private {
-       my ($self, $time) = @_;
-       return 1 if $self->private;
-       grep { $_->contest->is_pending($time) } $self->contest_problems;
-}
-
-sub is_in_archive {
-       my ($self, $time) = @_;
-       0 == grep { $_->contest->is_running($time) } $self->contest_problems;
-}
-
 sub rerun {
        $_->rerun for shift->jobs
 }
@@ -343,14 +357,6 @@ __END__
 
 =head1 METHODS
 
-=head2 is_private(I<[$time]>)
-
-Returns true if the problem is private at time I<$time> (which defaults to C<time>).
-
-=head2 is_in_archive(I<[$time]>)
-
-Returns true if the problem is in the archive at time I<$time> (which defaults to C<time>).
-
 =head2 rerun
 
 Reruns all jobs for this problem.
This page took 0.027171 seconds and 4 git commands to generate.