Commit 087adb49 authored by Olivier's avatar Olivier
Browse files

Module 7: generate grading assignments

In this module, a bash script assembles several PDF files, ready
to be graded by each peer:
* one complete worked-out template solution,
* the peer’s submission which needs to be graded,
* a grading form that can be filled in.
parent ff7ab923
# Input parameters
# Prepare output folder
mkdir -v $outputfolder/done
# Copy input into the output folder, change directory to output folder
cp -vrf $inputfolder/* $outputfolder/
cd $outputfolder
# Copy grading form to work folder (it’s the same file for all )
cp -v form/gradingform.pdf ./form.pdf
# Pick up all the files in input subfolder one by one
for submissionpdf in submissions/*.pdf; do
# Extract IDG code from submission pdf file name
IDG=$(echo "$submissionpdf" | sed -r 's/submissions\///' | sed -r 's/\.pdf//')
echo "#"
echo "#"
echo "building assignment PDF for $IDG …"
mv -v solutions/solution1_$IDG.pdf ./solution.pdf
mv -v submissions/$IDG.pdf ./submission.pdf
# Concatenate all three PDFs that we have together now
# Note that pdftk is not available by default on Ubuntu 18.04,
# see for workaround install
pdftk A=solution.pdf B=submission.pdf C=form.pdf cat A B C output done/$IDG.pdf
# When the file returns filled from each student, we may use
# the following command to get only the last page
#pdftk returnfile_filled.pdf cat r1 output onlythefilledform.pdf
echo "#"
echo "#"
echo "#"
echo "done building PDFs"
# Cleanup: remove temporary folders
rm -rvf form solutions submissions form.pdf solution.pdf submission.pdf
cd ../
echo "end of script."
# Input parameters
timestamp=$(date "+%Y-%m-%d+%H%M%S")
# Create archive of output folder
mkdir -vp archives
tar -cvf $outputbackupname --exclude=old $outputfolder
mv -vf $outputbackupname archives/
tar -cvf $inputbackupname --exclude=old $inputfolder
mv -vf $inputbackupname archives/
# Import output of M3 and M5 into input of M7
rsync -avh --delete ../M5_collect_submissions/renamed\ pdfs/ $inputfolder/submissions/
rsync -avh --delete ../M3_generate_assignments/script_output/solution* $inputfolder/solutions/
# Clear output folder
rm -rvf $outputfolder/*
echo "end of script."
......@@ -21,7 +21,7 @@ The code in this repository is published under the [GNU GPL v3](href="https://ww
## Structure
A total of nine modules (six of which being locally-run scripts) are needed to run the project.
A total of ten modules (eight of which being locally-run scripts) are needed to run the project.
[ ] Module 1: Collect participant information
(through email)
......@@ -41,11 +41,14 @@ A total of nine modules (six of which being locally-run scripts) are needed to r
[x] [Module 6](M6_match_peers): Match peers
(in Python)
[ ] Module 7: Send peer grading assignments
[x] [Module 7](M7_generate_grading): Generate grading assignments
(in bash, with pdftk)
[ ] Module 8: Send peer grading assignments
(in Python)
[ ] Module 8: Process grades
[ ] Module 9: Process grades
(in Python)
[ ] Module 9: Send results to students
[ ] Module 10: Send results to students
(in Python)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment