[关闭]
@ranger-01 2016-12-12T19:49:55.000000Z 字数 5148 阅读 929

Questionnaire Design

questionnaire srs


MRD

教务员或者相关人员可以创建一个问卷调查,并收集调查结果。从而以此调查结果为依据,改进教学质量(调查问卷的创建,调查结果的查看,可以不再eeap平台上面)

PRD

教务员:
    1. CRUD(创建,预览,编辑,删除)试题
    1. CRUD(创建,预览,编辑,删除)调查问卷
    2. 发布调查问卷
    3. 查看调查问卷统计信息

被调查者:
    1. 查看,填写调查问卷,并提交

Typical user case

SRS

问卷内容

1. 只支持单选,多选,填空三种类型的题目

发布问卷

1. 生成一个固定连接,类容就是生成预览时生成的html网页

issue

  1. find a questionnaire django app, but can not make it run

  2. QQ questionnaire use CKEditor, find a django-ckeditor

DB schema

Questionnaire(can be divided to QuestionnaireSet and Questionnaire)

Field Type Introduction
ID integer Questionnaire id
Name char Questionnaire name
Desc text Questionnaire purpose
Valid_num integer How many use submit the form
q_ids many-to-many to question table
pub_url text the html address of questionnaire puhlished
com_url text the html address when respondent finish the questionnaire
is_pub integer Form is published or not

Question

Field Type Introduction
ID integer Question id
Type Integer Question type(single, multi, completion)
is_Mandatory Integer Is mandatory or not (if this depend on questionnaire, this field should used in many-to-many through )
Desc text Question content
c_ids many-to-many to choice table
is_used integer the question has been used by questionnaire or not
tags many-to-many to tag table
owner foreginKey to user

tag

Field Type Introduction
ID integer choice id
text char desc of the tag

Choice

Field Type Introduction
ID integer choice id
value integer For choice content, default is the choice_id
Desc text choice content
is_used integer the question has been used by questionnaire or not

Answer

Field Type Introduction
ID integer Answer id
qn_id questinnaire, ForeginKkey
q_id question, ForeginKkey
c_id choice, ForeginKkey
u_id answer belong to, ForeginKkey

Operation

Question

  1. Create, Update question
  2. URL: /api/v1/questions/
  3. Method: POST
  4. Data: {
  5. choices: [
  6. {
  7. id: 0, // used when update
  8. desc: 'choice description',
  9. value: none,
  10. is_used: 0
  11. },
  12. ],
  13. q_id: 0, // used when update
  14. type: 0,
  15. is_mandatory: 0,
  16. desc: 'question content',
  17. is_used: 0,
  18. tags: [
  19. 'tag1',
  20. 'tag2'
  21. ]
  22. }
  23. ret: {
  24. status: 200
  25. data: {
  26. c_ids: [0, 1, 2],
  27. q_id: 0,
  28. type: 0,
  29. is_mandatory: 0,
  30. desc: 'question content',
  31. is_used: 0,
  32. tags: [0, 1],
  33. owner: 0
  34. }
  35. }
  36. {
  37. status: 400,
  38. data: {
  39. msg: 'create question error'
  40. }
  41. }
  42. ----------------------------------------------------------------------------------------
  43. Delete question
  44. URL: /api/v1/questions/
  45. Method: POST
  46. Data: {
  47. q_id: 0,
  48. }
  49. ret: {
  50. status: 400/200,
  51. data: {
  52. msg: 'create question error / delete success'
  53. }
  54. }
  55. ----------------------------------------------------------------------------------------
  56. Get question info
  57. URL: /api/v1/questions/:qid/
  58. Method: GET
  59. ret: {
  60. status: 200
  61. data: {
  62. c_ids: [0, 1, 2],
  63. q_id: 0,
  64. type: 0,
  65. is_mandatory: 0,
  66. desc: 'question content',
  67. is_used: 0,
  68. tags: [0, 1],
  69. owner: 0
  70. }
  71. }
  72. {
  73. status: 400,
  74. data: {
  75. msg: 'get question info error'
  76. }
  77. }
  78. ----------------------------------------------------------------------------------------
  79. Get question list
  80. URL: /api/v1/questions/
  81. Method: GET
  82. ret: {
  83. status: 200
  84. data: {
  85. q_ids: [0, 1, 2],
  86. }
  87. }
  88. {
  89. status: 400,
  90. data: {
  91. msg: 'get questions error'
  92. }
  93. }

