... | @@ -14,46 +14,6 @@ Add a new Duty (mostly self-explained): |
... | @@ -14,46 +14,6 @@ Add a new Duty (mostly self-explained): |
|
- This script should print to stdout a status code ('1': success, '2': fail, '3': points). Code '3' must be followed by the number of obtained points (in a new line). Each code may be followed by a message to the student (starting in a new line after codes '1' and '2'; starting in a new line after the points in case of code '3').
|
|
- This script should print to stdout a status code ('1': success, '2': fail, '3': points). Code '3' must be followed by the number of obtained points (in a new line). Each code may be followed by a message to the student (starting in a new line after codes '1' and '2'; starting in a new line after the points in case of code '3').
|
|
- This script must execute student's solution externally using the following script (e.g. execute_student.sh):
|
|
- This script must execute student's solution externally using the following script (e.g. execute_student.sh):
|
|
|
|
|
|
~~~ { .bash }
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Exit immediately if a command exits with a non-zero status.
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Set paths to test areas.
|
|
|
|
# Example local config file:
|
|
|
|
# testarea_local=/tmp
|
|
|
|
# testarea=/tmp
|
|
|
|
# savetest=
|
|
|
|
source config
|
|
|
|
|
|
|
|
# First parameter is the stunedt's script that is to be executed.
|
|
|
|
scripttoexecute="$1"
|
|
|
|
# Second parameter is the input to the student's script.
|
|
|
|
testinput="$2"
|
|
|
|
|
|
|
|
# Copy student's script and input to the safe test area.
|
|
|
|
cp "$scripttoexecute" "$testinput" $testarea
|
|
|
|
chmod +rx "$testarea/$(basename $scripttoexecute)"
|
|
|
|
|
|
|
|
# Execute the student's script in the safe test area.
|
|
|
|
$savetest python -B $testarea_local/"$(basename $scripttoexecute)" $testarea_local/"$(basename $testinput)"
|
|
|
|
# '$?' returns the last executed command's return value. Store it ant return at the end.
|
|
|
|
ret=$?
|
|
|
|
|
|
|
|
# Clean up/
|
|
|
|
rm -f $testarea/"$(basename $scripttoexecute)" $testarea/"$(basename $testinput)"
|
|
|
|
|
|
|
|
exit $ret
|
|
|
|
~~~
|
|
|
|
|
|
|
|
config file:
|
|
|
|
~~~ { .bash }
|
|
|
|
testarea_local=/testarea
|
|
|
|
testarea=/srv/test-labgroup/$testarea_local
|
|
|
|
savetest="sudo -u tester_labgroup -- schroot -d /testarea -c testarea-labgroup --"
|
|
|
|
~~~
|
|
|
|
|
|
|
|
## Enable automatic evaluation.
|
|
## Enable automatic evaluation.
|
|
|
|
|
|
6. Copy to `inhander_youruser@dodo ~/testscripts/<COURSE>/<RELPATH>` (RELPATH given in point 2) all files from point 5 and test cases with correct outputs (generated with a script from point 4).
|
|
6. Copy to `inhander_youruser@dodo ~/testscripts/<COURSE>/<RELPATH>` (RELPATH given in point 2) all files from point 5 and test cases with correct outputs (generated with a script from point 4).
|
... | @@ -62,5 +22,13 @@ savetest="sudo -u tester_labgroup -- schroot -d /testarea -c testarea-labgroup - |
... | @@ -62,5 +22,13 @@ savetest="sudo -u tester_labgroup -- schroot -d /testarea -c testarea-labgroup - |
|
9. Set Isevaluate for duty.
|
|
9. Set Isevaluate for duty.
|
|
|
|
|
|
## Examples.
|
|
## Examples.
|
|
|
|
*tester.py* is the actual script called from inhander
|
|
- [Validation protocol for ADB.](https://frosch.cosy.sbg.ac.at/mpawlik/adb-2016ws/tree/master/labs/src/validation-protocol) |
|
|
|
\ No newline at end of file |
|
* [tester.py](/uploads/976599f0dec8016fa83576f0f84bdc6d/tester.py)
|
|
|
|
* [config](/uploads/3fa1d04f733173c4dc2775b7430088bb/config)
|
|
|
|
* [create_input_output.py](/uploads/4b086181a756e94a11c8084826405674/create_input_output.py)
|
|
|
|
* [execute_student.sh](/uploads/7a76b77791605073a5ae5eb495daa01c/execute_student.sh)
|
|
|
|
* [generate_tests.py](/uploads/631727109a18916dd675f61c3faaff96/generate_tests.py)
|
|
|
|
* [sample-input.txt](/uploads/1abfd8e70a144f756e19b3de3eec14db/sample-input.txt)
|
|
|
|
* [tester.py](/uploads/8f8d3ec81879bd45fadb607211b8f270/tester.py)
|
|
|
|
* [validate.py](/uploads/50197252ea98e21eb5ec2de442933ad6/validate.py) |
|
|
|
\ No newline at end of file |