/listenSubmission
https://api.sort-me.org/wss/listenSubmission
This method can track submission judging almost in real-time.
Query parameters
id
ID of submission you want to listen for.
token
Your access token. Required here because WSS connections can't use headers.
language
Language required to get text verdict representation. Required here because WSS connections can't use headers.
Message stages
1. Current submission object
This message contains submissions object in the same format as in /submissions/get.
{
"id": 138888,
"user": {
"id": 1,
"handle": "sadfun",
"avatar": "https://pic.sort-me.org/bd62e50c-7cfa-40d8-9009-f4753d696289"
},
"task_id": 1,
"worst_metrics": {
"time": 0,
"memory": 0
},
"submitted_at": 1672947158,
"lang": {
"name": "Python 3.11",
"highlight": "python",
"api": "python",
"ext": "py"
},
"test": 0,
"verdict": 0,
"verdict_text": "Judging",
"points": 0
}
Then there are two options:
If
verdict
is not0
(judging), then judging is already done, so websocket connection closed, and you will receive no more messages.If
verdict
is0
(judging), then proceed to next messages stage.
2. Test number
In fact, the only useful information that can be changed during judging and before getting a final verdict is test number. Therefore (and also for optimization purposes) you will get only it, without unnecessary JSON abstractions.
When it comes to judging your submission, you will start receiving plaintext numbers:

That's a test number on which submission is being judged right now. You can display it as live counter, just as in sort-me.org after submission.

If you receive number 0
, it means that compilation stage has just started.
3. Judged submission object
When judging is finished, you receive a submission preview again, in the same format as in stage 1.
{
"id": 138888,
"user": {
"id": 1,
"handle": "sadfun",
"avatar": "https://pic.sort-me.org/bd62e50c-7cfa-40d8-9009-f4753d696289"
},
"task_id": 1,
"worst_metrics": {
"time": 896,
"memory": 14
},
"submitted_at": 1672947158,
"lang": {
"name": "Python 3.11",
"highlight": "python",
"api": "python",
"ext": "py"
},
"test": 0,
"verdict": 1,
"verdict_text": "Full solution",
"points": 100
}
Last updated