-
Notifications
You must be signed in to change notification settings - Fork 0
/
Analyst_extension_of_Contest_API.mw
302 lines (276 loc) · 5.34 KB
/
Analyst_extension_of_Contest_API.mw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
'''This is an early draft of extensions to the [[Contest API]] to support analyst data'''
Section names match those in [[Contest API]]. New sections (i.e. sections that do not appear in parent document) should simply be added. Existing but empty sections are only there for structure (i.e. to properly place a subsection). If edits are needed in an existing section there will be a comment within square brackets ([, ]) describing the changes needed.
== Interface specification ==
=== Types of endpoints ===
[ Add commentary-messages and edit-activities to Live data list ]
=== Teams ===
[ Add elements below to team object ]
{| class="wikitable"
|-
! Name
! Type
! Required?
! Nullable?
! Source @WF
! Description
|-
| main_language
| ID
| no
| yes
| Analysts
| identifier of the main [[Contest_API#Languages | programming language]] used by the team
|-
| latest_problem
| ID
| no
| yes
| Analysts
| identifier of the latest [[Contest_API#Problems | problem]] worked on by the team that they have not solved
|-
| latest_edit_contest_time
| RELTIME
| depends
| depends
| Analysts
| contest time of latest edit on unsolved problem. Required (and not null) iff <tt>latest_problem</tt> is present (and not null)
|}
=== Commentary messages ===
Provides commentary on events in the current contest.
The following endpoints are associated with commentary:
{| class="wikitable"
|-
! Endpoint
! Mime-type
! Required?
! Source @WF
! Description
|-
| /contests/<id>/commentary-messages
| application/json
| no
| Analysts
| JSON array of all messages with elements as defined in the table below
|-
| /contests/<id>/commentary-messages/<id>
| application/json
| no
| Analysts
| JSON object of a single message with elements as defined in the table below
|}
JSON elements of language objects:
{| class="wikitable"
|-
! Name
! Type
! Required?
! Nullable?
! Source @WF
! Description
|-
| id
| ID
| yes
| no
| Analysts
| identifier of the message
|-
| team_id
| ID
| yes
| yes
| Analysts
| identifier of the [[Contest_API#Teams | team]] the message is related to
|-
| problem_id
| ID
| yes
| yes
| Analysts
| identifier of the [[Contest_API#Problems | problem]] the message is related to
|-
| submission_id
| ID
| yes
| yes
| Analysts
| identifier of the [[Contest_API#Submissions | submission]] the message is related to
|-
| priority
| ORDINAL
| yes
| no
| Analysts
| priority of the message. Lower values are higher priority
|-
| text
| string
| yes
| no
| Analysts
| plain text message
|-
| time
| TIME
| yes
| no
| Analysts
| time when commentary was made
|-
| contest_time
| RELTIME
| yes
| no
| Analysts
| contest time when commentary was made
|}
==== Access restrictions at WF ====
No access restrictions apply to a GET on this endpoint.
=== Edit Activities ===
Provides information about what teams are editing which problems when.
The following endpoints are associated with editing activities:
{| class="wikitable"
|-
! Endpoint
! Mime-type
! Required?
! Source @WF
! Description
|-
| /contests/<id>/edit-activities
| application/json
| no
| Analysts
| JSON array of all edit activities with elements as defined in the table below
|-
| /contests/<id>/edit-activities/<id>
| application/json
| no
| Analysts
| JSON object of a single edit activity with elements as defined in the table below
|}
JSON elements of edit activity objects:
{| class="wikitable"
|-
! Name
! Type
! Required?
! Nullable?
! Source @WF
! Description
|-
| id
| ID
| yes
| no
| Analysts
| identifier of the edit activity
|-
| team_id
| ID
| yes
| no
| Analysts
| identifier of the [[Contest_API#Teams | team]] doing the edit
|-
| problem_id
| ID
| yes
| yes
| Analysts
| identifier of the [[Contest_API#Problems | problem]] being edited. Null iff it's unknown what problem the edit was for
|-
| language_id
| ID
| yes
| yes
| Analysts
| identifier of the [[Contest_API#Languages | language]] being used in the edit. Null iff it's unknown what languages was used (or it is not one of the contest languages)
|-
| line_count
| integer
| yes
| no
| Analysts
| number of lines in file being edited
|-
| diff_line_count
| integer
| yes
| no
| Analysts
| number of lines in diff of file being edited
|-
| file_size_bytes
| integer
| yes
| no
| Analysts
| file size of file being edited in bytes
|-
| time
| TIME
| yes
| no
| Analysts
| time of when edit was made
|-
| contest_time
| RELTIME
| yes
| no
| Analysts
| contest time of when edit was made
|}
==== Access restrictions at WF ====
No access restrictions apply to a GET on this endpoint.
=== Scoreboard ===
[ Add elements below to problem object ]
{| class="wikitable"
|-
! Name
! Type
! Required?
! Nullable?
! Source @WF
! Description
|-
| language_id
| ID
| no
| yes
| Analysts
| identifier of [[Contest_API#Languges | language]] used for last submission
|-
| potential
| object
| no
| yes
| Analysts
| JSON object as specified in the rows below
|-
| potential.rank
| integer
| depends
| no
| Analysts
| rank that the team would get if they solved this problem now. Required iff potential is present.
|-
| potential.before
| integer
| depends
| no
| Analysts
| how many more minutes the team would reach the rank above by solving this problem assuming no other problems are solved. Required iff potential is present.
|}
=== Event Feed ===
==== Feed format ====
[ Add entry below to API endpoint table ]
{| class="wikitable"
|-
! Event
! API Endpoint
|-
| commentary-messages
| /contests/<id>/commentary-messages/<id>
|}