-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·34 lines (26 loc) · 899 Bytes
/
run.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
#!/usr/bin/env bash
# #activate venv
# source env/bin/activate
PYTHON=python
PIP=pip
$PYTHON --version
# (optional) install any requirements of your current app in this venv
$PIP install -r requirements.txt $FLAGS > /dev/null
if [[ $(ls -1 correction/proposed_answers/ | wc -l | tail -c 2) = '0' ]]; then
echo "No answer files detected at $(pwd)/correction/proposed_answers. Exiting."
else
for f in correction/proposed_answers/*; do
echo "Answer file detected: $f..."
echo "Processing..."
QUESTION_COLUMN=$(basename "$f" | cut -d. -f1)
ANSWER_FILE_NAME_NO_EXTENSION=$(basename "$f" | cut -d. -f1)
$PYTHON batch_sql_corrector.py \
"$(pwd)/correction/script-students.sql" \
"$(pwd)/correction/script-correction.sql" \
"$(pwd)/correction/student_answers.xlsx" \
"$QUESTION_COLUMN" \
"$f" > "Results/$ANSWER_FILE_NAME_NO_EXTENSION.txt" &
done
fi
wait
echo "All done"