Verifying Submission Method
This can be done with some support from the submit command. As there is no other convenient builtin method, it is possible to misuse submit's file_filter capability, as explained at
FileFilterSubmitMethodCheck. This article assumes the directory naming convention used there.
Say there's a directory within the
in
hierarchy called
N
. It either must inherit the external language from a parent directory, or have
(language external)
in an
options.ss
file at that level. There should also be a
test.exe
file in this directory, with contents such as the following (which can be extended if/when other submit methods become possible, such as via a button extension inside of DrScheme):
#!/usr/bin/env bash
outputdir="/u/$course/submethod_log"
method="$1"
if [ -e "$outputdir/$student.$method" ]; then
echo '100' >&3
echo '' >&4
else
echo '0' >&3
echo "No evidence of submission with $method found" >&4
fi
Then, subdirectories of
N
can contain
options.ss
files with contents like
(args "odyssey")
(desc "Detection of submission with the Odyssey web system")
or
(args "submit")
(desc "Detection of submission with the command-line submit command")
This can be of particular use in a public test for assignment 0, when students are going through an orientation with the various tools at their disposals.
An alternative which combines these into a single test can be to use a setup like the following; however, with a check for more than two items, something more clever should be done to minimize code bloat:
#!/usr/bin/env bash
outputdir="/u/$course/submethod_log"
file1="$outputdir/$student.odyssey"
file2="$outputdir/$student.submit"
if [ -e "$file1" ]; then
if [ -e "$file2" ]; then
echo '100' >&3
echo '' >&4
else
echo '50' >&3
echo 'Odyssey was used to submit the assignment, but the command line was not.' >&4
fi
elif [ -e "$file2" ]; then
echo '50' >&3
echo 'The command line was used to submit the assignment, but Odyssey was not.' >&4
else
echo '0' >&3
echo 'No evidence of submission was found.' >&4 # !????
fi
Note that the final else case should never happen. No supporting arguments from the options file are required.