-
Notifications
You must be signed in to change notification settings - Fork 1
/
eval.sh
executable file
·57 lines (47 loc) · 1.54 KB
/
eval.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
export LC_CTYPE="C"
CURR_DIR=$( pwd )
TEACHER_TOOLS_DIR=$1
PO_HW_DIR=$2
LAST_HW_NO=$3
EVALUATOR=$CURR_DIR/$TEACHER_TOOLS_DIR/elsys_tools/homework/evaluator.py
BASE_TEST_CASE_DIR=$CURR_DIR/$TEACHER_TOOLS_DIR/data/evaluator/scenarios
ONLY_ONE_HW=$4
if [ -z "$ONLY_ONE_HW" ]; then
ONLY_ONE_HW=0
fi
if [ -z "$TEACHER_TOOLS_DIR" -o -z "$PO_HW_DIR" -o -z "$LAST_HW_NO" ]; then
echo "Not all arguments supplied"
echo "Example usage of the program: "
echo " ./eval.sh /Volumes/Data/elsys/elsys-teachers-tools /Volumes/Data/elsys/po-homework 05"
echo "NOTE: The number provided is the number of the last homework"
exit 1
fi
for letter in "A" "B" "V" "G"
do
echo $letter
if [ "$letter" == "A" -o "$letter" == "B" ]; then
TEST_CASE_DIR=$BASE_TEST_CASE_DIR/A_B_class
fi
if [ "$letter" == 'V' -o "$letter" == 'G' ]; then
TEST_CASE_DIR=$BASE_TEST_CASE_DIR/V_G_class
fi
currEvalHomework=$LAST_HW_NO
cd $CURR_DIR/$PO_HW_DIR/$letter
for hw in `seq 0 2`; # This passes 3 times - 0, 1, 2
do
TOML_DIR=$TEST_CASE_DIR"$( printf "/%02d.toml" $((10#$currEvalHomework)))"
for i in `seq 1 29`;
do
hwPath="$( printf "%02d/%02d" $((10#$currEvalHomework)) $((10#$i)))"
#echo $hwPath
if [ -d "$hwPath" ]; then
python $EVALUATOR $hwPath $TOML_DIR -l DEBUG
fi
done
currEvalHomework=$((currEvalHomework-1))
if [ $currEvalHomework -lt 1 -o $ONLY_ONE_HW -eq 1 ]; then
break
fi
done
done