101 lines
3.3 KiB
JSON
101 lines
3.3 KiB
JSON
{
|
||
"openapi": "3.0.1",
|
||
"info": {
|
||
"title": "新增习题",
|
||
"description": "同步自 Apifox(试题管理),int64 主键按前端精度规范落为 string",
|
||
"version": "1.0.0"
|
||
},
|
||
"paths": {
|
||
"/safetyEval/question/add": {
|
||
"post": {
|
||
"summary": "新增习题",
|
||
"tags": ["试题管理"],
|
||
"requestBody": {
|
||
"content": {
|
||
"application/json": {
|
||
"schema": { "$ref": "#/components/schemas/QuestionAddDTO" }
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": { "$ref": "#/components/schemas/SingleResponseVoid" }
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"components": {
|
||
"schemas": {
|
||
"QuestionAddDTO": {
|
||
"type": "object",
|
||
"required": ["title", "score", "coursewareManagementId", "questionOptionList"],
|
||
"properties": {
|
||
"title": { "type": "string", "description": "题目内容" },
|
||
"score": {
|
||
"type": "number",
|
||
"description": "分值",
|
||
"minimum": 0.1,
|
||
"maximum": 999.9
|
||
},
|
||
"analysis": { "type": "string", "description": "答案解析" },
|
||
"tagType": { "type": "string", "description": "标签类型" },
|
||
"coursewareManagementId": {
|
||
"type": "string",
|
||
"description": "关联课件管理id(后端 Long;前端按字符串保证精度)"
|
||
},
|
||
"questionType": {
|
||
"type": "string",
|
||
"description": "题型枚举: single=>单选;multiple=>多选;judge=>判断;fill=>填空;short=>简答"
|
||
},
|
||
"answer": { "type": "string", "description": "参考答案:逗号隔开" },
|
||
"answerQuestionOptionIds": {
|
||
"type": "string",
|
||
"description": "答案选项id 多个逗号隔开"
|
||
},
|
||
"childrenQuestionIds": {
|
||
"type": "string",
|
||
"description": "子题 多个逗号分割"
|
||
},
|
||
"source": {
|
||
"type": "integer",
|
||
"description": "来源(1:管理员添加,2:三方添加)"
|
||
},
|
||
"questionOptionList": {
|
||
"type": "array",
|
||
"description": "试题选项信息",
|
||
"items": { "$ref": "#/components/schemas/QuestionOptionAddDTO" }
|
||
}
|
||
}
|
||
},
|
||
"QuestionOptionAddDTO": {
|
||
"type": "object",
|
||
"required": ["isCorrect", "optionKey", "optionText"],
|
||
"properties": {
|
||
"isCorrect": {
|
||
"type": "boolean",
|
||
"description": "是否正确答案 true 是,false 不是"
|
||
},
|
||
"optionKey": { "type": "string", "description": "选项标识:A,B,C,D" },
|
||
"optionText": { "type": "string", "description": "选项内容" }
|
||
}
|
||
},
|
||
"SingleResponseVoid": {
|
||
"type": "object",
|
||
"properties": {
|
||
"success": { "type": "boolean", "description": "是否成功" },
|
||
"code": { "type": "string", "description": "响应码" },
|
||
"message": { "type": "string", "description": "响应消息" },
|
||
"errMessage": { "type": "string", "description": "错误响应消息" },
|
||
"data": { "description": "响应数据", "type": "null" }
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|