X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=inline;f=mop%2Fscore%2Fmo-score-mop.sh;h=fc6c6a297783f767c2278a1f7c744bb008b0d51b;hb=41ffdd8c7e534f484eb8e8e825cb9bc2dee8719e;hp=763d3dc9643ef89f73d188780080a960576033d6;hpb=c93b2dc30d1c0d13405a347b5c7a6bb5b5ba09c4;p=moe.git 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 {