Variable Substitutions
From PC2wiki
PC² features variable substitutions in a number of locations to provide flexibility in configuring Language and Problem definitions.
Contents |
[edit]
Location
- Administrator module, Edit Language
- Administrator module, Edit Problem, General Tab
- Administrator module, Edit Problem, Validator Tab
[edit]
Variable Format
Each variable name is preceded by a open curly brace and colon and ended with a closing curly brace. In the examples that follow each of the variables is shown as it would be placed in the field.
[edit]
List of Variables
This table's examples assume an input file of hello.c submitted by team 4 at site 5.
| Name | Description | Example |
|---|---|---|
{:basename} | Name of file without extension | hello |
{:mainfile} | Name of file | hello.c |
{:teamid} | Team Number | 4 |
{:siteid} | Site Number | 5 |
{:language} | Language | Java-7008022922832958176 |
{:problem} | Problem Number | A-6037680426662657684 |
{:timelimit} | Problem time limit | 120 |
[edit]
Post Execution Variables
| Name | Description | Example |
|---|---|---|
{:exitvalue} | Exit/return value of submitted program | |
{:executetime} | Execution time in ms |
The exit value is Operating System dependent and should be very well tested before relying on the value (if at all).
[edit]
Validator Variables
This table's examples assume a data file: sumit.dat, a answer file: sumit.ans, and a validator of gvim.
| Name | Description | Example |
|---|---|---|
{:validator}
| Represents the file name given in the Validator Program box. Note that it is not a required that the 'validator program' actually be an executable program; it could for example be a text file. | gvim |
{:infile}
| Represents the problem data input file as configured in the problem. | sumit.dat |
{:outfile}
| Represents the output sent to stdout by the team program when it was executed by the judge. | |
{:ansfile}
| Represents the judge’s answer file as configured in problem. | sumit.ans |
{:resfile}
| Specifies the name of the file into which an active validator must place an XML representation of the judgement. |
[edit]
