跳转到内容

批改结果

批改得到的条目和交付文件,以及全部交付文件的压缩包。

GET /v3/submissions/{submission_id}/results

返回这次提交当前的批改结果:视图和全部条目。这个接口一次返回全部条目,一次提交最多 2000 个;筛选、排序和分组由调用方按视图在取到的条目上完成。一轮执行期间,批改结果随着条目的完成逐步增加。

名称 位置 类型 必填 说明
submission_id 路径 字符串 是 提交的标识

成功时返回 200,响应体是当前的批改结果,结构见批改结果。

出错时的响应体见错误。

状态码 含义
401 没有凭据,或者凭据无效
403 凭据有效,但这个操作不被允许
404 资源不存在,或者不属于当前账号
429 请求太频繁
终端窗口
curl "https://homework.api.truezir.com/v3/submissions/$SUBMISSION_ID/results" \
-H "Authorization: Bearer $API_KEY"
{
"view": {
"fields": [
{
"key": "subject",
"label": "学科",
"type": "text",
"groupable": true,
"filterable": true,
"sortable": false
},
{
"key": "score",
"label": "得分",
"type": "number",
"groupable": false,
"filterable": false,
"sortable": true
}
],
"default_group_by": "subject",
"default_sort": {
"field": "score",
"direction": "desc"
}
},
"items": [
{
"id": "item-6a0d3e9b1c7f4a258b4e2d0c9f1a7e53",
"key": "wuli-zhangsan",
"title": "张三",
"state": "succeeded",
"fields": {
"score": {
"display": "13/15",
"value": 13
},
"subject": "物理"
},
"artifacts": [
{
"id": "artifact-7b1e5c2d9a3f4e6b8c0d1f4a2e7b9c35",
"slot": "report",
"title": "批改报告",
"filename": "张三.pdf",
"size_bytes": 345678,
"content_type": "application/pdf",
"round_id": "round-5d2a8c41e7b94f0d9a3b6c1e8f2d7a90",
"comments": [
{
"verdict": "cross",
"text": "没有写出连接 CE 这一步",
"anchors": [
{
"page": 1,
"x": 812.5,
"y": 240,
"label": "9(2)"
}
]
}
],
"created_at": "2026-11-20T06:38:12Z"
}
],
"updated_round_id": "round-5d2a8c41e7b94f0d9a3b6c1e8f2d7a90",
"created_at": "2026-11-20T06:31:02Z",
"updated_at": "2026-11-20T06:38:14Z"
}
],
"last_event_id": 1287
}

GET /v3/submissions/{submission_id}/rounds/{round_id}/results

返回一轮结束时的批改结果。它在这一轮结束后不再变化,所以可以用来对比修改前后的结果。这一轮还没有结束时返回 409 和错误码 round_not_finished。

名称 位置 类型 必填 说明
submission_id 路径 字符串 是 提交的标识
round_id 路径 字符串 是 轮次的标识

成功时返回 200,响应体是这一轮结束时的批改结果,结构见批改结果。

出错时的响应体见错误。

状态码 含义
401 没有凭据,或者凭据无效
403 凭据有效,但这个操作不被允许
404 资源不存在,或者不属于当前账号
409 资源当前的状态不允许这个操作
429 请求太频繁
终端窗口
curl "https://homework.api.truezir.com/v3/submissions/$SUBMISSION_ID/rounds/$ROUND_ID/results" \
-H "Authorization: Bearer $API_KEY"
{
"view": {
"fields": [
{
"key": "subject",
"label": "学科",
"type": "text",
"groupable": true,
"filterable": true,
"sortable": false
},
{
"key": "score",
"label": "得分",
"type": "number",
"groupable": false,
"filterable": false,
"sortable": true
}
],
"default_group_by": "subject",
"default_sort": {
"field": "score",
"direction": "desc"
}
},
"items": [
{
"id": "item-6a0d3e9b1c7f4a258b4e2d0c9f1a7e53",
"key": "wuli-zhangsan",
"title": "张三",
"state": "succeeded",
"fields": {
"score": {
"display": "13/15",
"value": 13
},
"subject": "物理"
},
"artifacts": [
{
"id": "artifact-7b1e5c2d9a3f4e6b8c0d1f4a2e7b9c35",
"slot": "report",
"title": "批改报告",
"filename": "张三.pdf",
"size_bytes": 345678,
"content_type": "application/pdf",
"round_id": "round-5d2a8c41e7b94f0d9a3b6c1e8f2d7a90",
"comments": [
{
"verdict": "cross",
"text": "没有写出连接 CE 这一步",
"anchors": [
{
"page": 1,
"x": 812.5,
"y": 240,
"label": "9(2)"
}
]
}
],
"created_at": "2026-11-20T06:38:12Z"
}
],
"updated_round_id": "round-5d2a8c41e7b94f0d9a3b6c1e8f2d7a90",
"created_at": "2026-11-20T06:31:02Z",
"updated_at": "2026-11-20T06:38:14Z"
}
],
"last_event_id": 1287
}

GET /v3/submissions/{submission_id}/artifacts/{artifact_id}/download

返回一份交付文件的下载地址。地址在一段时间之后失效,失效后再调用这个接口取一个新的。一份交付文件的内容在它的标识之下永远不变,调用方可以按标识长期缓存取到的内容。

名称 位置 类型 必填 说明
submission_id 路径 字符串 是 提交的标识
artifact_id 路径 字符串 是 交付文件的标识
disposition 查询参数 字符串 否 浏览器打开下载地址时怎样处理文件:inline 表示直接显示,attachment 表示保存为文件。只有 PDF 和常见的位图可以直接显示,其他类型的文件一律保存为文件。默认是 "inline"

成功时返回 200,响应体是下载地址,结构见下载地址。

出错时的响应体见错误。

状态码 含义
401 没有凭据,或者凭据无效
403 凭据有效,但这个操作不被允许
404 资源不存在,或者不属于当前账号
422 请求的内容不合规则
429 请求太频繁
终端窗口
curl "https://homework.api.truezir.com/v3/submissions/$SUBMISSION_ID/artifacts/$ARTIFACT_ID/download" \
-H "Authorization: Bearer $API_KEY"
{
"url": "https://storage.example.com/files/artifact-7b1e?signature=…",
"expires_at": "2026-11-20T07:30:00Z"
}

GET /v3/submissions/{submission_id}/export

返回批改结果压缩包的下载地址,压缩包里是这次提交的全部交付文件。系统在一轮结束后自动打包,提交的 export_state 说明压缩包是否可以取。export_state 不是 ready 时返回 409 和错误码 export_not_ready。

名称 位置 类型 必填 说明
submission_id 路径 字符串 是 提交的标识

成功时返回 200,响应体是下载地址,结构见下载地址。

出错时的响应体见错误。

状态码 含义
401 没有凭据,或者凭据无效
403 凭据有效,但这个操作不被允许
404 资源不存在,或者不属于当前账号
409 资源当前的状态不允许这个操作
429 请求太频繁
终端窗口
curl "https://homework.api.truezir.com/v3/submissions/$SUBMISSION_ID/export" \
-H "Authorization: Bearer $API_KEY"
{
"url": "https://storage.example.com/files/artifact-7b1e?signature=…",
"expires_at": "2026-11-20T07:30:00Z"
}