[关闭]
@chengxuyuan 2020-04-28T08:32:54.000000Z 字数 9845 阅读 530

直播教室

学管系统


获取直播课分类下所有教室、获取直播课程下所有教室、获取所有教室

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/job_management/list_live_classroom/ 获取直播课分类下所有教室、获取直播课程下所有教室、获取所有教室 YES

category(直播课分类pk):示例: /server/job_management/list_live_classroom/?category=1
live_course(直播课程pk): 示例: /server/job_management/list_live_classroom/?live_course=1
两个参数都不传时,默认取所有教室
course_type(直播课类型normal practice): 示例:/server/job_management/list_live_classroom/?course_type=normal

Response

  1. {
  2. "count": 17,
  3. "next": "http://127.0.0.1:8000/server/job_management/list_live_classroom/?category=2&page=2",
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 129,
  8. "title": "试讲05",
  9. "url": "https://live.coding61.com/chengxuyuan-live/vf46a9v6eu4qjuu8xk2urww4fomd3iq8.flv?auth_key=1550401200-y18wm198b4n4bsds-0-8ec073d5b66865cc1fa396ed31e11620",
  10. "push_url": "rtmp://push1.coding61.com/chengxuyuan-live/vf46a9v6eu4qjuu8xk2urww4fomd3iq8?auth_key=1550401200-ho5xmyg9p5956l83-0-0c4a6f4b3887b886e8f36d817334ef3a",
  11. "live_url": "https://live.coding61.com/chengxuyuan-live/vf46a9v6eu4qjuu8xk2urww4fomd3iq8.flv?auth_key=1550401200-y18wm198b4n4bsds-0-8ec073d5b66865cc1fa396ed31e11620",
  12. "mobile_live_url": "https://live.coding61.com/chengxuyuan-live/vf46a9v6eu4qjuu8xk2urww4fomd3iq8.m3u8?auth_key=1550401200-43vkftb9sdxypxj2-0-77f147f855abd22d06848752aff5e998",
  13. "admin": "17338156831",
  14. "tag": null,
  15. "user_list": "15010710528,15016152275,88820190201,88820190202,88820190203,88820190203,88820190204,88820190205,88820190206,88820190207,88820190207,88820190208,88820190209,88820190210",
  16. "introduction": "试讲",
  17. "start_time": "2019-02-17T17:00:00",
  18. "isfinish": false,
  19. "mins": 60,
  20. "stream_name": "vf46a9v6eu4qjuu8xk2urww4fomd3iq8",
  21. "video_id": null,
  22. "teacher_userinfo": {
  23. "name": "橙旭园张燕菲老师",
  24. "avatar": "https://static1.bcjiaoyu.com/head1@3x.png",
  25. "user": "17338156831",
  26. "nickname": null
  27. },
  28. "question_config": null,
  29. "live_type": "private",
  30. "course_type": "normal",
  31. "rongyun_group_id": "rongyun-group-id-129",
  32. "need_practice": false,
  33. "total_normal_class": 0,
  34. "live_course": 3,
  35. "course_num": 0,
  36. "practice_url": "",
  37. "is_audio": true,
  38. "editor_type": "python"
  39. }
  40. ]
  41. }

新建直播教室

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
POST /server/job_management/create_live_classroom/ 新建教室 YES

Request Parameters

Name Description Required Default
admin 班主任的账号 YES
teacher 教师的账号 YES
live_course 直播课程的pk YES
title 标题 YES
tag 活动 tag YES
user_list 观看用户列表 YES
introduction 详情介绍 YES
start_time 开始时间 YES
mins 时长(分钟) YES
video_id 视频ID YES
question_config 答题配置 YES
record 是否录播 YES
isfinish 是否结束 YES
live_type 直播类型 YES
course_type 教室类型 YES
total_normal_class 正课课时总数 YES
course_num 本期课程教室编号 YES
need_practice 是否需要练习 YES
practice_url 课后习题地址列表 YES
exercises 课中习题列表 YES
practice_exercises 练习课中习题列表(格式啥的同 exercises 一样) YES

live_type: public(公开) 和 private(不公开)
course_type: normal(正课) 和 practice(练习课)
question_config: 答题配置,如果有合法的.json地址,则传,否则填空。不能填url 后缀非.json或者不合法的地址
editor_type: applab(APPLab 编辑器) 、gamelab(GameLab 编辑器)、 scratch(Scratch 编辑器)、 python(Python 编辑器)

Request Data

  1. {
  2. "admin":"15201052252",
  3. "live_course":2,
  4. "title":"直播教室标题",
  5. "tag":"",
  6. "user_list":"15201052252,15010710528",
  7. "introduction":"直播教室详情介绍",
  8. "start_time":"2019-04-14 17:30:00",
  9. "mins":60,
  10. "video_id":"",
  11. "question_config":"",
  12. "record":true,
  13. "isfinish":false,
  14. "live_type":"private",
  15. "course_type":"normal",
  16. "total_normal_class":20,
  17. "course_num":1,
  18. "need_practice":false,
  19. "practice_url":"",
  20. "exercises":"",
  21. "practice_exercises"
  22. }

