]> iEval git - gruntmaster-data.git/blame - lib/Gruntmaster/Data/Result/Problem.pm
Remove no longer useful is_private and is_in_archive methods
[gruntmaster-data.git] / lib / Gruntmaster / Data / Result / Problem.pm
CommitLineData
4ed3f8e7
MG
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
be2f7678 9Gruntmaster::Data::Result::Problem - List of problems
4ed3f8e7
MG
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'
85d3f015 34 is_nullable: 1
4ed3f8e7 35
be2f7678
MG
36Full name(s) of problem author(s)/problemsetter(s)/tester(s)/etc
37
6a03bf0d
MG
38=head2 writer
39
40 data_type: 'text'
41 is_nullable: 1
42
be2f7678
MG
43Full name(s) of statement writer(s) (DEPRECATED)
44
4ed3f8e7
MG
45=head2 generator
46
9bb39921 47 data_type: 'text'
4ed3f8e7
MG
48 is_nullable: 0
49
be2f7678
MG
50Generator class, without the leading Gruntmaster::Daemon::Generator::
51
4ed3f8e7
MG
52=head2 judge
53
9bb39921 54 data_type: 'text'
4ed3f8e7
MG
55 is_nullable: 0
56
be2f7678
MG
57Judge class, without the leading Gruntmaster::Daemon::Judge::
58
4ed3f8e7
MG
59=head2 level
60
9bb39921 61 data_type: 'text'
4ed3f8e7
MG
62 is_nullable: 0
63
be2f7678
MG
64Problem level, one of beginner, easy, medium, hard
65
4ed3f8e7
MG
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
be2f7678
MG
76Output limit (in bytes)
77
4ed3f8e7
MG
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'
b2725d9d 87 default_value: false
4ed3f8e7
MG
88 is_nullable: 0
89
90=head2 runner
91
9bb39921 92 data_type: 'text'
4ed3f8e7
MG
93 is_nullable: 0
94
be2f7678
MG
95Runner class, without the leading Gruntmaster::Daemon::Runner::
96
1980106a
MG
97=head2 solution
98
99 data_type: 'text'
100 is_nullable: 1
101
be2f7678
MG
102Solution (HTML)
103
4ed3f8e7
MG
104=head2 statement
105
106 data_type: 'text'
107 is_nullable: 0
108
be2f7678
MG
109Statement (HTML)
110
4ed3f8e7
MG
111=head2 testcnt
112
113 data_type: 'integer'
114 is_nullable: 0
115
be2f7678
MG
116Number of tests
117
f7c095d3
MG
118=head2 precnt
119
120 data_type: 'integer'
121 is_nullable: 1
122
123Number of pretests. NULL indicates full feedback.
124
b2725d9d
MG
125=head2 tests
126
127 data_type: 'text'
128 is_nullable: 1
129
be2f7678
MG
130JSON array of test values for ::Runner::File
131
4ed3f8e7
MG
132=head2 timeout
133
134 data_type: 'real'
135 is_nullable: 0
136
be2f7678
MG
137Time limit (in seconds)
138
4ed3f8e7
MG
139=head2 value
140
141 data_type: 'integer'
aaa9eb7d 142 is_nullable: 0
4ed3f8e7 143
be2f7678
MG
144Problem value when used in a contest.
145
85d3f015
MG
146=head2 genformat
147
148 data_type: 'text'
149 is_nullable: 1
150
be2f7678
MG
151Format (programming language) of the generator if using the Run generator
152
85d3f015
MG
153=head2 gensource
154
155 data_type: 'text'
156 is_nullable: 1
157
be2f7678
MG
158Source code of generator if using the Run generator
159
4ed3f8e7
MG
160=head2 verformat
161
162 data_type: 'text'
163 is_nullable: 1
164
be2f7678
MG
165Format (programming language) of the verifier if using the Verifier runner
166
4ed3f8e7
MG
167=head2 versource
168
169 data_type: 'text'
170 is_nullable: 1
171
be2f7678
MG
172Source code of verifier if using the Verifier runner
173
4ed3f8e7
MG
174=cut
175
176__PACKAGE__->add_columns(
177 "id",
178 { data_type => "text", is_nullable => 0 },
179 "author",
85d3f015 180 { data_type => "text", is_nullable => 1 },
6a03bf0d
MG
181 "writer",
182 { data_type => "text", is_nullable => 1 },
4ed3f8e7 183 "generator",
9bb39921 184 { data_type => "text", is_nullable => 0 },
4ed3f8e7 185 "judge",
9bb39921 186 { data_type => "text", is_nullable => 0 },
4ed3f8e7 187 "level",
9bb39921 188 { data_type => "text", is_nullable => 0 },
4ed3f8e7
MG
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",
b2725d9d 196 { data_type => "boolean", default_value => \"false", is_nullable => 0 },
4ed3f8e7 197 "runner",
9bb39921 198 { data_type => "text", is_nullable => 0 },
1980106a
MG
199 "solution",
200 { data_type => "text", is_nullable => 1 },
4ed3f8e7
MG
201 "statement",
202 { data_type => "text", is_nullable => 0 },
203 "testcnt",
204 { data_type => "integer", is_nullable => 0 },
f7c095d3
MG
205 "precnt",
206 { data_type => "integer", is_nullable => 1 },
b2725d9d
MG
207 "tests",
208 { data_type => "text", is_nullable => 1 },
4ed3f8e7
MG
209 "timeout",
210 { data_type => "real", is_nullable => 0 },
211 "value",
aaa9eb7d 212 { data_type => "integer", is_nullable => 0 },
85d3f015
MG
213 "genformat",
214 { data_type => "text", is_nullable => 1 },
215 "gensource",
216 { data_type => "text", is_nullable => 1 },
4ed3f8e7
MG
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 opens
268
269Type: has_many
270
271Related object: L<Gruntmaster::Data::Result::Open>
272
273=cut
274
275__PACKAGE__->has_many(
276 "opens",
277 "Gruntmaster::Data::Result::Open",
278 { "foreign.problem" => "self.id" },
279 { cascade_copy => 0, cascade_delete => 0 },
280);
281
282=head2 owner
283
284Type: belongs_to
285
286Related object: L<Gruntmaster::Data::Result::User>
287
288=cut
289
290__PACKAGE__->belongs_to(
291 "owner",
292 "Gruntmaster::Data::Result::User",
293 { id => "owner" },
9bb39921 294 { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
4ed3f8e7
MG
295);
296
adb42d4d
MG
297=head2 problem_statuses
298
299Type: has_many
300
301Related object: L<Gruntmaster::Data::Result::ProblemStatus>
302
303=cut
304
305__PACKAGE__->has_many(
306 "problem_statuses",
307 "Gruntmaster::Data::Result::ProblemStatus",
308 { "foreign.problem" => "self.id" },
309 { cascade_copy => 0, cascade_delete => 0 },
310);
311
4ed3f8e7
MG
312=head2 contests
313
314Type: many_to_many
315
316Composing rels: L</contest_problems> -> contest
317
318=cut
319
320__PACKAGE__->many_to_many("contests", "contest_problems", "contest");
321
322
f7c095d3
MG
323# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-02-14 09:42:26
324# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sc9vhXkFlp0UaLK7w0OUXA
4ed3f8e7 325
de7226ca
MG
326use Class::Method::Modifiers qw/after/;
327
328after qw/insert update delete/ => sub {
329 my ($self) = @_;
330 Gruntmaster::Data::purge '/pb/';
331 Gruntmaster::Data::purge '/pb/' . $self->id;
78c794d6 332 Gruntmaster::Data::purge '/sol/' . $self->id;
de7226ca
MG
333};
334
4a8747ef
MG
335sub rerun {
336 $_->rerun for shift->jobs
337}
4ed3f8e7 338
4ed3f8e7 3391;
4a8747ef
MG
340
341__END__
342
343=head1 METHODS
344
4a8747ef
MG
345=head2 rerun
346
347Reruns all jobs for this problem.
348
349=head1 AUTHOR
350
351Marius Gavrilescu E<lt>marius@ieval.roE<gt>
352
353=head1 COPYRIGHT AND LICENSE
354
355Copyright (C) 2014 by Marius Gavrilescu
356
357This library is free software; you can redistribute it and/or modify
358it under the same terms as Perl itself, either Perl version 5.18.1 or,
359at your option, any later version of Perl 5 you may have available.
360
361
362=cut
This page took 0.071494 seconds and 4 git commands to generate.