复习
儿童编程
复习任务概览(任务时间、完成状态)
Method and Url Structure
Method |
Resource URL |
GET |
/course/revise_outline/ |
cURL Example
curl -X GET -H 'Authorization: Token tester001' -d data{...}
http://127.0.0.1:8000/program_face2face/course/revise_outline/
JSON Response
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"pk": 4,
"owner": "tester001",
"revise_date": "2018-05-20",
"knowledge_number": 1,
"status": "finish"
},
{
"pk": 3,
"owner": "tester001",
"revise_date": "2018-05-19",
"knowledge_number": 1,
"status": "unfinish"
}
]
}
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
curl -X GET -H 'Authorization: Token tester001' -d data{...}
http://127.0.0.1:8000/program_face2face/course/knowledge_list/?date=2018-5-23
JSON Response
{
"count": 3,
"next": null,
"previous": null,
"results": [
{
"pk": 1,
"owner": "tester001",
"revise_date": "2018-05-23",
"course": 4,
"lesson": 4,
"title": "随机数",
"accuracy": 0,
"status": "unfinish"
},
{
"pk": 6,
"owner": "tester001",
"revise_date": "2018-05-23",
"course": 4,
"lesson": 3,
"title": "一个计算器",
"accuracy": 33,
"status": "finish"
},
{
"pk": 11,
"owner": "tester001",
"revise_date": "2018-05-23",
"course": 4,
"lesson": 6,
"title": "读取多行文件",
"accuracy": 0,
"status": "unfinish"
}
]
}
复习任务列表
Method and Url Structure
Method |
Resource URL |
GET |
/course/revise_list/ |
Request and Parameters
Name |
Description |
Required |
Default |
knowledge |
知识点pk |
YES |
|
Request
cURL Example
curl -X GET -H 'Authorization: Token tester001' -d data{...}
http://127.0.0.1:8000/program_face2face/course/revise_list/?knowledge=6
JSON Response
{
"count": 3,
"next": null,
"previous": null,
"results": [
{
"pk": 419,
"course": 4,
"lesson": 3,
"title": "获得用户输入",
"tag": "3-3",
"status": "wrong",
"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}",
"create_time": "2018-05-23T18:30:34.235915"
},
{
"pk": 420,
"course": 4,
"lesson": 3,
"title": "获得用户输入",
"tag": "3-2",
"status": "wrong",
"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}",
"create_time": "2018-05-23T18:30:34.247527"
},
{
"pk": 421,
"course": 4,
"lesson": 3,
"title": "获得用户输入",
"tag": "3-1",
"status": "right",
"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}",
"create_time": "2018-05-23T18:30:34.260803"
}
]
}
# 错误信息
{
"detail": "请先完成之前的复习任务或用钻石跳过"
}
更新复习任务状态(一次更改多条记录)
Method and Url Structure
Method |
Resource URL |
POST |
/course/revise_update/ |
Request and Parameters
Name |
Description |
Required |
Default |
revise_str |
复习答题记录 |
YES |
|
time |
复习花费时间戳差值 |
YES |
|
Request
{
"revise_str": "[
{'pk': 252, 'status': u'right', 'answer': 'a'},
{'pk': 253, 'status': u'wrong', 'answer': 'b'},
{'pk': 254, 'status': u'wrong', 'answer': 'a,b,c'}
]",
"time": 60000
}
cURL Example
curl -X POST -H 'Authorization: Token tester001' -d data{...}
http://127.0.0.1:8000/program_face2face/course/revise_update/
JSON Response
{
"status": 0,
"message": "成功更新复习任务状态"
}
# 当天复习任务完成全部完成后返回
# share_img 目前图还没出
{
"total_time": 1000,
"share_img": "https://static1.bcjiaoyu.com/shareimg/tmpA9ro50.jpg",
"days": 4,
"courses": [
"Python1"
],
"defeated_counts": 2,
"points": 1,
"total_counts": 15,
"accuracy": 0
}
跳过复习任务
Method and Url Structure
Method |
Resource URL |
POST |
/course/revise_overlook/ |
Request and Parameters
Name |
Description |
Required |
Default |
revise_date |
该日期前的任务将被跳过 |
YES |
|
Request
{
"revise_date": "2018-5-20"
}
cURL Example
curl -X POST -H 'Authorization: Token tester001' -d data{...}
http://127.0.0.1:8000/program_face2face/course/revise_overlook/
JSON Response
{
"status": 0,
"message": "跳过复习任务成功"
}
# 错误信息
{
"status": -4,
"message": "无需跳过"
}
# 或
{
"status": -4,
"message": "钻石不足"
}
复习任务详情
Method and Url Structure
Method |
Resource URL |
GET |
/course/revise_detail/pk/ |
cURL Example
curl -X GET -H 'Authorization: Token tester001'
http://127.0.0.1:8000/program_face2face/course/revise_detail/252/
JSON Response
{
"pk": 252,
"course": 4,
"lesson": 3,
"tag": "3-2",
"status": "right",
"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}",
"create_time": "2018-05-18T16:56:23.268824"
}