Response

  1. {
  2. "pk": 144,
  3. "title": "直播教室标题",
  4. "url": "https://live.coding61.com/chengxuyuan-live/b8p47a3akoi4hfln8nhj38swag3ifz73.flv?auth_key=1519990880-jgrhcnk8gia3hxhu-0-d267d54f315fe351c3380417208f140e",
  5. "push_url": "rtmp://push1.coding61.com/chengxuyuan-live/b8p47a3akoi4hfln8nhj38swag3ifz73?auth_key=1519990880-2k1rxaw7oq5ufpbp-0-e4818300d14e73faaca941962b88d4f8",
  6. "live_url": "https://live.coding61.com/chengxuyuan-live/b8p47a3akoi4hfln8nhj38swag3ifz73.flv?auth_key=1519990880-jgrhcnk8gia3hxhu-0-d267d54f315fe351c3380417208f140e",
  7. "mobile_live_url": "https://live.coding61.com/chengxuyuan-live/b8p47a3akoi4hfln8nhj38swag3ifz73.m3u8?auth_key=1519990880-5m1hcnai3xu7e4k4-0-e150451c4614017d62b9a58d9da55c3f",
  8. "admin": "15201052252",
  9. "tag": "",
  10. "user_list": "15201052252,15010710528",
  11. "introduction": "直播教室详情介绍",
  12. "start_time": "2019-04-14T17:30:00",
  13. "isfinish": false,
  14. "mins": 60,
  15. "stream_name": "b8p47a3akoi4hfln8nhj38swag3ifz73",
  16. "video_id": "",
  17. "teacher_userinfo": {
  18. "name": "啦啦啦",
  19. "avatar": "https://static1.bcjiaoyu.com/5a7ede147308f194ed9b108f98589a07_v.jpg-1080x1920",
  20. "user": "15201052252",
  21. "nickname": "chen"
  22. },
  23. "question_config": "",
  24. "live_type": "private",
  25. "course_type": "normal",
  26. "rongyun_group_id": "rongyun-group-id-144",
  27. "need_practice": false,
  28. "total_normal_class": 20,
  29. "live_course": 2,
  30. "course_num": 1,
  31. "practice_url": "",
  32. "is_audio": true,
  33. "editor_type": "python"
  34. }

修改直播教室

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
PATCH /server/job_management/update_live_classroom/${pk}/ 修改教室 YES

pk: 教室的 pk

Request Parameters

Name Description Required Default
title 标题 YES
start_time 开始时间 YES
total_normal_class 正课课时总数 YES
course_num 本期课程教室编号 YES
handout 该教室对应的讲义地址 NO

Request Data

  1. {
  2. "title":"试讲051",
  3. "start_time":"2019-02-17 17:01:00",
  4. "total_normal_class":10,
  5. "course_num":1,
  6. "handout":"fdsf"
  7. }

Response

  1. {
  2. "pk": 129,
  3. "title": "试讲051",
  4. "url": "https://live.coding61.com/chengxuyuan-live/vf46a9v6eu4qjuu8xk2urww4fomd3iq8.flv?auth_key=1550401200-y18wm198b4n4bsds-0-8ec073d5b66865cc1fa396ed31e11620",
  5. "push_url": "rtmp://push1.coding61.com/chengxuyuan-live/vf46a9v6eu4qjuu8xk2urww4fomd3iq8?auth_key=1550401200-ho5xmyg9p5956l83-0-0c4a6f4b3887b886e8f36d817334ef3a",
  6. "live_url": "https://live.coding61.com/chengxuyuan-live/vf46a9v6eu4qjuu8xk2urww4fomd3iq8.flv?auth_key=1550401200-y18wm198b4n4bsds-0-8ec073d5b66865cc1fa396ed31e11620",
  7. "mobile_live_url": "https://live.coding61.com/chengxuyuan-live/vf46a9v6eu4qjuu8xk2urww4fomd3iq8.m3u8?auth_key=1550401200-43vkftb9sdxypxj2-0-77f147f855abd22d06848752aff5e998",
  8. "admin": "17338156831",
  9. "tag": null,
  10. "user_list": "15010710528,15016152275,88820190201,88820190202,88820190203,88820190203,88820190204,88820190205,88820190206,88820190207,88820190207,88820190208,88820190209,88820190210",
  11. "introduction": "试讲",
  12. "start_time": "2019-02-17T17:01:00",
  13. "isfinish": false,
  14. "mins": 60,
  15. "stream_name": "vf46a9v6eu4qjuu8xk2urww4fomd3iq8",
  16. "video_id": null,
  17. "teacher_userinfo": {
  18. "name": "橙旭园张燕菲老师",
  19. "avatar": "https://static1.bcjiaoyu.com/head1@3x.png",
  20. "user": "17338156831",
  21. "nickname": null
  22. },
  23. "question_config": null,
  24. "live_type": "private",
  25. "course_type": "normal",
  26. "rongyun_group_id": "rongyun-group-id-129",
  27. "need_practice": false,
  28. "total_normal_class": 10,
  29. "live_course": 3,
  30. "course_num": 1,
  31. "practice_url": "",
  32. "handout":"fdsf"
  33. }

