From: Martin Mares Date: Sat, 28 Mar 2009 13:15:25 +0000 (+0100) Subject: mo-score-mop: implemented merging of test case groups X-Git-Tag: python-dummy-working~110^2~3 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=483c33bc252dfc17249dcfb1449a9c187a7e89f4;p=eval.git mo-score-mop: implemented merging of test case groups --- 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 {