From 98e0e00dd5346665992d4fd474c12f226d22dda4 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Tue, 3 Jul 2007 13:55:31 +0200 Subject: [PATCH] Added a simple evaluation report utility. --- bin/mo-report | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 bin/mo-report 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"; +} -- 2.39.2