刷新直播教室推流地址

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
PUT /server/job_management/refresh_live_classroom/${pk}/ 刷新教室 YES

批量建教室

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
POST /server/job_management/add_classrooms/ 批量建教室 YES

Request Parameters

Name Description Required Default
admin 管理员账号 YES
teacher 班主任账号 YES
live_course 直播课程的 pk YES
course_type 教室类型 YES
user_list 观看用户列表 YES
start_time 开始时间 YES
total_lesson 一次性建几节教室 YES
live_type 直播教室类型公开还是私有 YES private
batch_type 批量创建的方式选择 YES three

course_type: 直播课(normal)、练习课(practice)、项目课(project)
live_type: public(公开教室)、private(非公开教室)
batch_type: one(周六周日无教室,周一至周五有教室)、two(周二周三无教室,周四至周一有教室,教室之间的间隔是一天)、three(每节教室的上课时间间隔 7 天)、four(同一个时间)

Request Data

  1. {
  2. "admin":"15201052252",
  3. "live_course":2,
  4. "course_type":"normal",
  5. "user_list":"",
  6. "start_time":"2019-04-28 17:30:00",
  7. "total_lesson":4
  8. }

Response

  1. {
  2. "status": 0,
  3. "message": ""
  4. }

批量修改已知教室组某些字段(讲义)

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
PUT /server/job_management/update_handout_classrooms/ 批量修改已知教室组某些字段 YES

Request Parameters

Name Description Required Default
classrooms 直播教室pk组 YES
handout 讲义 NO

Request Data

  1. {
  2. "classrooms":[66, 67],
  3. "handout":"212"
  4. }

Response

  1. {
  2. "status": 0,
  3. "message": ""
  4. }

批量修改教室的时间

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
PUT /server/job_management/update_classrooms/ 批量修改教室时间 YES

Request Parameters

Name Description Required Default
live_classroom 要修改的教室组中的第一个(教室的开始时间靠前的那一个)教室 pk YES
start_time 开始时间 YES
batch_type

course_type: 直播课(normal)、练习课(practice)、项目课(project)
batch_type取值如下:
one 周六周日无教室,周一至周五有教室,教室之间的间隔是一天
two 周二周三无教室,周四至周一有教室,教室之间的间隔是一天
three 每节教室的上课时间间隔 7 天
four 同一个时间

Request Data

  1. {
  2. "start_time":"2019-05-08 17:30:00",
  3. "live_classroom":164,
  4. "batch_type":"three"
  5. }

Response

  1. {
  2. "status": 0,
  3. "message": ""
  4. }

批量将直播教室的是否有语音变成 False

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/job_management/update_is_audio_classrooms/ 批量修改是否有语音 YES

Request Parameters

Name Description Required Default
classroom_pks 批量修改的教室组 pk YES

示例:/server/job_management/update_is_audio_classrooms/?classroom_pks=70,71
不传的话,默认修改全部

Response

  1. {
  2. "status": 0,
  3. "message": ""
  4. }

直播教室结束时,获取教室的评分

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
PUT /server/job_management/live_classroom_evaluate/ 直播教室的评分 YES

Request Parameters

Name Description Required Default
pk 直播教室的pk YES

Response Parameters

Name Description
attendance_rate 到课率
interactive_rate 互动率
right_rate 正确率

Response

  1. {
  2. "pk": 1,
  3. "live_classroom": {
  4. "title": "测试电话提醒",
  5. "pk": 142
  6. },
  7. "attendance_rate": "0.25",
  8. "interactive_rate": "0.50",
  9. "right_rate": "0.00"
  10. }

加入直播教室

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
POST /server/classroom/create_attendance/ 加入直播教室 YES

cURL Example

  1. curl -X POST http://127.0.0.1:8000/server/classroom/create_attendance/ -H 'Content-Type: application/json' -H 'Authorization: Token f5d99e3acf2b3e76d63d4a8a8a2389d86e43d9cc' --data '{"classroom_id":38, "status":"live"}'

Request Parameters

Name Description Required Default
classroom_id 直播教室id YES
status 直播教室的状态(直播live、回放replay)

Request

  1. {
  2. "classroom_id":38,
  3. "status":"replay"
  4. }

Response

  1. {
  2. "id": 2,
  3. "owner": {
  4. "name": "勿问情殇_1111_23",
  5. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/5690023e83a72af4ff5be0badaadfbe4_k.gif-658x658",
  6. "user": "15201052252",
  7. "nickname": "chen",
  8. "realname": "陈微",
  9. "user_id": 367,
  10. "is_staff": false,
  11. "segment": {
  12. "name": "黄金",
  13. "image": "https://static1.bcjiaoyu.com/community/touxiangkuang/king.png"
  14. }
  15. },
  16. "classroom": 38,
  17. "deleted": false,
  18. "create_time": "2020-04-28T16:12:00.843144",
  19. "order_index": 1000,
  20. "status": "replay"
  21. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注