]> mj.ucw.cz Git - moe.git/blob - public/status
Sorting of tasks and parts is unnecessary, they have a well-defined order.
[moe.git] / public / status
1 # The Evaluator -- Public Status Script
2 # (c) 2004 Martin Mares <mj@ucw.cz>
3
4 set -e
5 [ -n "$MO_PUBLIC" -a -d "$MO_PUBLIC" ] || { echo >&2 "MO_PUBLIC not set, giving up." ; exit 1 ; }
6 . $MO_PUBLIC/bin/lib
7 . $MO_PUBLIC/config
8
9 [ -z "$1" ] || die "Usage: status"
10
11 echo -e "Submitted tasks:\n"
12
13 for PROBLEM in `cd $MO_PUBLIC/problems/ ; echo *` ; do
14         (
15         PDIR=$MO_PUBLIC/problems/$PROBLEM
16         SUBDIR=~/.submit/$PROBLEM
17         [ -f $PDIR/config ] || exit 0
18         echo -n "$PROBLEM: "
19         . $PDIR/config
20         if [ -d $SUBDIR ] ; then
21                 if [ $TASK_TYPE == open-data ] ; then
22                         for X in $TESTS ; do
23                                 [ -f $SUBDIR/$X.out ] && echo -n "$X " || echo -n "- "
24                         done
25                         echo
26                 else
27                         C=0
28                         for X in $EXTENSIONS ; do
29                                 if [ -f $SUBDIR/$PROBLEM.$X ] ; then
30                                         echo -n `basename $SUBDIR/$PROBLEM.$X`
31                                         C=$(($C+1))
32                                 fi
33                         done
34                         if [ $C == 0 ] ; then
35                                 echo ---
36                         elif [ $C == 1 ] ; then
37                                 echo
38                         else
39                                 echo "INCONSISTENT (you probably modified $SUBDIR manually)"
40                         fi
41                 fi
42         else
43                 echo ---
44         fi
45         )
46 done