2 package Gruntmaster
::Data
::Result
::Problem
;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
9 Gruntmaster::Data::Result::Problem - List of problems
16 use base
'DBIx::Class::Core';
18 =head1 TABLE: C<problems>
22 __PACKAGE__
->table("problems");
36 Full name(s) of problem author(s)/problemsetter(s)/tester(s)/etc
43 Full name(s) of statement writer(s) (DEPRECATED)
50 Generator class, without the leading Gruntmaster::Daemon::Generator::
57 Judge class, without the leading Gruntmaster::Daemon::Judge::
64 Problem level, one of beginner, easy, medium, hard
76 Output limit (in bytes)
95 Runner class, without the leading Gruntmaster::Daemon::Runner::
123 JSON array of test values for ::Runner::File
130 Time limit (in seconds)
137 Problem value when used in a contest.
144 Format (programming language) of the generator if using the Run generator
151 Source code of generator if using the Run generator
158 Format (programming language) of the verifier if using the Verifier runner
165 Source code of verifier if using the Verifier runner
169 __PACKAGE__
->add_columns(
171 { data_type
=> "text", is_nullable
=> 0 },
173 { data_type
=> "text", is_nullable
=> 1 },
175 { data_type
=> "text", is_nullable
=> 1 },
177 { data_type
=> "text", is_nullable
=> 0 },
179 { data_type
=> "text", is_nullable
=> 0 },
181 { data_type
=> "text", is_nullable
=> 0 },
183 { data_type
=> "text", is_nullable
=> 0 },
185 { data_type
=> "integer", is_nullable
=> 1 },
187 { data_type
=> "text", is_foreign_key
=> 1, is_nullable
=> 0 },
189 { data_type
=> "boolean", default_value
=> \"false
", is_nullable => 0 },
191 { data_type => "text
", is_nullable => 0 },
193 { data_type => "text
", is_nullable => 1 },
195 { data_type => "text
", is_nullable => 0 },
197 { data_type => "integer
", is_nullable => 0 },
199 { data_type => "text
", is_nullable => 1 },
201 { data_type => "real
", is_nullable => 0 },
203 { data_type => "integer
", is_nullable => 0 },
205 { data_type => "text
", is_nullable => 1 },
207 { data_type => "text
", is_nullable => 1 },
209 { data_type => "text
", is_nullable => 1 },
211 { data_type => "text
", is_nullable => 1 },
224 __PACKAGE__->set_primary_key("id
");
228 =head2 contest_problems
232 Related object: L<Gruntmaster::Data::Result::ContestProblem>
236 __PACKAGE__->has_many(
238 "Gruntmaster
::Data
::Result
::ContestProblem
",
239 { "foreign
.problem
" => "self
.id
" },
240 { cascade_copy => 0, cascade_delete => 0 },
247 Related object: L<Gruntmaster::Data::Result::Job>
251 __PACKAGE__->has_many(
253 "Gruntmaster
::Data
::Result
::Job
",
254 { "foreign
.problem
" => "self
.id
" },
255 { cascade_copy => 0, cascade_delete => 0 },
262 Related object: L<Gruntmaster::Data::Result::Open>
266 __PACKAGE__->has_many(
268 "Gruntmaster
::Data
::Result
::Open
",
269 { "foreign
.problem
" => "self
.id
" },
270 { cascade_copy => 0, cascade_delete => 0 },
277 Related object: L<Gruntmaster::Data::Result::User>
281 __PACKAGE__->belongs_to(
283 "Gruntmaster
::Data
::Result
::User
",
285 { is_deferrable => 0, on_delete => "CASCADE
", on_update => "NO ACTION
" },
288 =head2 problem_statuses
292 Related object: L<Gruntmaster::Data::Result::ProblemStatus>
296 __PACKAGE__->has_many(
298 "Gruntmaster
::Data
::Result
::ProblemStatus
",
299 { "foreign
.problem
" => "self
.id
" },
300 { cascade_copy => 0, cascade_delete => 0 },
307 Composing rels: L</contest_problems> -> contest
311 __PACKAGE__->many_to_many("contests
", "contest_problems
", "contest
");
314 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-19 16:54:00
315 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QZHyWOWaPmTm/EQ5M22CGA
318 my ($self, $time) = @_;
319 return 1 if $self->private;
320 grep { $_->contest->is_pending($time) } $self->contest_problems;
324 my ($self, $time) = @_;
325 0 == grep { $_->contest->is_running($time) } $self->contest_problems;
329 $_->rerun for shift->jobs
338 =head2 is_private(I<[$time]>)
340 Returns true if the problem is private at time I<$time> (which defaults to C<time>).
342 =head2 is_in_archive(I<[$time]>)
344 Returns true if the problem is in the archive at time I<$time> (which defaults to C<time>).
348 Reruns all jobs for this problem.
352 Marius Gavrilescu E<lt>marius@ieval.roE<gt>
354 =head1 COPYRIGHT AND LICENSE
356 Copyright (C) 2014 by Marius Gavrilescu
358 This library is free software; you can redistribute it and/or modify
359 it under the same terms as Perl itself, either Perl version 5.18.1 or,
360 at your option, any later version of Perl 5 you may have available.
This page took 0.03556 seconds and 4 git commands to generate.