]> iEval git - gruntmaster-data.git/blame_incremental - lib/Gruntmaster/Data/Result/Problem.pm
Add limit overrides
[gruntmaster-data.git] / lib / Gruntmaster / Data / Result / Problem.pm
... / ...
CommitLineData
1use utf8;
2package Gruntmaster::Data::Result::Problem;
3
4# Created by DBIx::Class::Schema::Loader
5# DO NOT MODIFY THE FIRST PART OF THIS FILE
6
7=head1 NAME
8
9Gruntmaster::Data::Result::Problem - List of problems
10
11=cut
12
13use strict;
14use warnings;
15
16use base 'DBIx::Class::Core';
17
18=head1 TABLE: C<problems>
19
20=cut
21
22__PACKAGE__->table("problems");
23
24=head1 ACCESSORS
25
26=head2 id
27
28 data_type: 'text'
29 is_nullable: 0
30
31=head2 author
32
33 data_type: 'text'
34 is_nullable: 1
35
36Full name(s) of problem author(s)/problemsetter(s)/tester(s)/etc
37
38=head2 writer
39
40 data_type: 'text'
41 is_nullable: 1
42
43Full name(s) of statement writer(s) (DEPRECATED)
44
45=head2 generator
46
47 data_type: 'text'
48 is_nullable: 0
49
50Generator class, without the leading Gruntmaster::Daemon::Generator::
51
52=head2 judge
53
54 data_type: 'text'
55 is_nullable: 0
56
57Judge class, without the leading Gruntmaster::Daemon::Judge::
58
59=head2 level
60
61 data_type: 'text'
62 is_nullable: 0
63
64Problem level, one of beginner, easy, medium, hard
65
66=head2 name
67
68 data_type: 'text'
69 is_nullable: 0
70
71=head2 olimit
72
73 data_type: 'integer'
74 is_nullable: 1
75
76Output limit (in bytes)
77
78=head2 owner
79
80 data_type: 'text'
81 is_foreign_key: 1
82 is_nullable: 0
83
84=head2 private
85
86 data_type: 'boolean'
87 default_value: false
88 is_nullable: 0
89
90=head2 runner
91
92 data_type: 'text'
93 is_nullable: 0
94
95Runner class, without the leading Gruntmaster::Daemon::Runner::
96
97=head2 solution
98
99 data_type: 'text'
100 is_nullable: 1
101
102Solution (HTML)
103
104=head2 statement
105
106 data_type: 'text'
107 is_nullable: 0
108
109Statement (HTML)
110
111=head2 testcnt
112
113 data_type: 'integer'
114 is_nullable: 0
115
116Number of tests
117
118=head2 precnt
119
120 data_type: 'integer'
121 is_nullable: 1
122
123Number of pretests. NULL indicates full feedback.
124
125=head2 tests
126
127 data_type: 'text'
128 is_nullable: 1
129
130JSON array of test values for ::Runner::File
131
132=head2 timeout
133
134 data_type: 'real'
135 is_nullable: 0
136
137Time limit (in seconds)
138
139=head2 value
140
141 data_type: 'integer'
142 is_nullable: 0
143
144Problem value when used in a contest.
145
146=head2 genformat
147
148 data_type: 'text'
149 is_nullable: 1
150
151Format (programming language) of the generator if using the Run generator
152
153=head2 gensource
154
155 data_type: 'text'
156 is_nullable: 1
157
158Source code of generator if using the Run generator
159
160=head2 verformat
161
162 data_type: 'text'
163 is_nullable: 1
164
165Format (programming language) of the verifier if using the Verifier runner
166
167=head2 versource
168
169 data_type: 'text'
170 is_nullable: 1
171
172Source code of verifier if using the Verifier runner
173
174=cut
175
176__PACKAGE__->add_columns(
177 "id",
178 { data_type => "text", is_nullable => 0 },
179 "author",
180 { data_type => "text", is_nullable => 1 },
181 "writer",
182 { data_type => "text", is_nullable => 1 },
183 "generator",
184 { data_type => "text", is_nullable => 0 },
185 "judge",
186 { data_type => "text", is_nullable => 0 },
187 "level",
188 { data_type => "text", is_nullable => 0 },
189 "name",
190 { data_type => "text", is_nullable => 0 },
191 "olimit",
192 { data_type => "integer", is_nullable => 1 },
193 "owner",
194 { data_type => "text", is_foreign_key => 1, is_nullable => 0 },
195 "private",
196 { data_type => "boolean", default_value => \"false", is_nullable => 0 },
197 "runner",
198 { data_type => "text", is_nullable => 0 },
199 "solution",
200 { data_type => "text", is_nullable => 1 },
201 "statement",
202 { data_type => "text", is_nullable => 0 },
203 "testcnt",
204 { data_type => "integer", is_nullable => 0 },
205 "precnt",
206 { data_type => "integer", is_nullable => 1 },
207 "tests",
208 { data_type => "text", is_nullable => 1 },
209 "timeout",
210 { data_type => "real", is_nullable => 0 },
211 "value",
212 { data_type => "integer", is_nullable => 0 },
213 "genformat",
214 { data_type => "text", is_nullable => 1 },
215 "gensource",
216 { data_type => "text", is_nullable => 1 },
217 "verformat",
218 { data_type => "text", is_nullable => 1 },
219 "versource",
220 { data_type => "text", is_nullable => 1 },
221);
222
223=head1 PRIMARY KEY
224
225=over 4
226
227=item * L</id>
228
229=back
230
231=cut
232
233__PACKAGE__->set_primary_key("id");
234
235=head1 RELATIONS
236
237=head2 contest_problems
238
239Type: has_many
240
241Related object: L<Gruntmaster::Data::Result::ContestProblem>
242
243=cut
244
245__PACKAGE__->has_many(
246 "contest_problems",
247 "Gruntmaster::Data::Result::ContestProblem",
248 { "foreign.problem" => "self.id" },
249 { cascade_copy => 0, cascade_delete => 0 },
250);
251
252=head2 jobs
253
254Type: has_many
255
256Related object: L<Gruntmaster::Data::Result::Job>
257
258=cut
259
260__PACKAGE__->has_many(
261 "jobs",
262 "Gruntmaster::Data::Result::Job",
263 { "foreign.problem" => "self.id" },
264 { cascade_copy => 0, cascade_delete => 0 },
265);
266
267=head2 limits
268
269Type: has_many
270
271Related object: L<Gruntmaster::Data::Result::Limit>
272
273=cut
274
275__PACKAGE__->has_many(
276 "limits",
277 "Gruntmaster::Data::Result::Limit",
278 { "foreign.problem" => "self.id" },
279 { cascade_copy => 0, cascade_delete => 0 },
280);
281
282=head2 opens
283
284Type: has_many
285
286Related object: L<Gruntmaster::Data::Result::Open>
287
288=cut
289
290__PACKAGE__->has_many(
291 "opens",
292 "Gruntmaster::Data::Result::Open",
293 { "foreign.problem" => "self.id" },
294 { cascade_copy => 0, cascade_delete => 0 },
295);
296
297=head2 owner
298
299Type: belongs_to
300
301Related object: L<Gruntmaster::Data::Result::User>
302
303=cut
304
305__PACKAGE__->belongs_to(
306 "owner",
307 "Gruntmaster::Data::Result::User",
308 { id => "owner" },
309 { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
310);
311
312=head2 problem_statuses
313
314Type: has_many
315
316Related object: L<Gruntmaster::Data::Result::ProblemStatus>
317
318=cut
319
320__PACKAGE__->has_many(
321 "problem_statuses",
322 "Gruntmaster::Data::Result::ProblemStatus",
323 { "foreign.problem" => "self.id" },
324 { cascade_copy => 0, cascade_delete => 0 },
325);
326
327=head2 contests
328
329Type: many_to_many
330
331Composing rels: L</contest_problems> -> contest
332
333=cut
334
335__PACKAGE__->many_to_many("contests", "contest_problems", "contest");
336
337
338# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-03-16 17:16:58
339# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:N7cuqDEGSn5rf8V5GovRQQ
340
341use Class::Method::Modifiers qw/after/;
342
343after qw/insert update delete/ => sub {
344 my ($self) = @_;
345 Gruntmaster::Data::purge '/pb/';
346 Gruntmaster::Data::purge '/pb/' . $self->id;
347 Gruntmaster::Data::purge '/sol/' . $self->id;
348};
349
350sub rerun {
351 $_->rerun for shift->jobs
352}
353
3541;
355
356__END__
357
358=head1 METHODS
359
360=head2 rerun
361
362Reruns all jobs for this problem.
363
364=head1 AUTHOR
365
366Marius Gavrilescu E<lt>marius@ieval.roE<gt>
367
368=head1 COPYRIGHT AND LICENSE
369
370Copyright (C) 2014 by Marius Gavrilescu
371
372This library is free software; you can redistribute it and/or modify
373it under the same terms as Perl itself, either Perl version 5.18.1 or,
374at your option, any later version of Perl 5 you may have available.
375
376
377=cut
This page took 0.026408 seconds and 4 git commands to generate.