[关闭]
@JackieQu 2018-05-23T20:15:51.000000Z 字数 6265 阅读 1295

复习

儿童编程


复习任务概览(任务时间、完成状态)

Method and Url Structure

Method Resource URL
GET /course/revise_outline/

cURL Example

  1. curl -X GET -H 'Authorization: Token tester001' -d data{...}
  2. http://127.0.0.1:8000/program_face2face/course/revise_outline/

JSON Response

  1. {
  2. "count": 2,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 4,
  8. "owner": "tester001",
  9. "revise_date": "2018-05-20",
  10. "knowledge_number": 1,
  11. "status": "finish"
  12. },
  13. {
  14. "pk": 3,
  15. "owner": "tester001",
  16. "revise_date": "2018-05-19",
  17. "knowledge_number": 1,
  18. "status": "unfinish"
  19. }
  20. ]
  21. }

127.0.0.1:8000/program_face2face/course/knowledge_list/?date=2018-5-23

知识点列表

Method and Url Structure

Method Resource URL
GET /course/knowledge_list/

Request and Parameters

Name Description Required Default
date 复习任务日期 YES

Request

cURL Example

  1. curl -X GET -H 'Authorization: Token tester001' -d data{...}
  2. http://127.0.0.1:8000/program_face2face/course/knowledge_list/?date=2018-5-23

JSON Response

  1. {
  2. "count": 3,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 1,
  8. "owner": "tester001",
  9. "revise_date": "2018-05-23",
  10. "course": 4,
  11. "lesson": 4,
  12. "title": "随机数",
  13. "accuracy": 0,
  14. "status": "unfinish"
  15. },
  16. {
  17. "pk": 6,
  18. "owner": "tester001",
  19. "revise_date": "2018-05-23",
  20. "course": 4,
  21. "lesson": 3,
  22. "title": "一个计算器",
  23. "accuracy": 33,
  24. "status": "finish"
  25. },
  26. {
  27. "pk": 11,
  28. "owner": "tester001",
  29. "revise_date": "2018-05-23",
  30. "course": 4,
  31. "lesson": 6,
  32. "title": "读取多行文件",
  33. "accuracy": 0,
  34. "status": "unfinish"
  35. }
  36. ]
  37. }

复习任务列表

Method and Url Structure

Method Resource URL
GET /course/revise_list/

Request and Parameters

Name Description Required Default
knowledge 知识点pk YES

Request

cURL Example

  1. curl -X GET -H 'Authorization: Token tester001' -d data{...}
  2. http://127.0.0.1:8000/program_face2face/course/revise_list/?knowledge=6

JSON Response

  1. {
  2. "count": 3,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 419,
  8. "course": 4,
  9. "lesson": 3,
  10. "title": "获得用户输入",
  11. "tag": "3-3",
  12. "status": "wrong",
  13. "json": "{\n \"action\": [\n {\n \"content\": \"A\", \n \"type\": \"text\"\n }, \n {\n \"content\": \"B\", \n \"type\": \"text\"\n }, \n {\n \"content\": \"C\", \n \"type\": \"text\"\n }\n ], \n \"answer\": \"B\", \n \"correct\": [\n {\n \"action\": \"下一条\", \n \"chapter\": 23, \n \"grow_number\": 11, \n \"message\": \"答对了\", \n \"zuan_number\": 6\n }\n ], \n \"exercises\": true, \n \"imgs\": [], \n \"message\": \"可以将字符串转换成数字的是?\", \n \"options\": [\n {\n \"content\": \"A\", \n \"imgs\": [], \n \"message\": \"str\"\n }, \n {\n \"content\": \"B\", \n \"imgs\": [], \n \"message\": \"int\"\n }, \n {\n \"content\": \"C\", \n \"imgs\": [], \n \"message\": \"art\"\n }\n ], \n \"tag\": \"3-3\", \n \"wrong\": [\n {\n \"action\": \"下一条\", \n \"chapter\": 22, \n \"grow_number\": 0, \n \"message\": \"答错了\", \n \"zuan_number\": 0\n }\n ]\n}",
  14. "create_time": "2018-05-23T18:30:34.235915"
  15. },
  16. {
  17. "pk": 420,
  18. "course": 4,
  19. "lesson": 3,
  20. "title": "获得用户输入",
  21. "tag": "3-2",
  22. "status": "wrong",
  23. "json": "{\n \"action\": [\n {\n \"content\": \"A\", \n \"type\": \"text\"\n }, \n {\n \"content\": \"B\", \n \"type\": \"text\"\n }, \n {\n \"content\": \"C\", \n \"type\": \"text\"\n }\n ], \n \"answer\": \"A\", \n \"correct\": [\n {\n \"action\": \"下一条\", \n \"chapter\": 21, \n \"grow_number\": 10, \n \"message\": \"答对了\", \n \"zuan_number\": 6\n }\n ], \n \"exercises\": true, \n \"imgs\": [], \n \"message\": \"使用input,用户输入完毕后,按什么键表示完成?\", \n \"options\": [\n {\n \"content\": \"A\", \n \"imgs\": [], \n \"message\": \"回车键\"\n }, \n {\n \"content\": \"B\", \n \"imgs\": [], \n \"message\": \"空格键\"\n }, \n {\n \"content\": \"C\", \n \"imgs\": [], \n \"message\": \"任意键\"\n }\n ], \n \"tag\": \"3-2\", \n \"wrong\": [\n {\n \"action\": \"下一条\", \n \"chapter\": 20, \n \"grow_number\": 0, \n \"message\": \"答错了\", \n \"zuan_number\": 0\n }\n ]\n}",
  24. "create_time": "2018-05-23T18:30:34.247527"
  25. },
  26. {
  27. "pk": 421,
  28. "course": 4,
  29. "lesson": 3,
  30. "title": "获得用户输入",
  31. "tag": "3-1",
  32. "status": "right",
  33. "json": "{\n \"action\": [\n {\n \"content\": \"A\", \n \"type\": \"text\"\n }, \n {\n \"content\": \"B\", \n \"type\": \"text\"\n }\n ], \n \"answer\": \"B\", \n \"correct\": [\n {\n \"action\": \"下一条\", \n \"chapter\": 19, \n \"grow_number\": 7, \n \"message\": \"答对了\", \n \"zuan_number\": 7\n }\n ], \n \"exercises\": true, \n \"imgs\": [], \n \"message\": \"input括号里面的内容是?\", \n \"options\": [\n {\n \"content\": \"A\", \n \"imgs\": [], \n \"message\": \"是用户输入的内容\"\n }, \n {\n \"content\": \"B\", \n \"imgs\": [], \n \"message\": \"让用户知道要输入什么,提示语\"\n }\n ], \n \"tag\": \"3-1\", \n \"wrong\": [\n {\n \"action\": \"下一条\", \n \"chapter\": 18, \n \"grow_number\": 0, \n \"message\": \"答错了\", \n \"zuan_number\": 0\n }\n ]\n}",
  34. "create_time": "2018-05-23T18:30:34.260803"
  35. }
  36. ]
  37. }
  38. # 错误信息
  39. {
  40. "detail": "请先完成之前的复习任务或用钻石跳过"
  41. }

