]>
iEval git - gruntmaster-data.git/blob - lib/Gruntmaster/Data/Result/Problem.pm
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
16 use base
'DBIx::Class::Core';
18 =head1 TABLE: C<problems>
22 __PACKAGE__
->table("problems");
44 extra: {custom_type_name => "generator",list => ["File","Run","Undef"]}
50 extra: {custom_type_name => "judge",list => ["Absolute","Points"]}
56 extra: {custom_type_name => "plevel",list => ["beginner","easy","medium","hard"]}
84 extra: {custom_type_name => "runner",list => ["File","Verifier","Interactive"]}
134 __PACKAGE__
->add_columns(
136 { data_type
=> "text", is_nullable
=> 0 },
138 { data_type
=> "text", is_nullable
=> 1 },
140 { data_type
=> "text", is_nullable
=> 1 },
144 extra
=> { custom_type_name
=> "generator", list
=> ["File", "Run", "Undef"] },
150 extra
=> { custom_type_name
=> "judge", list
=> ["Absolute", "Points"] },
157 custom_type_name
=> "plevel",
158 list
=> ["beginner", "easy", "medium", "hard"],
163 { data_type
=> "text", is_nullable
=> 0 },
165 { data_type
=> "integer", is_nullable
=> 1 },
167 { data_type
=> "text", is_foreign_key
=> 1, is_nullable
=> 0 },
169 { data_type
=> "boolean", default_value
=> \"false
", is_nullable => 0 },
174 custom_type_name => "runner
",
175 list => ["File
", "Verifier
", "Interactive
"],
180 { data_type => "text
", is_nullable => 0 },
182 { data_type => "integer
", is_nullable => 0 },
184 { data_type => "text
", is_nullable => 1 },
186 { data_type => "real
", is_nullable => 0 },
188 { data_type => "integer
", is_nullable => 1 },
190 { data_type => "text
", is_nullable => 1 },
192 { data_type => "text
", is_nullable => 1 },
194 { data_type => "text
", is_nullable => 1 },
196 { data_type => "text
", is_nullable => 1 },
209 __PACKAGE__->set_primary_key("id
");
213 =head2 contest_problems
217 Related object: L<Gruntmaster::Data::Result::ContestProblem>
221 __PACKAGE__->has_many(
223 "Gruntmaster
::Data
::Result
::ContestProblem
",
224 { "foreign
.problem
" => "self
.id
" },
225 { cascade_copy => 0, cascade_delete => 0 },
232 Related object: L<Gruntmaster::Data::Result::Job>
236 __PACKAGE__->has_many(
238 "Gruntmaster
::Data
::Result
::Job
",
239 { "foreign
.problem
" => "self
.id
" },
240 { cascade_copy => 0, cascade_delete => 0 },
247 Related object: L<Gruntmaster::Data::Result::Open>
251 __PACKAGE__->has_many(
253 "Gruntmaster
::Data
::Result
::Open
",
254 { "foreign
.problem
" => "self
.id
" },
255 { cascade_copy => 0, cascade_delete => 0 },
262 Related object: L<Gruntmaster::Data::Result::User>
266 __PACKAGE__->belongs_to(
268 "Gruntmaster
::Data
::Result
::User
",
270 { is_deferrable => 0, on_delete => "NO ACTION
", on_update => "NO ACTION
" },
277 Composing rels: L</contest_problems> -> contest
281 __PACKAGE__->many_to_many("contests
", "contest_problems
", "contest
");
284 # Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-03-30 12:59:34
285 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ujwyMJ5Pup1i5NKXkPkg2g
288 my ($self, $time) = @_;
289 return 1 if $self->private;
290 grep { $_->contest->is_pending($time) } $self->contest_problems;
294 my ($self, $time) = @_;
295 0 == grep { $_->contest->is_running($time) } $self->contest_problems;
299 $_->rerun for shift->jobs
308 =head2 is_private(I<[$time]>)
310 Returns true if the problem is private at time I<$time> (which defaults to C<time>).
312 =head2 is_in_archive(I<[$time]>)
314 Returns true if the problem is in the archive at time I<$time> (which defaults to C<time>).
318 Reruns all jobs for this problem.
322 Marius Gavrilescu E<lt>marius@ieval.roE<gt>
324 =head1 COPYRIGHT AND LICENSE
326 Copyright (C) 2014 by Marius Gavrilescu
328 This library is free software; you can redistribute it and/or modify
329 it under the same terms as Perl itself, either Perl version 5.18.1 or,
330 at your option, any later version of Perl 5 you may have available.
This page took 0.069044 seconds and 5 git commands to generate.