Newer
Older
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
#!/bin/bash
CS=/home/xgb21195/teaching/cs101
TOK=`cat ~/.gitlab`
mark1 () {
date 1>&2
echo "Marking Assignment 1 for ${dsname}" 1>&2
echo "Marking Assignment 1"; echo
marks=0
nfiles=`find . -type f | sed '/^\.\/\./d' | wc -l`
find . -type f | sed '/^\.\/\./d' | while read f; do
touch ${marking}/assignment-1.files
if grep -q 'I am the psychotherapist. Please, describe your problems.' "$f"; then
touch ${marking}/assignment-1.emacs
fi
done
if test -f ${marking}/assignment-1.files; then
echo " Found some files... 20/20 marks"
marks=20
else
echo " Found no files... 0/20 marks"
fi
if test -f ${marking}/assignment-1.emacs; then
echo " Found an interaction with the Emacs doctor... 10/10 marks"
marks=$(($marks + 10))
else
echo " Found no interaction with the Emacs doctor... 0/10 marks"
fi
echo
echo "${marks}/30 marks in total"
echo "${marks} marks" 1>&2
}
dsname="$1"
student="${CS}/students/${dsname}"
marking="${CS}/marking/${dsname}"
mark1