]> iEval git - gruntmaster-data.git/blob - 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
1 use utf8;
2 package 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
9 Gruntmaster::Data::Result::Problem - List of problems
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use 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
36 Full 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
43 Full name(s) of statement writer(s) (DEPRECATED)
44
45 =head2 generator
46
47 data_type: 'text'
48 is_nullable: 0
49
50 Generator class, without the leading Gruntmaster::Daemon::Generator::
51
52 =head2 judge
53
54 data_type: 'text'
55 is_nullable: 0
56
57 Judge class, without the leading Gruntmaster::Daemon::Judge::
58
59 =head2 level
60
61 data_type: 'text'
62 is_nullable: 0
63
64 Problem 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
76 Output 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
95 Runner class, without the leading Gruntmaster::Daemon::Runner::
96
97 =head2 solution
98
99 data_type: 'text'
100 is_nullable: 1
101
102 Solution (HTML)
103
104 =head2 statement
105
106 data_type: 'text'
107 is_nullable: 0
108
109 Statement (HTML)
110
111 =head2 testcnt
112
113 data_type: 'integer'
114 is_nullable: 0
115
116 Number of tests
117
118 =head2 precnt
119
120 data_type: 'integer'
121 is_nullable: 1
122
123 Number of pretests. NULL indicates full feedback.
124
125 =head2 tests
126
127 data_type: 'text'
128 is_nullable: 1
129
130 JSON array of test values for ::Runner::File
131
132 =head2 timeout
133
134 data_type: 'real'
135 is_nullable: 0
136
137 Time limit (in seconds)
138
139 =head2 value
140
141 data_type: 'integer'
142 is_nullable: 0
143
144 Problem value when used in a contest.
145
146 =head2 genformat
147
148 data_type: 'text'
149 is_nullable: 1
150
151 Format (programming language) of the generator if using the Run generator
152
153 =head2 gensource
154
155 data_type: 'text'
156 is_nullable: 1
157
158 Source code of generator if using the Run generator
159
160 =head2 verformat
161
162 data_type: 'text'
163 is_nullable: 1
164
165 Format (programming language) of the verifier if using the Verifier runner
166
167 =head2 versource
168
169 data_type: 'text'
170 is_nullable: 1
171
172 Source 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
239 Type: has_many
240
241 Related 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
254 Type: has_many
255
256 Related 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
269 Type: has_many
270
271 Related 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
284 Type: has_many
285
286 Related 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
299 Type: belongs_to
300
301 Related 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
314 Type: has_many
315
316 Related 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
329 Type: many_to_many
330
331 Composing 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
341 use Class::Method::Modifiers qw/after/;
342
343 after 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
350 sub rerun {
351 $_->rerun for shift->jobs
352 }
353
354 1;
355
356 __END__
357
358 =head1 METHODS
359
360 =head2 rerun
361
362 Reruns all jobs for this problem.
363
364 =head1 AUTHOR
365
366 Marius Gavrilescu E<lt>marius@ieval.roE<gt>
367
368 =head1 COPYRIGHT AND LICENSE
369
370 Copyright (C) 2014 by Marius Gavrilescu
371
372 This library is free software; you can redistribute it and/or modify
373 it under the same terms as Perl itself, either Perl version 5.18.1 or,
374 at your option, any later version of Perl 5 you may have available.
375
376
377 =cut
This page took 0.058998 seconds and 4 git commands to generate.