Execution files
Introduction
Here you set the files that are needed to prepare the execution, debug or assessment of a submission. This includes scripting files, program test files and data files.
Default script to run or debug
If you don't set script files for run or debug submissions, the system will resolve the language you use (based on file name extensions) and use a predefined script. The following table show the languages supported, the filename extension used, the scripts available and compiler/interpreter/debugger used by the script.
Language | File name extension |
run | debug | Compiler/ interpreter |
Comment |
---|---|---|---|---|---|
Ada | ada, adb, ads | X | X | gnat (Ada 2005)/gdb | Use first file as main |
C | c | X | X | gcc C99/gdb | Compile all source files |
C++ | cpp, C | X | X | g++/gdb | Compile all source files |
C# | cs | X | X | gmcs+mono/mdb | Compile all soruce files |
Fortran | f, f77 | X | X | gfortran/gdb | Compile all source files |
Haskell | hs | X | hugs | Run first file | |
Java | java | X | X | javac+java/jdb | Compile all source files. Locate main file |
Matlab/Octave | m | X | - | matlab, octave | Run first file. Use vpl_replot after drawing. |
Pascal | pas, p | X | X | fpc or gpc/gdb | Compile firtst file (fpc) or all source files (gpc) |
Perl | perl, prl | X | X | perl | Run first file. |
PHP | php | X | - | php5 | Run first file. |
Prolog | pl, pro | X | - | swipl | Run first file. |
Python | py | X | X | python | Run first file. |
Ruby | rb | X | X | ruby | Run first file. |
Scheme | scm, s | X | - | mzscheme | Run first file. |
Shell script | sh | X | - | bash | Run first file. |
SQL | sql | X | - | sqlite3 | Run all source files. First execution files |
VHDL | vhd, vhdl | X | - | ghdl | Compile all source files, the first must have the Main method. |
Automatic evaluation
The VPL 1.4 incorporates a feature to facilitate the evaluation of student's submissions. This feature allows to run the student program and check its output for a given input. To set up the evaluation cases you must populate the file "vpl_evaluate.cases".
The file "vpl_evaluate.cases" has the following format:
- "case = Description of case": Optional. Set an start of test case definition.
- "input = text": can use several lines. Ends with other instruction.
- "output = text": can use several lines. Ends with other instruction. A case can have differents correct output. There are three types of output: numbers, text and exact test:
- number: defined as sequence of numbers (integers and floats). Only numbers in the output are checked, other text are ignored. Floats are checked with tolerance
- text: defined as text without double quote. Only words are checked and the rest of chars are ignored, the comparation is case-insensitive
- exact text: defined as text into double quote. The exact match is used to test the output.
- "grade reduction = [value|percentage%]" : By default an error reduces student's grade (starts with maxgrade) by (grade_range/number of cases) but with this instruction you can change the reduction value or percentage.
General use
A new file can be added by writing its name in the box "Add file" and then clicking on the button "Add file".
An existing file can be uploaded by means of the "Upload file".
All the added or uploaded files can be edited, and all of them, except the three scripting files mentioned below, can be renamed or deleted.
Manual run, execute or evaluation
Three scripting files to prepare each of the actions may be set. These files have predefined names: vpl_run.sh (execution), vpl_debug.sh (debug) and vpl_evaluate.sh (assessment).
The execution of any of those scripting files should generate a file named vpl_execution. This file must be a binary executable or a script beginning with "#!/bin/sh ". The non-generation of this file impedes to run the selected action.
If the activity that you are configuring is "based on" other activity, the files of the base activity are added automatically. The contents of the vpl_run.sh, vpl_debug.sh and vpl_evaluate.sh files are concatenated from the deepest level of "based on" to the current.
Finally, the file vpl_environment.sh is automatically added. This scripting file contain information about the submission. The information come as environment variables:
- LANG: used language.
- LC_ALL: same value as LANG.
- VPL_MAXTIME: maximum execution time in seconds.
- VPL_FILEBASEURL: URL to access the files of the course.
- VPL_SUBFILE#: each name of the files submitted by the student. # Ranges from 0 to number of submitted files.
- VPL_SUBFILES: list of all submitted files.
- VPL_VARIATION + id: where id is the variation order starting with 0 and the value is the value of the variation.
- VPL_MAXTIME: max time of execution in seconds.
- VPL_MAXMEMORY: max memmory usable
- VPL_MAXFILESIZE: max file size in byte that can be create.
- VPL_MAXPROCESSES: max number of procceses that can be run simultaneous.
- VPL_FILEBASEURL: URL to the course files.
- VPL_GRADEMIN: Min grade for this activity
- VPL_GRADEMAX: Max grade for this activity
Assessment result
Evaluation output is processed to extract, if possible, comments and a proposed grade for the assessment. Comments can be set in two ways: with a line comment defined by a line beginning with 'Comment :=>>' or with block comments starting with a line containing only '<|--' and ending with a line containing only '--|>'. The grade is taken from the last line that begins with 'Grade :=>>'.