1.调查问卷-接口文档

调查问卷表:

QUESTIONNAIRE_MANAGE_T--问卷活动管理表

QUESTIONNAIRE_MANAGE_EXTEND_T--问卷活动管理扩展表

QUE_ANSWER_FREQUENCY_T--答题次数查询表

QUESTIONNAIRE_INFO_T--题干表

QUESTIONNAIRE_EXTEND_INFO_T--选项表

QUESTIONNAIRE_ANSWER_T--调查问卷答题表

STANDARD_ANSWER_SCORE--旅客评分表--无业务需要暂无评分

 

1.请求参数基本格式

 

1.入参格式说明

由于IBM Worklight Adapter 的入参不支持多层json.所以需要将json对象转为jsonstr拼入新的json对象

最终对象如下

{

      “req”:”jsonstr”  //入参的json对象字符串

}

2.server解析入参

       String req=request.getParameter(“req”);

       req转Map  //转换方式随意

3.出参格式说明

{

        "activityId": "asdfghjkl",

        "individualization": "'公共','有午餐可填','有餐可填',有早餐可填",

        "questionIdName": "第一套题",

        "answerNum": "6",

        "questionContent": "第一套题简介",

        "maxAnswerNum": "10",

        "code": "00000000",

        "msg": "查询获取返回文言"

}

返回结果中都含有错误码(code)为00000000代表成功,其它代表失败。

2.接口需求

   1.查询题目接口

介绍:获取调查问卷用户答题题目

地址:http://localhost:8085/demo/commonQuestionnaire/queryQuestionnaire.do

参数名

中文名称

必填

注释

activityId

活动id

1

后台表QUESTIONNAIRE_MANAGE_T --问卷活动管理表中字段id

lang

用户查询语言

1

 

userId

用户唯一标识

1

userId不传时是不记名答题

individualization

个性化题目要求

1

传多个时以“,”隔开,例:早餐,晚餐

answer_level

用户等级

1

 

1.入参说明

入参样例:

{
	"activityId": "asdfghjkl",
	"lang": "中文",
	"userId": "18730733961",
	"individualization": "有早餐可填",
	"answer_level": "普卡"
}

2.出参说明

参数名

中文名称

注释

activityId

活动id

 

individualization

个性化展示的关键字

 

questionIdName

本次问卷的名字

 

answerNum

答题旅客答题次数

返回0是没有查询到旅客答题记录,或没传userId

questionContent

本次问卷的简介

 

maxAnswerNum

本次问卷的最大答题次数

0为无限制

code

错误编码

 

msg

错误描述

 

urlParam

首页图片url

 

questionnaireInfo

旅客答题问卷信息

 

urlParam

首页图片url

 

questionSequence

题号从1开始依次递增

1,2,3,4,5,6……

questionID

题的唯一id

 

required

是否必填

1必填 0非必填

questionType

题的类型

single_choice-单选题:中文:天气如何

multiple_choice-多选题:中文:多选

essay-简答题

yes_no-是否题

true_false-对错题

score-评分题

fill_blanks-填空题

questionContent

题目

 

ifAnswerFlag

是否存在用户答案

1已答题 0未答题

watermark

题干水印

 

urlParam

题干图片url

 

individualization

本题属于个性化的关键字

 

choiceBlanksNumber

填空最大空数

选择最大可选数

 

minScore

评分题最小评分

 

maxScore

评分题最大评分

 

optionScore

默认显示评分

 

optionList

选择题:选项List

 

optionSequence

选择题选项号,1,2,3……

 

optionID

选项唯一id

 

optionContent

选项内容

 

watermark

选项水印

 

urlParam

选项包含图片url

 

showBlanksList

选择显示说明框的选项

评分题小于这个评分显示说明框

 

answerOption

答题选择

多选用逗号隔开例: "0001,0002"

是否题:1为是,0为否

对错题:1为对,0为错

评分题:评分

answerContent

答题内容

填空题答案:多个答案用“#”隔开

简答题答案

出参样例:

