From: Martin Mares Date: Wed, 16 May 2001 11:58:37 +0000 (+0000) Subject: Partial. X-Git-Tag: python-dummy-working~516 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=b2691cb7a4fa4a57bdc7fa60904e955e2ff03e0b;p=eval.git Partial. --- diff --git a/bin/mo-score b/bin/mo-score new file mode 100755 index 0000000..5fadeed --- /dev/null +++ b/bin/mo-score @@ -0,0 +1,52 @@ +#!/usr/bin/perl + +# Syntax: mo-score ... (one expr per column) +# where is ["title":] containing +# $user short user name +# $full full user name +# $ value in specified column +# $ total number of points for this task or failure indicator +# $: number of points per specified test + +print "Scanning contestants... "; +open (CT, "bin/mo-get-users --full |") || die "Cannot get list of contestants"; +while () { + chomp; + ($u,$f) = split /\t/; + $users{$u}=$f; +} +close CT; +print 0+keys %users, "\n"; + +print "Scanning task results... "; +foreach $u (keys %users) { + opendir (D, "testing/$u") or next; + foreach $t (readdir(D)) { + $t =~ /^\./ && next; + $tt = "testing/$u/$t/points"; + -f $tt || next; + print "$u/$t "; + open (X, $tt) || die "Unable to open $tt"; + while () { + chomp; + /^(\d+) (\d+)(.*)/ || die "Parse error: $_"; + $ttest = $1; + $tpts = $2; + $trem = $3; + $results{$u}{$t}{$ttest} = $tpts; + $remarks{$u}{$t}{$ttest} = $trem; + $cmt = ""; + if ($tpts == 0) { + $msg = $3; + if $msg =~ /^Compile / { $cmt = "CE"; } + elif $msg =~ /^Time limit exceeded/ { $cmt = "TO"; } + elif $msg =~ /^Exited with error / { $cmt = "RE"; } + elif $msg =~ /^Caught fatal signal / { $cmt = "SG"; } + } + $comment{$u}{$t}{$ttest} = $cmt; + } + close X; + } + closedir D; +} +print "OK\n";