]> iEval git - gruntmaster-data.git/blobdiff - lib/Gruntmaster/Data/Result/Contest.pm
Add non-DBIC versions of all methods and a benchmark script
[gruntmaster-data.git] / lib / Gruntmaster / Data / Result / Contest.pm
index 4ea2f1ae988f189b76d074073c06105b9940ba47..453982bf8709d7dadcd4467759b075dd37ca6c7a 100644 (file)
@@ -33,6 +33,20 @@ __PACKAGE__->table("contests");
   data_type: 'text'
   is_nullable: 0
 
+=head2 editorial
+
+  data_type: 'text'
+  is_nullable: 1
+
+HTML fragment placed before the editorial
+
+=head2 description
+
+  data_type: 'text'
+  is_nullable: 1
+
+HTML fragment placed on contest page
+
 =head2 start
 
   data_type: 'integer'
@@ -60,6 +74,10 @@ __PACKAGE__->add_columns(
   { data_type => "text", is_nullable => 0 },
   "name",
   { data_type => "text", is_nullable => 0 },
+  "editorial",
+  { data_type => "text", is_nullable => 1 },
+  "description",
+  { data_type => "text", is_nullable => 1 },
   "start",
   { data_type => "integer", is_nullable => 0 },
   "stop",
@@ -168,8 +186,8 @@ Composing rels: L</contest_problems> -> problem
 __PACKAGE__->many_to_many("problems", "contest_problems", "problem");
 
 
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-19 16:54:00
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IxxZqQwKisBwDabCNUD55Q
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-02-14 10:52:58
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:UTfqBbyhmo0r1HyWtGXidA
 
 use Class::Method::Modifiers qw/after/;
 use List::Util qw/sum/;
@@ -210,10 +228,10 @@ sub standings {
        my ($self) = @_;
        my $ct = $self->id;
 
-       my @problems = map { $_->rawproblem } $self->contest_problems->search({contest => $ct}, {qw/join problem order_by problem.level/});
+       my @problems = map { $_->rawproblem } $self->contest_problems->search({contest => $ct}, {qw/join problem order_by problem.value/});
        my (%scores, %tries, %opens);
        $opens{$_->rawproblem, $_->rawowner} = $_ for $self->opens->search({contest => $ct});
-       for my $job ($self->jobs->search({contest => $ct}, {qw/order_by me.id prefetch/ => [qw/problem/]})) {
+       for my $job ($self->jobs->search({contest => $ct, result => {'!=', undef}}, {qw/order_by me.id prefetch/ => [qw/problem/]})) {
                my $open = $opens{$job->rawproblem, $job->rawowner};
                my $time = $job->date - ($open ? $open->time : $self->start);
                next if $time < 0;
This page took 0.022928 seconds and 4 git commands to generate.