Difference between revisions of "Standings JSON"

From PC2wiki
Jump to: navigation, search
m (updated format of json)
m (General Format for problem members: added key column and other fields)
Line 39: Line 39:
 
==General Format for problem members==
 
==General Format for problem members==
  
  {"id":"<Rank>","name":"<University_name>","group":"<Group_name>"
+
  {"id":"<team_id>","rank":<Rank>,"solved":<problems_solved>,"score":<team_score>"name":"<University_name>","group":"<Group_name>"
 
  ,"<Problem_letter>":{"a":<Attempts>,"p":<Pending>,"t":<Elapsed_time>,"s":"<Results_phase>"}},
 
  ,"<Problem_letter>":{"a":<Attempts>,"p":<Pending>,"t":<Elapsed_time>,"s":"<Results_phase>"}},
  
Line 46: Line 46:
 
{| class="wikitable"
 
{| class="wikitable"
 
! Name
 
! Name
 +
! Key
 
! Description
 
! Description
 
! Example
 
! Example
 
! Type
 
! Type
 
|-
 
|-
|Rank|| rank in contest || 12 ||integer
+
|team_id||id|| Team number || 3 ||integer
 
|-
 
|-
|University_name || University/team name || Oxford University || String
+
|Rank||rank|| rank in contest || 12 ||integer
 
|-
 
|-
|Group_name|| Group/Region name || Europe || String
+
|problems_solved ||solved|| number problems solved || 5 ||integer
 
|-
 
|-
|Problem_letter || letter for problem || D || upper case char [A-Z]
+
|team_score||score|| team score / penalty || 324 ||integer
 
|-
 
|-
|Attempts ("a")|| number of attempts for problem || 3 || Integer
+
|University_name ||name|| University/team name || Oxford University || String
 
|-
 
|-
|Elapsed_time ("t") || time when solved || 143 || Integer
+
|Group_name||group|| Group/Region name || Europe || String
 
|-
 
|-
|Pending ("p") || pending runs count || 2 || Integer
+
|Problem_letter ||(N/A)|| letter for problem || D || upper case char [A-Z]
 
|-
 
|-
|Results_phase ("s") || results/info about run  || solved || String: "tried", "solved", "first", "pend"
+
|Attempts ||a|| number of attempts for problem || 3 || Integer
 +
|-
 +
|Elapsed_time  ||t|| time when solved || 143 || Integer
 +
|-
 +
|Pending  ||p|| pending runs count || 2 || Integer
 +
|-
 +
|Results_phase ||s|| results/info about run  || solved || String: "tried", "solved", "first", "pend"
 
|}
 
|}
 +
 +
The following keys are optional: t, p

Revision as of 18:21, 24 June 2013

Standings JSON

A future feature for pc2 is a JSON output/file that includes the equivalent of the Scoreboard HTML.

The JSON output will be delivered like the Event Feed and also be produced using pc2 reports.

Format

Each JSON output is created is an JSON array with zero or more JSON members. The output will be in a single long JSON string.

Sample JSON if no teams defined

[]

Each JSON Member is composed of a team member with optional problem members for example. This example is formatted in order to better show the example, the actual JSON will be a single line of JSON.

 [ {"id":"1","name":"University of Brevia","group":"Pangea"
	,"B":{"a":1,"t":20,"s":"solved"}
	,"D":{"a":1,"t":66,"s":"first"}
	,"E":{"a":1,"t":112,"s":"solved"}
	,"F":{"a":3,"s":"tried"}
	,"L":{"a":3,"t":152,"s":"solved"}},
 {"id":"2","name":"University of Fondu","group":"North America"
	,"B":{"a":1,"t":10,"s":"first"}
	,"D":{"a":1,"t":68,"s":"solved"}
	,"E":{"a":1,"t":122,"s":"solved"}
	,"F":{"a":2,"s":"tried"}
	,"L":{"a":3,"t":192,"s":"solved"}}
]

This same JSON example will be output as a single line, for example:

[{"id":"1","name":"University of Brevia","group":"Pangea","B":{"a":1,"t":20,"s":"solved"},"D":{"a":1,"t":66,"s":"first"},"E":{"a":1,"t":112,"s":"solved"},"F":{"a":3,"s":"tried"},"L":{"a":3,"t":152,"s":"solved"}},{"id":"2","name":"University of Fondu","group":"North America","B":{"a":1,"t":10,"s":"first"},"D":{"a":1,"t":68,"s":"solved"},"E":{"a":1,"t":122,"s":"solved"},"F":{"a":2,"s":"tried"},"L":{"a":3,"t":192,"s":"solved"}}]

General Format for problem members

{"id":"<team_id>","rank":<Rank>,"solved":<problems_solved>,"score":<team_score>"name":"<University_name>","group":"<Group_name>"
	,"<Problem_letter>":{"a":<Attempts>,"p":<Pending>,"t":<Elapsed_time>,"s":"<Results_phase>"}},

Fields and examples for both team and problem JSON members.

Name Key Description Example Type
team_id id Team number 3 integer
Rank rank rank in contest 12 integer
problems_solved solved number problems solved 5 integer
team_score score team score / penalty 324 integer
University_name name University/team name Oxford University String
Group_name group Group/Region name Europe String
Problem_letter (N/A) letter for problem D upper case char [A-Z]
Attempts a number of attempts for problem 3 Integer
Elapsed_time t time when solved 143 Integer
Pending p pending runs count 2 Integer
Results_phase s results/info about run solved String: "tried", "solved", "first", "pend"

The following keys are optional: t, p