{
  "activityId": "asdfghjkl",
  "individualization": "'公共','有午餐可填','有餐可填',有早餐可填",
  "questionIdName": "第一套题",
  "answerNum": "7",
  "questionContent": "第一套题简介",
  "maxAnswerNum": "10",
  "code": "00000000",
  "msg": "查询获取返回文言",
  "questionnaireInfo": [
    {
      "questionSequence": "1",
      "questionID": "1",
      "required": "1",
      "questionType": "single_choice",
      "questionContent": "单选题:中文:天气如何",
      "ifAnswerFlag": "1",
      "watermark": "题干水印",
      "urlParam": "",
      "individualization": "有午餐可填",
      "choiceBlanksNumber": "1",
      "minScore": "0",
      "maxScore": "10",
      "optionScore": "0",
      "optionList": [
        {
          "optionSequence": "1",
          "optionID": "0001",
          "optionContent": "选项A",
          "watermark": "选择A水印",
          "urlParam": ""
        },
        {
          "optionSequence": "2",
          "optionID": "0002",
          "optionContent": "选项B",
          "watermark": "选择B水印",
          "urlParam": ""
        }
      ],
      "showBlanksList": [],
      "answerOption": "0001",
      "answerContent": ""
    },
    {
      "questionSequence": "2",
      "questionID": "2",
      "required": "1",
      "questionType": "multiple_choice",
      "questionContent": "多选题:中文:多选",
      "ifAnswerFlag": "1",
      "watermark": "题干水印",
      "urlParam": "",
      "individualization": "有午餐可填",
      "choiceBlanksNumber": "1",
      "minScore": "0",
      "maxScore": "10",
      "optionScore": "0",
      "optionList": [
        {
          "optionSequence": "1",
          "optionID": "0001",
          "optionContent": "选项A",
          "watermark": "水印",
          "urlParam": ""
        },
        {
          "optionSequence": "2",
          "optionID": "0002",
          "optionContent": "选项B",
          "watermark": "水印",
          "urlParam": ""
        },
        {
          "optionSequence": "3",
          "optionID": "0003",
          "optionContent": "选项C",
          "watermark": "水印",
          "urlParam": ""
        }
      ],
      "showBlanksList": [
        "0001",
        "0002"
      ],
      "answerOption": "0001,0002",
      "answerContent": "多选题说明,因为都会用到所有选择了两个选项"
    },
    {
      "questionSequence": "3",
      "questionID": "4",
      "required": "1",
      "questionType": "essay",
      "questionContent": "简单题:中文",
      "ifAnswerFlag": "1",
      "watermark": "题干水印",
      "urlParam": "",
      "individualization": "有午餐可填",
      "choiceBlanksNumber": "1",
      "minScore": "0",
      "maxScore": "10",
      "optionScore": "0",
      "optionList": [],
      "showBlanksList": [],
      "answerOption": "",
      "answerContent": "简答题的答案"
    },
    {
      "questionSequence": "4",
      "questionID": "6",
      "required": "1",
      "questionType": "yes_no",
      "questionContent": "是否题:中文",
      "ifAnswerFlag": "1",
      "watermark": "题干水印",
      "urlParam": "",
      "individualization": "公共",
      "choiceBlanksNumber": "1",
      "minScore": "0",
      "maxScore": "10",
      "optionScore": "0",
      "optionList": [],
      "showBlanksList": [],
      "answerOption": "1",
      "answerContent": "是否题,1选“是”,0选“否”"
    },
    {
      "questionSequence": "5",
      "questionID": "7",
      "required": "1",
      "questionType": "true_false",
      "questionContent": "对错题:中文",
      "ifAnswerFlag": "1",
      "watermark": "题干水印",
      "urlParam": "",
      "individualization": "公共",
      "choiceBlanksNumber": "1",
      "minScore": "0",
      "maxScore": "10",
      "optionScore": "0",
      "optionList": [],
      "showBlanksList": [],
      "answerOption": "1",
      "answerContent": "对错题,1选“对”,0选“错”"
    },
    {
      "questionSequence": "6",
      "questionID": "3",
      "required": "1",
      "questionType": "score",
      "questionContent": "评分题:中文",
      "ifAnswerFlag": "1",
      "watermark": "题干水印",
      "urlParam": "",
      "individualization": "有午餐可填",
      "choiceBlanksNumber": "1",
      "minScore": "0",
      "maxScore": "10",
      "optionScore": "0",
      "optionList": [],
      "showBlanksList": [],
      "answerOption": "9",
      "answerContent": "评分题:描述评分原因"
    },
    {
      "questionSequence": "7",
      "questionID": "5",
      "required": "1",
      "questionType": "fill_blanks",
      "questionContent": "填空题:中文",
      "ifAnswerFlag": "1",
      "watermark": "题干水印",
      "urlParam": "",
      "individualization": "有早餐可填",
      "choiceBlanksNumber": "2",
      "minScore": "0",
      "maxScore": "10",
      "optionScore": "0",
      "optionList": [],
      "showBlanksList": [],
      "answerOption": "",
      "answerContent": "填空1#填空2(旅客不能输入“#”)"
    }
  ],
  "urlParam": "第一套题封面url"
}

 

   2.用户答题接口

介绍:保存用户答题信息

地址:http://localhost:8085/demo/commonQuestionnaire/saveQuestionnaire.do

参数名

中文名称

必填

注释

answerList

用户答题List

1

 

questionID

题的唯一id

1

 

answerOption

答题选则

1

 

answerContent

答题内容

1

 

userId

用户唯一标识

1

 

activityId

活动id

1

 

lang

语言

1

 

answer_level

用户等级

1

 

1.入参说明

入参样例:

{
	"answerList": [{
		"questionID": "1",
		"answerOption": "0001"
	},
	{
		"questionID": "2",
		"answerOption": "0001,0002",
		"answerContent": "多选题说明,因为都会用到所有选择了两个选项"
	},
	{
		"questionID": "4",
		"answerContent": "简答题的答案"
	},
	{
		"questionID": "6",
		"answerOption": "1",
		"answerContent": "是否题,1选“是”,0选“否”"
	},
	{
		"questionID": "7",
		"answerOption": "1",
		"answerContent": "对错题,1选“对”,0选“错”"
	},
	{
		"questionID": "3",
		"answerOption": "9",
		"answerContent": "评分题:描述评分原因"
	},
	{
		"questionID": "5",
		"answerContent": "填空1#填空2(旅客不能输入“#”)"
	}],
	"userId": "18730733961",
	"activityId": "asdfghjkl",
	"lang": "中文",
	"answer_level": "普卡"
}

2.出参说明

参数名

中文名称

注释

code

错误编码

 

msg

错误描述

 

 

出参样例:

{
  "code": "00000000",
  "msg": "查询获取返回文言"
}

希望对你有帮助,祝你有一个好心情,加油!

若有错误、不全、可优化的点,欢迎纠正与补充!

你可能感兴趣的:(调查问卷)