2 # A simple generator of evaluation reports
3 # (c) 2007 Martin Mares <mj@ucw.cz>
9 foreach my $user (`cd testing && ls`) {
12 open REP, ">testing/$user/REPORT" or die;
13 print REP "Evaluation report for CEOI 2007 Day 2\n\n";
15 foreach my $task (@ARGV) {
16 print REP "### Task $task ###\n\n";
17 if (open PTS, "testing/$user/$task/points") {
22 my ($test, $pts, $comm) = /(\S+)\s+(\S+)\s+(.*)/;
24 $merged =~ s/[^0-9]//;
25 if (!defined($merged_pts{$merged}) || $merged_pts{$merged} > $pts) {
26 $merged_pts{$merged} = $pts;
28 $split_comm{$merged}{$test} = $comm;
32 foreach my $merged (sort { $a <=> $b } keys %merged_pts) {
33 printf REP "Test %2s: %2d points", $merged, $merged_pts{$merged};
34 $tt += $merged_pts{$merged};
35 my @k = sort keys %{$split_comm{$merged}};
37 print REP " -- ", $split_comm{$merged}{$k[0]}, "\n";
42 $cc++ and print REP ", ";
43 print REP "$t: $split_comm{$merged}{$t}";
48 print REP "\nTOTAL: $tt points\n\n";
52 print REP "No solution submitted.\n\n";
56 print REP "### TOTAL FOR DAY 2 ###\n\n";
57 print REP "$total points\n";
58 print REP "\n\n(generated on ", strftime("%Y-%m-%d %H:%M:%S", localtime), ")\n";