打开作答纸
// 先取版本号:本轮读回来的 revision
const got = await mn.api('/notes/batch-get', {
method: 'POST',
body: { noteIds: [noteid], comments: true }
});
const rev = got.items[0].commentsRevision;
await mn.api('/notes/' + noteid + '/annotation-editor', {
method: 'POST',
body: { expectedRevision: rev, practice: { topic: topicid }, confirm: true }
});{
"editorOpened": true,
"persisted": false,
"noteid": "B9F3696A-AF8A-43B2-A8A2-2791717F1695",
"commentId": "1F4C2A90-6C2B-4E1F-9F3A-2B7C1D5E8A44",
"continued": false,
"practice": {
"addon": "mn.cardpractice",
"topic": "77012CA0-48E8-4D29-B5F5-1EEA927AE086",
"card": "B9F3696A-AF8A-43B2-A8A2-2791717F1695"
}
}卡片与摘录
打开作答纸
打开该题卡的图片底图批注稿,也就是作答纸,或者继续已有的一份。
该操作要带 expectedRevision,取自 GET /notes/{noteid}/comments 或
POST /notes/batch-get 响应里的 commentsRevision。带 commentId 表示继续该份,
不带表示新建。advance 等同于在编辑器里按下主按钮。
practice 给定时其值只含 addon 与 topic 两项。面板发起的调用只写 topic,
addon 取自面板所属插件;
命令行发起的调用须自行写入 addon,缺少该字段时返回 INVALID_INPUT。不传 practice
也能打开编辑器,返回 200。
编辑器占用期间该卡会被锁定,再次打开返回 ANNOTATION_UNAVAILABLE。这道题不属于当前学习集时返回 PRACTICE_TOPIC_CHANGED,
该情形要先刷新重读,原地重试得到同样的结果。
POST
/
notes
/
{noteid}
/
annotation-editor
打开作答纸
// 先取版本号:本轮读回来的 revision
const got = await mn.api('/notes/batch-get', {
method: 'POST',
body: { noteIds: [noteid], comments: true }
});
const rev = got.items[0].commentsRevision;
await mn.api('/notes/' + noteid + '/annotation-editor', {
method: 'POST',
body: { expectedRevision: rev, practice: { topic: topicid }, confirm: true }
});{
"editorOpened": true,
"persisted": false,
"noteid": "B9F3696A-AF8A-43B2-A8A2-2791717F1695",
"commentId": "1F4C2A90-6C2B-4E1F-9F3A-2B7C1D5E8A44",
"continued": false,
"practice": {
"addon": "mn.cardpractice",
"topic": "77012CA0-48E8-4D29-B5F5-1EEA927AE086",
"card": "B9F3696A-AF8A-43B2-A8A2-2791717F1695"
}
}路径参数
卡片的 noteid。取自卡片命令响应的 noteid、POST /notes/batch-get 响应里 items[].noteid,或 GET /ui-state 的 state.focusnoteid。
请求体
application/json