forked from krakowski/ilias-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload_feedbacks.bash
executable file
·56 lines (41 loc) · 1.54 KB
/
upload_feedbacks.bash
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
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "expected BlattNN as only argument"
exit -1
fi
ilias_tool="../../ilias-linux"
exercise_sheet_foldername="$1"
for zipfile in `ls *zip`; do
unzip $zipfile -d `basename $zipfile .zip` > /dev/null
done
# runs check.bash for every corrector first
correctors=`grep ":" workspace.yml | grep "^ " | grep -vE "reference|assignment" | sed -E "s/ |://g"`
for corrector in $correctors; do
echo check corrections for $corrector
cp check.py $corrector/$exercise_sheet_foldername/
cd $corrector/$exercise_sheet_foldername
if [ $? -eq 0 ]; then
chmod +x check.py
./check.py
cd ../..
else
echo [E] could not cd to $corrector/$exercise_sheet_foldername
fi
done
# check that we have not lost any submissions (count the IDs from the workspace and the number of Korrektur.pdf files)
echo `grep "-" workspace.yml | wc -l` submissions
echo `find . -mindepth 3 -maxdepth 3 -type d | wc -l` corrections
# then workspace upload <korrektorkennung> to upload the feedback files and points for each corrector
# these won't be available once the script exited
echo "If everything is okay, we want to upload the feedback files for the students"
read -p "Enter your username: " user
read -p "Enter your password: " -s pass
export ILIAS_USER="$user"
export ILIAS_PASS="$pass"
for corrector in $correctors; do
echo upload feedback files from $corrector
cd $corrector/$exercise_sheet_foldername
$ilias_tool workspace upload $corrector
cd ../..
done
exit 0