]> iEval git - gruntmaster-data.git/blobdiff - lib/Gruntmaster/Data/Result/Problem.pm
Purge affected pages on insert/update/delete
[gruntmaster-data.git] / lib / Gruntmaster / Data / Result / Problem.pm
index 098701eb10d4c2e3e981aa705b37f8630a2e2733..fe5523d62ced72ae2b9fa3316a63244eeffdacfe 100644 (file)
@@ -6,7 +6,7 @@ package Gruntmaster::Data::Result::Problem;
 
 =head1 NAME
 
-Gruntmaster::Data::Result::Problem
+Gruntmaster::Data::Result::Problem - List of problems
 
 =cut
 
@@ -33,26 +33,36 @@ __PACKAGE__->table("problems");
   data_type: 'text'
   is_nullable: 1
 
+Full name(s) of problem author(s)/problemsetter(s)/tester(s)/etc
+
 =head2 writer
 
   data_type: 'text'
   is_nullable: 1
 
+Full name(s) of statement writer(s) (DEPRECATED)
+
 =head2 generator
 
   data_type: 'text'
   is_nullable: 0
 
+Generator class, without the leading Gruntmaster::Daemon::Generator::
+
 =head2 judge
 
   data_type: 'text'
   is_nullable: 0
 
+Judge class, without the leading Gruntmaster::Daemon::Judge::
+
 =head2 level
 
   data_type: 'text'
   is_nullable: 0
 
+Problem level, one of beginner, easy, medium, hard
+
 =head2 name
 
   data_type: 'text'
@@ -63,6 +73,8 @@ __PACKAGE__->table("problems");
   data_type: 'integer'
   is_nullable: 1
 
+Output limit (in bytes)
+
 =head2 owner
 
   data_type: 'text'
@@ -80,56 +92,78 @@ __PACKAGE__->table("problems");
   data_type: 'text'
   is_nullable: 0
 
+Runner class, without the leading Gruntmaster::Daemon::Runner::
+
 =head2 solution
 
   data_type: 'text'
   is_nullable: 1
 
+Solution (HTML)
+
 =head2 statement
 
   data_type: 'text'
   is_nullable: 0
 
+Statement (HTML)
+
 =head2 testcnt
 
   data_type: 'integer'
   is_nullable: 0
 
+Number of tests
+
 =head2 tests
 
   data_type: 'text'
   is_nullable: 1
 
+JSON array of test values for ::Runner::File
+
 =head2 timeout
 
   data_type: 'real'
   is_nullable: 0
 
+Time limit (in seconds)
+
 =head2 value
 
   data_type: 'integer'
   is_nullable: 0
 
+Problem value when used in a contest.
+
 =head2 genformat
 
   data_type: 'text'
   is_nullable: 1
 
+Format (programming language) of the generator if using the Run generator
+
 =head2 gensource
 
   data_type: 'text'
   is_nullable: 1
 
+Source code of generator if using the Run generator
+
 =head2 verformat
 
   data_type: 'text'
   is_nullable: 1
 
+Format (programming language) of the verifier if using the Verifier runner
+
 =head2 versource
 
   data_type: 'text'
   is_nullable: 1
 
+Source code of verifier if using the Verifier runner
+
 =cut
 
 __PACKAGE__->add_columns(
@@ -251,6 +285,21 @@ __PACKAGE__->belongs_to(
   { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
 );
 
+=head2 problem_statuses
+
+Type: has_many
+
+Related object: L<Gruntmaster::Data::Result::ProblemStatus>
+
+=cut
+
+__PACKAGE__->has_many(
+  "problem_statuses",
+  "Gruntmaster::Data::Result::ProblemStatus",
+  { "foreign.problem" => "self.id" },
+  { cascade_copy => 0, cascade_delete => 0 },
+);
+
 =head2 contests
 
 Type: many_to_many
@@ -262,8 +311,16 @@ Composing rels: L</contest_problems> -> contest
 __PACKAGE__->many_to_many("contests", "contest_problems", "contest");
 
 
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-07 00:51:56
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KjAtOerTqBqtcMrBtwJ3Bw
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-19 16:54:00
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QZHyWOWaPmTm/EQ5M22CGA
+
+use Class::Method::Modifiers qw/after/;
+
+after qw/insert update delete/ => sub {
+       my ($self) = @_;
+       Gruntmaster::Data::purge '/pb/';
+       Gruntmaster::Data::purge '/pb/' . $self->id;
+};
 
 sub is_private {
        my ($self, $time) = @_;
This page took 0.025982 seconds and 4 git commands to generate.