更新复习任务状态(一次更改多条记录)

Method and Url Structure

Method Resource URL
POST /course/revise_update/

Request and Parameters

Name Description Required Default
revise_str 复习答题记录 YES
time 复习花费时间戳差值 YES

Request

  1. {
  2. "revise_str": "[
  3. {'pk': 252, 'status': u'right', 'answer': 'a'},
  4. {'pk': 253, 'status': u'wrong', 'answer': 'b'},
  5. {'pk': 254, 'status': u'wrong', 'answer': 'a,b,c'}
  6. ]",
  7. "time": 60000
  8. }

cURL Example

  1. curl -X POST -H 'Authorization: Token tester001' -d data{...}
  2. http://127.0.0.1:8000/program_face2face/course/revise_update/

JSON Response

  1. {
  2. "status": 0,
  3. "message": "成功更新复习任务状态"
  4. }
  5. # 当天复习任务完成全部完成后返回
  6. # share_img 目前图还没出
  7. {
  8. "total_time": 1000,
  9. "share_img": "https://static1.bcjiaoyu.com/shareimg/tmpA9ro50.jpg",
  10. "days": 4,
  11. "courses": [
  12. "Python1"
  13. ],
  14. "defeated_counts": 2,
  15. "points": 1,
  16. "total_counts": 15,
  17. "accuracy": 0
  18. }

跳过复习任务

Method and Url Structure

Method Resource URL
POST /course/revise_overlook/

Request and Parameters

Name Description Required Default
revise_date 该日期前的任务将被跳过 YES

Request

  1. {
  2. "revise_date": "2018-5-20"
  3. }

cURL Example

  1. curl -X POST -H 'Authorization: Token tester001' -d data{...}
  2. http://127.0.0.1:8000/program_face2face/course/revise_overlook/

JSON Response

  1. {
  2. "status": 0,
  3. "message": "跳过复习任务成功"
  4. }
  5. # 错误信息
  6. {
  7. "status": -4,
  8. "message": "无需跳过"
  9. }
  10. # 或
  11. {
  12. "status": -4,
  13. "message": "钻石不足"
  14. }

复习任务详情

Method and Url Structure

Method Resource URL
GET /course/revise_detail/pk/

cURL Example

  1. curl -X GET -H 'Authorization: Token tester001'
  2. http://127.0.0.1:8000/program_face2face/course/revise_detail/252/

JSON Response

  1. {
  2. "pk": 252,
  3. "course": 4,
  4. "lesson": 3,
  5. "tag": "3-2",
  6. "status": "right",
  7. "json": "{\n \"action\": [\n {\n \"content\": \"A\", \n \"type\": \"text\"\n }, \n {\n \"content\": \"B\", \n \"type\": \"text\"\n }, \n {\n \"content\": \"C\", \n \"type\": \"text\"\n }\n ], \n \"answer\": \"A\", \n \"correct\": [\n {\n \"action\": \"下一条\", \n \"chapter\": 21, \n \"grow_number\": 10, \n \"message\": \"答对了\", \n \"zuan_number\": 6\n }\n ], \n \"exercises\": true, \n \"imgs\": [], \n \"message\": \"使用input,用户输入完毕后,按什么键表示完成?\", \n \"options\": [\n {\n \"content\": \"A\", \n \"imgs\": [], \n \"message\": \"回车键\"\n }, \n {\n \"content\": \"B\", \n \"imgs\": [], \n \"message\": \"空格键\"\n }, \n {\n \"content\": \"C\", \n \"imgs\": [], \n \"message\": \"任意键\"\n }\n ], \n \"tag\": \"3-2\", \n \"wrong\": [\n {\n \"action\": \"下一条\", \n \"chapter\": 20, \n \"grow_number\": 0, \n \"message\": \"答错了\", \n \"zuan_number\": 0\n }\n ]\n}",
  8. "create_time": "2018-05-18T16:56:23.268824"
  9. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注