Difference between revisions of "Standings JSON"

From PC2wiki
Jump to: navigation, search
m (Format: more examples and info)
m (updated format of json)
Line 40: Line 40:
  
 
  {"id":"<Rank>","name":"<University_name>","group":"<Group_name>"
 
  {"id":"<Rank>","name":"<University_name>","group":"<Group_name>"
  ,"<Problem_letter>":{"a":<hAttempts uh>,"t":<Elapsed_time>,"s":"<Results_phase>"}},
+
  ,"<Problem_letter>":{"a":<Attempts>,"p":<Pending>,"t":<Elapsed_time>,"s":"<Results_phase>"}},
  
 
Fields and examples for both team and problem JSON members.
 
Fields and examples for both team and problem JSON members.
Line 58: Line 58:
 
|Problem_letter || letter for problem || D || upper case char [A-Z]
 
|Problem_letter || letter for problem || D || upper case char [A-Z]
 
|-
 
|-
|Attempts || number of attempts for problem || 3 || Integer
+
|Attempts ("a")|| number of attempts for problem || 3 || Integer
 
|-
 
|-
|Elapsed_time || time when solved || 143 || Integer
+
|Elapsed_time ("t") || time when solved || 143 || Integer
 
|-
 
|-
|Results_phase || results/info about run  || solved || String: "tried", "solved", "first"
+
|Pending ("p") || pending runs count || 2 || Integer
 +
|-
 +
|Results_phase ("s") || results/info about run  || solved || String: "tried", "solved", "first", "pend"
 
|}
 
|}

Revision as of 18:11, 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":"<Rank>","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 Description Example Type
Rank rank in contest 12 integer
University_name University/team name Oxford University String
Group_name Group/Region name Europe String
Problem_letter 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"