新建测验试卷

POST /api/tcc-open-platform/open-api/onlineTrain/test
消耗
  • application/json
生成
  • */*
参数
类型 名称 说明 类型
Body dto
必填
dto [测验保存数据传输类]

测验保存数据传输类

名称 说明 类型
appId
可选
应用id integer (int64)
orgId
可选
服务模块类型 integer (int64)
questionList
必填
测验题目列表 < [测验题目实体]> array
questionnaireName
必填
试卷标题 string
serviceType
必填
服务模块类型 string

测验题目实体

名称 说明 类型
answerList
必填
答案列表 < [测验答案实体] > array
id
可选
题目id,如果是新增的话就不需要,如果是修改的话则需要 integer (int64)
questionName
必填
题目名 string
questionRemark
可选
备注 string
questionType
必填
问题类型:1/单选题,2/多选题,3/问答题,4/是非题 integer (int32)
required
必填
是否必填:0/不需要,1/需要 integer (int32)
score
必填
题目分数 integer (int32)

测验答案实体

名称 说明 类型
answerName
必填
答案名字 string
correctAnswer
必填
是否为正确答案:0/不是,1/是 integer (int32)
调用示例
{
  "appId": 0,
  "orgId": 0,
  "questionList": [
    {
      "answerList": [
        {
          "answerName": "string",
          "correctAnswer": 0
        }
      ],
      "id": 0,
      "questionName": "string",
      "questionRemark": "string",
      "questionType": 0,
      "required": 0,
      "score": 0
    }
  ],
  "questionnaireName": "string",
  "serviceType": "string"
}
响应
HTTP代码 说明 类型
200 OK RestData
201 Created 无内容
401 Unauthorized 无内容
403 Forbidden 无内容
404 Not Found 无内容

响应示例

{
     "code": 200,
     "data": {
          "questionnaireId": "537333805956268032",
          "questionList": [
               {
                    "answerList": [
                         {
                              "answerId": "537333806019182594",
                              "answerName": "选项1"
                         },
                         {
                              "answerId": "537333806019182595",
                              "answerName": "选项2"
                         }
                    ],
                    "questionId": "537333806019182592",
                    "questionName": "题目1"
               }
          ],
          "questionnaireName": "试卷标题"
     },
     "desc": "操作成功"
}