From: Martin Mares Date: Tue, 3 Jul 2007 11:55:31 +0000 (+0200) Subject: Added a simple evaluation report utility. X-Git-Tag: python-dummy-working~309 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=98e0e00dd5346665992d4fd474c12f226d22dda4;p=moe.git Added a simple evaluation report utility. --- diff --git a/bin/mo-report b/bin/mo-report new file mode 100755 index 0000000..6272ccd --- /dev/null +++ b/bin/mo-report @@ -0,0 +1,38 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use POSIX; + +foreach my $user (`cd testing && ls`) { + chomp $user; + print "$user:"; + open REP, ">testing/$user/REPORT" or die; + print REP "Evaluation report for CEOI 2007 Day 1\n\n"; + my $total = 0; + foreach my $task (@ARGV) { + print REP "### Task $task ###\n\n"; + if (open PTS, "testing/$user/$task/points") { + my $tt = 0; + while () { + chomp; + my ($test, $pts, $comm) = /(\S+)\s+(\S+)\s+(.*)/; + $comm =~ s/\.$//; + printf REP "Test %2s: %2d points (%s)\n", $test, $pts, $comm; + $tt += $pts; + } + close PTS; + print REP "\nTOTAL: $tt points\n\n"; + $total += $tt; + print " $tt"; + } else { + print REP "No solution submitted.\n\n"; + print " -"; + } + } + print REP "### TOTAL FOR DAY 1 ###\n\n"; + print REP "$total points\n"; + print REP "\n\n(generated on ", strftime("%Y-%m-%d %H:%M:%S", localtime), ")\n"; + close REP; + print " -> $total\n"; +}