Difference between revisions of "Contest.yaml"

From PC2wiki
Jump to: navigation, search
m (See also: rename cat)
m (See Also: add link descriptions)
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
A contest.yaml file contains information to configure a contest.
+
==Overview==
  
 +
A '''contest.yaml''' file contains information used to specify a contest configuration to PC<sup>2</sup>. Contest.yaml files are written in [https://en.wikipedia.org/wiki/YAML YAML] and can be loaded into PC<sup>2</sup> either by using the [[Load_Contest_Configuration#Using_the_pc2_server | --load]] option (when starting a PC<sup>2</sup> Server) or by selecting the '''Import contest.yaml''' button on the [[Import CCS Tab]] of the PC<sup>2</sup> Admin '''Configure Contest''' screen.
 +
 +
A contest.yaml file consists of lines containing either colon-separated key:value pairs, or a list of items (called "mappings") starting with a dash.  Whitespace (but not allowing tab characters) are used to indicate nested structure.
  
 
==Contents of contest.yaml==
 
==Contents of contest.yaml==
  
For the current [[CCS]] specification for a contest.yaml see [https://clics.ecs.baylor.edu/index.php/Contest_Control_System#contest.yaml|CCS contest.yaml]
+
For the current [[CLICS]] [[CCS]] specification for a contest.yaml file see [https://clics.ecs.baylor.edu/index.php/Contest_Control_System#contest.yaml CLICS contest.yaml]
  
 
{|border="1" cellpadding="1"
 
{|border="1" cellpadding="1"
Line 18: Line 21:
 
| duration || Duration as h:mm:ss (length of contest, in contest time)
 
| duration || Duration as h:mm:ss (length of contest, in contest time)
 
|-
 
|-
| scoreboard-freeze || Time before end of contest when scoreboard will be [[Scoreboard Freeze|frozen]] form HH:MM:SS
+
| scoreboard-freeze-length || Time before end of contest when scoreboard will be [[Scoreboard Freeze|frozen]] form HH:MM:SS
|-
 
| default-clars || Sequence of pre-defined clarification answers. The first will be pre-selected
 
|-
 
| clar-categories || Sequence of categories for clarifications.
 
 
|-
 
|-
| languages || List of mappings with keys for languages.
 
|-
 
| problemset || List of mappings with keys for problems. (see [[problem.yaml]])
 
 
|}
 
|}
  
Line 35: Line 31:
 
  # Created: 2011-09-18 18:05:40 PDT
 
  # Created: 2011-09-18 18:05:40 PDT
 
   
 
   
  name: Sumit Hello Sample
+
  name: Sample Contest
  short-name:  
+
  short-name: SampCon
 
  elapsed: 0:00:00
 
  elapsed: 0:00:00
 
  remaining: 5:00:00
 
  remaining: 5:00:00
 
  running: false
 
  running: false
# Freeze at 1 hour before the end of the contest
+
# Freeze at 1 hour before the end of the contest
  scoreboard-freeze: 1:00:00
+
  scoreboard-freeze-length: 1:00:00
 
languages:
 
  - name: Java
 
    active: true
 
 
  - name: Perl
 
    active: true
 
 
  - name: GNU C++
 
    active: true
 
 
  - name: GNU C
 
    active: true
 
 
problemset:
 
  - letter: A
 
    short-name: hello
 
 
  - letter: B
 
    short-name: sumit
 
 
# EOF Contest Configuration
 
 
 
===languages===
 
 
 
 
 
====Short Form====
 
 
 
The short form will add a language with the pc2 default settings.
 
 
 
languages:
 
  - name: Java
 
    active: true
 
 
 
====Long Form====
 
 
languages:
 
 
  - name: 'Java'
 
    active: true
 
    compilerCmd: 'javac {:mainfile}'
 
    exemask: '{:basename}.class'
 
    execCmd: 'java {:basename}'
 
    runner: 'java'
 
    runner-args: '{:basename}'
 
    interpretedfalse
 
    use-judge-cmd: true
 
    judge-exec-cmd: 'java {:basename}'
 
 
  - name: 'GNU C'
 
    active: true
 
    compilerCmd: 'gcc -lm -o {:basename}.exe {:mainfile}'
 
    exemask: '{:basename}.exe'
 
    execCmd: '.\{:basename}.exe '
 
    runner: '.\{:basename}.exe'
 
    runner-args: ''
 
    interpretedfalse
 
    use-judge-cmd: true
 
    judge-exec-cmd: '{:basename}.exe'
 
 
  - name: 'GNU C++'
 
    active: true
 
    compilerCmd: 'g++ -lm -o {:basename}.exe {:mainfile}'
 
    exemask: '{:basename}.exe'
 
    execCmd: '.\{:basename}.exe '
 
    runner: '.\{:basename}.exe'
 
    runner-args: ''
 
    interpretedfalse
 
    use-judge-cmd: true
 
    judge-exec-cmd: '{:basename}.exe'
 
 
  - name: 'Python'
 
    active: true
 
    compilerCmd: 'python3 -m py_compile {:mainfile}'
 
    exemask: ''
 
    execCmd: 'python3 {:mainfile}'
 
    runner: 'python3'
 
    runner-args: '{:mainfile}'
 
    interpretedtrue
 
    use-judge-cmd: true
 
    judge-exec-cmd: 'python {:mainfile}'
 
 
  - name: 'Python 3'
 
    active: true
 
    compilerCmd: 'python3 -m py_compile {:mainfile}'
 
    exemask: ''
 
    execCmd: 'python3 {:mainfile}'
 
    runner: 'python3'
 
    runner-args: '{:mainfile}'
 
    interpretedtrue
 
    use-judge-cmd: true
 
    judge-exec-cmd: 'python3 {:mainfile}'
 
 
 
===problemset===
 
 
 
The list of problems defs in the problemset determines
 
the number and order of the problems defined in a contest.
 
 
 
Each problemset problem definition has a short-name which
 
is also called the problem short name.  The problem short
 
name is the name of a directory where the rest of the
 
problem settings are stored.  For more information about
 
those files and their contents see the article [[Problem Format]].
 
 
 
The problem short name (short-name) directory is expected
 
to be in the same directory as the contest.yaml file.
 
 
 
{|border="1" cellpadding="2"
 
|+ problemset name and values
 
! Name !! Description !! Example
 
|-
 
|letter||letter used to identify problem||G
 
|-
 
|short-name||problem short name (directory name for files, see [[Problem Format]])||fizbuzz
 
|-
 
|color||(optional) name of the color for the balloon ||Muave
 
|-
 
|rgb||(optional) the RGB color for the ballon||#0000ff
 
|-
 
|}
 
 
 
An example of a problemset section
 
 
 
problemset:
 
  - letter:    A
 
    short-name: apl
 
    color:      yellow
 
    rgb:        #ffff00
 
 
 
  - letter:    B
 
    short-name: barcodes
 
    color:      red
 
    rgb:        #ff0000
 
 
 
  - letter:    C
 
    short-name: biobots
 
    color:      green
 
    rgb:        #00ff00
 
 
 
  - letter:    D
 
    short-name: castles
 
    color:      blue
 
    rgb:        #0000ff
 
 
 
  - letter:    E
 
    short-name: channel
 
    color:      white
 
    rgb:        #ffffff
 
  
 
==PC&sup2; specific keys and values==
 
==PC&sup2; specific keys and values==
Line 195: Line 43:
 
The article [[CCS Enhancements]] describes these entries in more detail.
 
The article [[CCS Enhancements]] describes these entries in more detail.
  
{|border="1" cellpadding="1"
+
Use [[system.pc2.yaml]] for custom pc2 settings.
|+
 
! Section !! Description
 
|-
 
| [[CCS_Enhancements#Sites_Section|sites]] || Sequence of mappings for [[Site]] information
 
|-
 
| [[CCS_Enhancements#Accounts_Section|accounts]] || set of accounts to generate (same functionality as [[Generate Accounts]])
 
|-
 
| [[CCS_Enhancements#Auto_Judge|auto judge]]|| Define Auto Judge assignments/settings
 
|-
 
| [[CCS_Enhancements#Replay|replay]] || automatic [[Replay]] of previous contest feature
 
|}
 
 
 
===Example===
 
 
 
accounts:
 
  - account: TEAM
 
      site: 1
 
    count: 20
 
 
 
- account: JUDGE
 
      site: 1
 
    count: 8
 
 
  - account: SCOREBOARD
 
      site: 1
 
    count: 1
 
 
sites:
 
  - number: 1
 
      name: Site 1
 
        IP: 130.86.67.202
 
      port: 50002
 
  password: siteone
 
 
  - number: 2
 
      name: Site 2
 
        IP: 130.86.67.201
 
      port: 50002
 
 
auto-judging:
 
  - account: JUDGE
 
      site: 1
 
      number: 2
 
      letters: A
 
      enabled: yes
 
 
  - account: JUDGE
 
      number: 4,5,6
 
      letters: B,C,D
 
 
  - account: JUDGE
 
      site: 2
 
      number: all
 
      letters: B,C,D
 
 
  - account: JUDGE
 
      site: 1
 
      number: 1,3
 
      letters: F
 
      enabled: no
 
 
 
===Other Values===
 
 
 
Other custom values are found in the article [[CCS_Enhancements| CCS Enhancements]]
 
  
 
==Creating contest.yaml==
 
==Creating contest.yaml==
Line 274: Line 58:
  
 
==See Also==
 
==See Also==
* [[Problem Format]]
+
* [[Problem Format]] - Problem data and other files location description
* [[problem.yaml]]
+
* [[problem.yaml]] - problem specific settings
* [[problemset.yaml]]
+
* [[problemset.yaml]] - problem definitions
 +
* [[system.yaml]] - language and other settings
 +
* [[system.pc2.yaml]] - pc2-specific settings
 
* [[CCS_Enhancements| CCS Enhancements]]
 
* [[CCS_Enhancements| CCS Enhancements]]
 
* [[Export Tab]]
 
* [[Export Tab]]
 +
* [https://clics.ecs.baylor.edu/index.php/Contest_Control_System ICPC CCS]
  
 
[[Category:CLICS]]
 
[[Category:CLICS]]

Latest revision as of 10:32, 30 June 2017

Overview

A contest.yaml file contains information used to specify a contest configuration to PC2. Contest.yaml files are written in YAML and can be loaded into PC2 either by using the --load option (when starting a PC2 Server) or by selecting the Import contest.yaml button on the Import CCS Tab of the PC2 Admin Configure Contest screen.

A contest.yaml file consists of lines containing either colon-separated key:value pairs, or a list of items (called "mappings") starting with a dash. Whitespace (but not allowing tab characters) are used to indicate nested structure.

Contents of contest.yaml

For the current CLICS CCS specification for a contest.yaml file see CLICS contest.yaml

contest.yaml keys
Key Description
name Name of contest
short-name Short name of contest
start-time Date and time in ISO 8601 format (wall-clock time that the contest starts)
duration Duration as h:mm:ss (length of contest, in contest time)
scoreboard-freeze-length Time before end of contest when scoreboard will be frozen form HH:MM:SS

Example

# Contest Configuration, version 1.0 
# PC^2 Version: Version 9.3 20110918 (Sunday, September 18th 2011 23:51 UTC) Java ver 1.6.0_20 build 2345 Windows XP 5.1 (x86) 
# Created: 2011-09-18 18:05:40 PDT

name: Sample Contest
short-name: SampCon
elapsed: 0:00:00
remaining: 5:00:00
running: false
# Freeze at 1 hour before the end of the contest
scoreboard-freeze-length: 1:00:00

PC² specific keys and values

The article CCS Enhancements describes these entries in more detail.

Use system.pc2.yaml for custom pc2 settings.

Creating contest.yaml

A contest.yaml, problem.yaml and data files can be saved using either:

  1. the Export Contest YAML feature
  2. or use the Export Contest XML Report

Loading contest.yaml

Use the Admin Import CCS tab, Import contest.yaml button.


See Also