月赛-试卷
学管系统
试卷倒计时
Method and URL Structure
| Method |
Method Resource URL |
Descriptions |
Authentications Required |
| PUT |
/server/job_management/exam_countdown/ |
试卷倒计时 |
YES |
cURL Example
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
{ "exam":1, "used_duration":30}
Response
{ "duration": 0, "used_duration": 30}
月赛分类
分类列表
Method and URL Structure
| Method |
Method Resource URL |
Descriptions |
Authentications Required |
| GET |
/server/job_management/list_category/ |
分类列表 |
YES |
Response
{ "count": 2, "next": null, "previous": null, "results": [ { "pk": 1, "title": "Python Level 1", "content": "", "is_answer": false, "is_certified": false }, { "pk": 2, "title": "前端技术", "content": "", "is_answer": false, "is_certified": false } ]}
试卷(月赛)
开始答卷
开始作答某个分类下最新的一套试卷
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
{ "category":1}
Response
情况1:{ "status": -4, "message": "该分类下暂时还未有试卷"}情况2(试卷详情数据):{ "pk": 9, "course_category": null, "name": "Python Level 1 试卷1", "questions": [ { "pk": 59, "title": "问题的题目描述1111", "photo": "https://static1.bcjiaoyu.com/public.png,https://static1.bcjiaoyu.com//Tiny-21539780778%281%29.png", "question_type": "blank", "analysis": "题目分析111", "options": [ { "pk": 152, "number": "", "title": "填空 题答 案1↵", "photo": "", "is_answer": false, "question": 59, "option_type": "middle", "match_options": null } ], "course_category": { "pk": 1, "id": 1, "deleted": false, "create_time": "2019-04-10T16:13:18.984182", "order_index": 1000, "name": "编程思维", "desciption": "编程思维", "public": false }, "answers": [ "填空 题答 案1↵" ], "remark": "", "difficult_grade": "harder" } ], "question_ids": "55,17,29,39,30,27,36,8,59,56", "practice_link": null, "is_hide": false, "is_countdown": false, "duration": 0}情况3(试卷记录详情数据):{ "pk": 34, "owner": { "name": "勿问情殇", "avatar": "https://static1.bcjiaoyu.com/5a7ede147308f194ed9b108f98589a07_v.jpg-1080x1920", "user": "15201052252", "nickname": "chen", "user_id": 367, "is_staff": false }, "exam": 10, "exam_display": "Python Level 1 试卷2", "live_classroom": null, "practice_link": null, "team": null, "right_rate": "100%", "correction_rate": "0%", "answer_records": [ { "pk": 232, "owner": { "name": "勿问情殇", "avatar": "https://static1.bcjiaoyu.com/5a7ede147308f194ed9b108f98589a07_v.jpg-1080x1920", "user": "15201052252", "nickname": "chen", "user_id": 367, "is_staff": false }, "exam_record": 34, "question": { "pk": 27, "title": "问题的题目描述1111", "photo": "问题的图片描述1111", "question_type": "connection", "analysis": "题目分析111", "options": [ { "pk": 42, "number": "1", "title": "右边选项 1", "photo": "", "is_answer": false, "question": 27, "option_type": "right", "match_options": null } ], "course_category": { "pk": 2, "id": 2, "deleted": false, "create_time": "2019-04-10T16:13:25.553121", "order_index": 1000, "name": "编程创作", "desciption": "编程创作", "public": false }, "remark": "", "difficult_grade": "simple" }, "is_right": true, "user_answers": { "44": [ 42, 43 ], "46": [ 45 ] } } ], "wrong_num": 0}
提交答卷
提交试卷 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
{ "exam":10, "exercises":[ {"question":27, "option":{"44": [42,43],"46": [45]} }, {"question":55, "option":[]}, {"question":11, "option":[10]}, {"question":38, "option":["填空题答案","填空题答案"]}, {"question":37, "option":[83]}, {"question":28, "option":{"49": [47,48],"51": [50]} }, {"question":12, "option":["填空题答案1","填空题答案2"]}, {"question":36, "option":{"78": [76,77],"80": [79]} }, {"question":59, "option":["填空题答 案1↵"]}, {"question":56, "option":[144]} ]}
Response
{ "right_rate": "100%"}