Questionnaire

  1. Create, Update
  2. URL: /api/v1/questionnaires/
  3. Method: POST
  4. Data: {
  5. id: 0, // used when update
  6. q_ids: [0, 1, 2],
  7. name: 'questionnaire-1',
  8. desc: 'why i create this questionnaire',
  9. valid_num: 0,
  10. is_pub: 0
  11. }
  12. ret: {
  13. status: 200
  14. data: {
  15. id: 0, // used when update
  16. q_ids: [0, 1, 2],
  17. name: 'questionnaire-1',
  18. desc: 'why i create this questionnaire',
  19. valid_num: 0,
  20. is_pub: 0
  21. pub_url: 'http:xxxxxxxx',
  22. pub_url: 'http:xxxxxxxx'
  23. }
  24. }
  25. {
  26. status: 400,
  27. data: {
  28. msg: 'create questionnaire error'
  29. }
  30. }
  31. ----------------------------------------------------------------------------------------
  32. Delete
  33. URL: /api/v1/questionnaires/
  34. Method: POST
  35. Data: {
  36. qn_id: 0,
  37. }
  38. ret: {
  39. status: 400/200,
  40. data: {
  41. msg: 'create question error / delete success'
  42. }
  43. }
  44. ----------------------------------------------------------------------------------------
  45. Get questionnaires info
  46. URL: /api/v1/questionnaires/:qnid/
  47. Method: GET
  48. ret: {
  49. status: 200
  50. data: {
  51. id: 0, // used when update
  52. q_ids: [0, 1, 2],
  53. name: 'questionnaire-1',
  54. desc: 'why i create this questionnaire',
  55. valid_num: 0,
  56. is_pub: 0
  57. pub_url: 'http:xxxxxxxx',
  58. pub_url: 'http:xxxxxxxx'
  59. }
  60. }
  61. {
  62. status: 400,
  63. data: {
  64. msg: 'get question info error'
  65. }
  66. }
  67. ----------------------------------------------------------------------------------------
  68. Get questionnaires list
  69. URL: /api/v1/questionnaires/
  70. Method: GET
  71. ret: {
  72. status: 200
  73. data: {
  74. qn_ids: [0, 1, 2],
  75. }
  76. }
  77. {
  78. status: 400,
  79. data: {
  80. msg: 'get questionnaires error'
  81. }
  82. }

submit questionnaire

  1. submit questionnaire
  2. URL: /api/v1/answers/
  3. Method: POST
  4. Data: {
  5. qn_id: 0,
  6. owner: 0,
  7. answers: [
  8. {
  9. q_id: 0,
  10. q_type: 0,
  11. c_id: [0, 1],
  12. text: 'this is just for completion'
  13. },
  14. ]
  15. }
  16. ret: {
  17. status: 200
  18. data: {
  19. msg: 'submit success'
  20. }
  21. }
  22. {
  23. status: 400,
  24. data: {
  25. msg: 'get questionnaires error'
  26. }
  27. }

report of questionnaire

  1. report of questionnaire
  2. URL: /api/v1/report/:qn_id/
  3. Method: GET
  4. ret: {
  5. status: 200
  6. data: {
  7. answers: [
  8. {
  9. q_id: 0,
  10. a_ids: [0, 1, 2]
  11. }
  12. ]
  13. }
  14. }
  15. {
  16. status: 400,
  17. data: {
  18. msg: 'get questionnaires error'
  19. }
  20. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注