Vocareum manages the grading of an assignment on our system and offers multiple options to the teacher. The most flexible path is to write custom bash shell scripts.
Scripts are executed in a copy of a student submission. The scripts generate the grades in a CSV file which are then processed by the platform.
A simple grading script for Python would be setup as follows:
Within the /startercode directory we have placed a simple test.py file where you will place the example code to print 'Hello World' to then be graded
# print hello world
print('hello world')
Navigate to resource/scripts/grade.sh where you will place your grading script
python test.py > output1.txt
echo "hello world" > generated_output.txt
diff output1.txt generated_output.txt
status=$?
if [ "$status" == "0" ]; then
echo "Correct", 5 >> $vocareumGradeFile
echo "Correct" >> $vocareumReportFile
else
echo "Incorrect", 0 >> $vocareumGradeFile
echo "Incorrect" >> $vocareumReportFile
fi
echo >> $vocareumReportFile
Terminal Output Correct
Terminal Output Incorrect