X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=mop%2Fscore%2Fmo-score-mop.sh;h=fc6c6a297783f767c2278a1f7c744bb008b0d51b;hb=11ea8e933d3a8d827da650898c277424e64f2040;hp=c20770652821d647c0b5eb7adfdda7c5c6d891c1;hpb=fc833e30d9b1315ffdeb780d5257e8e1bdafad43;p=moe.git diff --git a/mop/score/mo-score-mop.sh b/mop/score/mo-score-mop.sh index c207706..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/teorie.txt")) { +if (open (EX, "mop/score/teorie.txt")) { while () { chomp; (/^$/ || /^#/) && next; @@ -41,7 +41,7 @@ if (open (EX, "mop/teorie.txt")) { } close EX; print STDERR "OK\n"; -} else {die "none, cannot find file mop/teorie.txt!\n";} +} else {die "none, cannot find file teorie.txt!\n";} print STDERR "Scanning task results... "; $need_tasks = join("|", @ARGV); @@ -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/listina.hdr" or die "Cannot open file mop/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/listina.ftr" or die "Cannot open file mop/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 {