]> iEval git - gruntmaster-page.git/commitdiff
Show full names and usernames in standings
authorMarius Gavrilescu <marius@ieval.ro>
Fri, 28 Feb 2014 07:41:40 +0000 (09:41 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Fri, 28 Feb 2014 07:41:40 +0000 (09:41 +0200)
lib/Gruntmaster/Page/St.pm

index 407e87a09dfce80b9ab3517ecf9d3eb64e32577f..562e4678cc2ab085ad24e247e8e635dd2cba06f0 100644 (file)
@@ -27,6 +27,14 @@ sub calc_score{
        int $score + 0.5
 }
 
+sub usname ($) {
+       local $Gruntmaster::Data::contest;
+       my $user = shift;
+       my $name = user_name $user;
+       "$name ($user)"
+}
+
+
 sub _generate{
        my ($self, $htc, $lang, $env, $ct) = @_;
        debug $env => "language is '$lang' and contest is '$ct'";
@@ -58,7 +66,7 @@ sub _generate{
        my @st = sort { $b->{score} <=> $a->{score} or $a->{user} cmp $b->{user}} map {
                my $user = $_;
                +{
-                       user => user_name $user,
+                       user => usname $user,
                        score => sum (values $scores{$user}),
                        scores => [map { $scores{$user}{$_} // '-'} @problems],
                        problems => $Gruntmaster::Data::contest,
This page took 0.018021 seconds and 4 git commands to generate.