]> mj.ucw.cz Git - moe.git/blob - bin/mo-report
Implemented translation of FPC runtime errors to readable strings.
[moe.git] / bin / mo-report
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5 use POSIX;
6
7 foreach my $user (`cd testing && ls`) {
8         chomp $user;
9         print "$user:";
10         open REP, ">testing/$user/REPORT" or die;
11         print REP "Evaluation report for CEOI 2007 Day 1\n\n";
12         my $total = 0;
13         foreach my $task (@ARGV) {
14                 print REP "### Task $task ###\n\n";
15                 if (open PTS, "testing/$user/$task/points") {
16                         my $tt = 0;
17                         while (<PTS>) {
18                                 chomp;
19                                 my ($test, $pts, $comm) = /(\S+)\s+(\S+)\s+(.*)/;
20                                 $comm =~ s/\.$//;
21                                 printf REP "Test %2s: %2d points (%s)\n", $test, $pts, $comm;
22                                 $tt += $pts;
23                         }
24                         close PTS;
25                         print REP "\nTOTAL: $tt points\n\n";
26                         $total += $tt;
27                         print " $tt";
28                 } else {
29                         print REP "No solution submitted.\n\n";
30                         print " -";
31                 }
32         }
33         print REP "### TOTAL FOR DAY 1 ###\n\n";
34         print REP "$total points\n";
35         print REP "\n\n(generated on ", strftime("%Y-%m-%d %H:%M:%S", localtime), ")\n";
36         close REP;
37         print " -> $total\n";
38 }