forked from boru-roylu/simple_ta_helper
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun_by_stuid.sh
executable file
·58 lines (45 loc) · 1.44 KB
/
run_by_stuid.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
58
#! /bin/bash
if [ $# -lt 2 ]; then
echo "Usage:"
echo "$0 [student id] [repo url list] [delay deadline (optional)]"
echo ""
echo "./run_by_stuid.sh b01999001 repolist"
echo "or ./run_by_stuid.sh b01999001 repolist \"2016-01-01 00:00:00\""
echo ""
echo "Description:"
echo " Run by student id"
echo " If you don't give the delay deadline, it will NOT pull anything from github."
echo " On the other hand, if you give the delay deadline, it will remove the original student's code, pull it again and checkout to the latest commit before delay deadline."
echo ""
exit
fi
stu_id=$1 # stu_id must be above config
. config
. program_config
if [ "$3" != "" ]; then
git_pull=true
repolist=$2
delay_time="$3"
else
git_pull=false
repolist=$2
delay_time=""
fi
repo_name=`grep ${stu_id,,} $repolist | cut -d',' -f 2,2`
echo "student id: $stu_id"
echo "repo name: $repo_name"
echo "============================================================================="
echo
echo
./grade.sh ${stu_id,,} $repo_name $git_pull "$delay_time"
cd $save_dir/$course/$hw/code/${stu_id,,}
[ -d $hw ] && cd $hw
[ -d ${hw,,} ] && cd ${hw,,}
echo "=============================Error for run.sh============================="
cat $save_dir/$course/$hw/err/${stu_id,,}
echo
echo
echo "=============================Error for eval.sh============================="
cat $save_dir/$course/$hw/err2/${stu_id,,}
echo
echo