所有请求均需要 cookie。
方法 | 路径 | 参数 |
---|---|---|
GET | /test_code/<题目 id> | 所用语言(lang) |
response:TestCode
获取成功返回代码。e.g.
{
"status": "Success",
"func_code": "code for function that will be impl",
"simple_test": "code for simple test"
}
失败返回 SomeException :
{
"status": "Exception",
"code": 0,
"message": "SomeException test"
}
request:Solution
方法 | 路径 | 参数 |
---|---|---|
POST | /j/submit | solution 表单 |
response:JudgeSubmit
提交成功返回本次提交信息,失败返回 SomeException 。e.g.
{
"id": "<提交 id: usize>"
}
方法 | 路径 | 参数 |
---|---|---|
GET | /j/judge_state/<提交 id> |
response: JudgeState
获取成功返回当前判题进程,失败返回 SomeException 。e.g.
{
"status": "Success",
"stage": {
"type": "Exit",
"case_idx": 6,
"state": {
"type": "Error",
"error": {
"type": "TimeLimitExceeded",
"time_used": 120000000
}
}
},
"message": "judge state test"
}
方法 | 路径 | 参数 |
---|---|---|
GET | /j/judge_result/<提交 id> |
response: JudgeResult
获取成功返回判题结果,失败返回 SomeException 。e.g.
{
"status": "Success",
"type": "WrongAnswer",
"cases_result": [
[
0,
{
"type": "Pass",
"time_used": 100,
"mem_used": 10240
}
],
[
1,
{
"type": "Pass",
"time_used": 120,
"mem_used": 23333
}
],
[
2,
{
"type": "WrongAnswer",
"expect": "1 + 1 = 2",
"got": "1 + 1 = 3"
}
]
]
}