From 483c33bc252dfc17249dcfb1449a9c187a7e89f4 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sat, 28 Mar 2009 14:15:25 +0100 Subject: [PATCH] mo-score-mop: implemented merging of test case groups --- mop/score/mo-score-mop.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/mop/score/mo-score-mop.sh b/mop/score/mo-score-mop.sh index 763d3dc..fc6c6a2 100755 --- a/mop/score/mo-score-mop.sh +++ b/mop/score/mo-score-mop.sh @@ -26,7 +26,7 @@ close CT; print STDERR 0+keys %users, "\n"; print STDERR "Scanning teoretical results... "; -if (open (EX, "../mop/score/teorie.txt")) { +if (open (EX, "mop/score/teorie.txt")) { while () { chomp; (/^$/ || /^#/) && next; @@ -59,10 +59,17 @@ foreach $u (keys %users) { -f $tt || next; print STDERR "$u/$t "; open (X, $tt) || die "Unable to open $tt"; + + my %tests = (); while () { chomp; - /^\S+ (-?\d+)/ || die "Parse error: $_"; - $tasks{$u}{$t_num} += $1; + /^(\S+) (-?\d+)/ || die "Parse error: $_"; + my ($t, $p) = ($1, $2); + $t =~ s/[^0-9]//g; + $tests{$t} = $p if not exists $tests{$t} or $tests{$t} > $p; + } + foreach my $p (values %tests) { + $tasks{$u}{$t_num} += $p; } close X; } @@ -124,13 +131,13 @@ while ($i < @table) { print STDERR "OK\n"; if ($tex) { - open HDR,"../mop/score/listina.hdr" or die "Cannot open file ../mop/score/listina.hdr with TeX template!"; + open HDR,"mop/score/listina.hdr" or die "Cannot open file mop/score/listina.hdr with TeX template!"; while () {print; } close HDR; foreach $r (@table) { print join('&',@$r), "\\cr\n";} - open FTR,"../mop/score/listina.ftr" or die "Cannot open file ../mop/score/listina.ftr with TeX template!"; + open FTR,"mop/score/listina.ftr" or die "Cannot open file mop/score/listina.ftr with TeX template!"; while () {print; } close FTR; } else { -- 2.39.2