[关闭]
@chengxuyuan 2020-04-28T08:40:20.000000Z 字数 3827 阅读 382

月赛-试卷

学管系统


试卷倒计时

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
PUT /server/job_management/exam_countdown/ 试卷倒计时 YES

cURL Example

  1. curl -X PUT http://127.0.0.1:8000/server/job_management/exam_countdown/ -H 'Content-Type: application/json' -H 'Authorization: Token f5d99e3acf2b3e76d63d4a8a8a2389d86e43d9cc' --data '{"exam":1, "used_duration":30}'

Request Parameters

Name Description Required Default
exam 试卷id YES
used_duration 已用时长(秒), NO

used_duration参数,则会重置服务器已用时长,不传则是获取服务器的已用时长

Request

  1. {
  2. "exam":1,
  3. "used_duration":30
  4. }

Response

  1. {
  2. "duration": 0,
  3. "used_duration": 30
  4. }

月赛分类

分类列表

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/job_management/list_category/ 分类列表 YES

Response

  1. {
  2. "count": 2,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 1,
  8. "title": "Python Level 1",
  9. "content": "",
  10. "is_answer": false,
  11. "is_certified": false
  12. },
  13. {
  14. "pk": 2,
  15. "title": "前端技术",
  16. "content": "",
  17. "is_answer": false,
  18. "is_certified": false
  19. }
  20. ]
  21. }

试卷(月赛)

开始答卷

开始作答某个分类下最新的一套试卷
1.如果用户没有这张最新的试卷,则直接返回试卷详情序列(用户做完题提交后,再创作答题记录、试卷记录)
2.如果用户已有这张最新的试卷,则直接返回他的试卷记录详情序列

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
PUT /server/job_management/begin_game_exam/ 开始答卷 YES

Request Parameters

Name Description Required Default
category 试卷的分类 pk YES

Request Data

  1. {
  2. "category":1
  3. }

Response

  1. 情况1:
  2. {
  3. "status": -4,
  4. "message": "该分类下暂时还未有试卷"
  5. }
  6. 情况2(试卷详情数据):
  7. {
  8. "pk": 9,
  9. "course_category": null,
  10. "name": "Python Level 1 试卷1",
  11. "questions": [
  12. {
  13. "pk": 59,
  14. "title": "问题的题目描述1111",
  15. "photo": "https://static1.bcjiaoyu.com/public.png,https://static1.bcjiaoyu.com//Tiny-21539780778%281%29.png",
  16. "question_type": "blank",
  17. "analysis": "题目分析111",
  18. "options": [
  19. {
  20. "pk": 152,
  21. "number": "",
  22. "title": "填空 题答 案1↵",
  23. "photo": "",
  24. "is_answer": false,
  25. "question": 59,
  26. "option_type": "middle",
  27. "match_options": null
  28. }
  29. ],
  30. "course_category": {
  31. "pk": 1,
  32. "id": 1,
  33. "deleted": false,
  34. "create_time": "2019-04-10T16:13:18.984182",
  35. "order_index": 1000,
  36. "name": "编程思维",
  37. "desciption": "编程思维",
  38. "public": false
  39. },
  40. "answers": [
  41. "填空 题答 案1↵"
  42. ],
  43. "remark": "",
  44. "difficult_grade": "harder"
  45. }
  46. ],
  47. "question_ids": "55,17,29,39,30,27,36,8,59,56",
  48. "practice_link": null,
  49. "is_hide": false,
  50. "is_countdown": false,
  51. "duration": 0
  52. }
  53. 情况3(试卷记录详情数据):
  54. {
  55. "pk": 34,
  56. "owner": {
  57. "name": "勿问情殇",
  58. "avatar": "https://static1.bcjiaoyu.com/5a7ede147308f194ed9b108f98589a07_v.jpg-1080x1920",
  59. "user": "15201052252",
  60. "nickname": "chen",
  61. "user_id": 367,
  62. "is_staff": false
  63. },
  64. "exam": 10,
  65. "exam_display": "Python Level 1 试卷2",
  66. "live_classroom": null,
  67. "practice_link": null,
  68. "team": null,
  69. "right_rate": "100%",
  70. "correction_rate": "0%",
  71. "answer_records": [
  72. {
  73. "pk": 232,
  74. "owner": {
  75. "name": "勿问情殇",
  76. "avatar": "https://static1.bcjiaoyu.com/5a7ede147308f194ed9b108f98589a07_v.jpg-1080x1920",
  77. "user": "15201052252",
  78. "nickname": "chen",
  79. "user_id": 367,
  80. "is_staff": false
  81. },
  82. "exam_record": 34,
  83. "question": {
  84. "pk": 27,
  85. "title": "问题的题目描述1111",
  86. "photo": "问题的图片描述1111",
  87. "question_type": "connection",
  88. "analysis": "题目分析111",
  89. "options": [
  90. {
  91. "pk": 42,
  92. "number": "1",
  93. "title": "右边选项 1",
  94. "photo": "",
  95. "is_answer": false,
  96. "question": 27,
  97. "option_type": "right",
  98. "match_options": null
  99. }
  100. ],
  101. "course_category": {
  102. "pk": 2,
  103. "id": 2,
  104. "deleted": false,
  105. "create_time": "2019-04-10T16:13:25.553121",
  106. "order_index": 1000,
  107. "name": "编程创作",
  108. "desciption": "编程创作",
  109. "public": false
  110. },
  111. "remark": "",
  112. "difficult_grade": "simple"
  113. },
  114. "is_right": true,
  115. "user_answers": {
  116. "44": [
  117. 42,
  118. 43
  119. ],
  120. "46": [
  121. 45
  122. ]
  123. }
  124. }
  125. ],
  126. "wrong_num": 0
  127. }

提交答卷

提交试卷 api,即根据试卷的 pk 创建试卷记录和答题记录的过程

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
PUT /server/job_management/submit_game_exam/ 交卷 YES

Request Parameters

Name Description Required Default
exam 试卷的pk YES
exercises 试卷中习题作答情况 YES

Request Data

  1. {
  2. "exam":10,
  3. "exercises":[
  4. {"question":27, "option":{"44": [42,43],"46": [45]} },
  5. {"question":55, "option":[]},
  6. {"question":11, "option":[10]},
  7. {"question":38, "option":["填空题答案","填空题答案"]},
  8. {"question":37, "option":[83]},
  9. {"question":28, "option":{"49": [47,48],"51": [50]} },
  10. {"question":12, "option":["填空题答案1","填空题答案2"]},
  11. {"question":36, "option":{"78": [76,77],"80": [79]} },
  12. {"question":59, "option":["填空题答 案1↵"]},
  13. {"question":56, "option":[144]}
  14. ]
  15. }

Response

  1. {
  2. "right_rate": "100%"
  3. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注