Verifying that students have used the public tests

This utilizes the algorithm described in AssignmentZero to force students to run public tests more than once: first to obtain a secret number, and then to confirm they've submitted the secret number.

This script should be in a subdirectory where (language external) is being applied. The contents of test.exe can be as follows, with the string in the first line changed to something else:

#!/usr/bin/env bash

secNum=`(echo "a string that should be customized each term";echo $student) | md5sum - | cut -c-9 | tr 0a-f 1-7`
if [ -e "$submitdir/secret.txt" ]; then
  if [ `grep $secNum $submitdir/secret.txt | wc -l` -gt 0 ]; then
    echo '100' >&3
    echo "The file secret.txt was submitted." >&4
  else
    echo '0' >&3
    echo "secret.txt contains the wrong secret number.  Your secret number is $secNum." >&4
  fi
else
  echo '0' >&3
  echo "The file secret.txt was not submitted; your secret number is $secNum." >&4
fi
Topic revision: r1 - 2010-01-05 - TerryVaskor
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback