竞赛
橙旭园儿童编程
获取当前竞赛
Method and URL Structure
| Method |
Method Resource URL |
Descriptions |
Authentications Required |
| GET |
/server/contest/activity/ |
获取当前竞赛 |
YES |
Request Parameters
| Name |
Description |
Required |
Default |
| activity_type |
类型 |
YES |
|
| activity_type_f |
类型 |
NO |
|
Parameters Description
| Name |
Description |
| math |
数学 |
| show |
作品秀 |
| NOIP |
NOIP |
| porgram_1 |
编程思维 |
| program_2 |
编程创作 |
| program_3 |
开发思维 |
cURL Example
curl -H 'Authorization: Token db4b5deed80091404ec2a295076221cf1f814b3e' http://127.0.0.1:8000/server/contest/activity/?activity_type=math
Response
{ "count":1, "next":null, "previous":null, "results":[{ "pk":1, "number":"hhmr2bhnhvslnhot", "start_time":"2019-03-05T17:09:00", "end_time":"2019-03-05T17:09:00", "finished": false, "grades":{ "0":"学龄前", "1":"一年级", "2":"二年级", "3":"三年级", "4":"四年级", "5":"五年级", "6":"六年级" }, record: {...} }]}
Response Data Description
| Name |
Description |
| number |
活动号 |
| grades |
年级各编号 |
| start_time |
开始时间 |
| end_time |
结束时间 |
| finished |
是否结束 |
开始答题
Method and URL Structure
| Method |
Method Resource URL |
Descriptions |
Authentications Required |
| POST |
/server/contest/activity/record/${number}/ |
开始答题 |
YES |
Request Parameters
| Name |
Description |
Required |
Default |
| number |
活动号 |
YES |
|
Request Data
| Name |
Description |
Required |
Default |
| name |
名字 |
YES |
|
| grade |
年级编号 |
YES |
|
| extra |
其它信息 |
NO |
|
Request
{ "name": "小明", "grade": "1"}
cURL Example
curl -X POST -H 'Authorization: Token db4b5deed80091404ec2a295076221cf1f814b3e' -H 'Content-Type: application/json' --data '{..}' http://127.0.0.1:8000/server/contest/activity/record/hhmr2bhnhvslnhot/
Response
{ "pk":3, "activity":{ "pk":1, "number":"hhmr2bhnhvslnhot", "start_time":"2019-03-05T17:09:00", "end_time":"2019-03-05T17:09:00", "grades":{ "1":"一年级", "2":"二年级", "3":"三年级", "4":"四年级", "5":"五年级", "6":"六年级" } }, "userinfo":{ "name":"小橙子_6fhsdr", "avatar":"https://static1.bcjiaoyu.com/head1@3x.png", "user":"18516271364", "nickname":null }, "scores":0, "name":"小明", "grade":"1", "grade_display":"一年级", "certificate_url":null, "current_time":"2019-03-07 12:45:15.740132", "create_time":"2019-03-05T19:43:58.582293", "had_finished": false, "extra":null}
提交答题结果
Method and URL Structure
| Method |
Method Resource URL |
Descriptions |
Authentications Required |
| PATCH |
/server/contest/activity/record/${number}/ |
提交答题结果 |
YES |
Request Parameters
| Name |
Description |
Required |
Default |
| number |
活动号 |
YES |
|
Request Data
| Name |
Description |
Required |
Default |
| scores |
得分 |
YES |
|
| extra |
其它信息 |
NO |
|
Request
{ "scores": "90"}
cURL Example
curl -X PATCH -H 'Authorization: Token db4b5deed80091404ec2a295076221cf1f814b3e' -H 'Content-Type: application/json' --data '{..}' http://127.0.0.1:8000/server/contest/activity/record/hhmr2bhnhvslnhot/
Response
{ "pk":3, "activity":{ "pk":1, "number":"hhmr2bhnhvslnhot", "start_time":"2019-03-05T17:09:00", "end_time":"2019-03-05T17:09:00", "grades":{ "1":"一年级", "2":"二年级", "3":"三年级", "4":"四年级", "5":"五年级", "6":"六年级" } }, "userinfo":{ "name":"小橙子_6fhsdr", "avatar":"https://static1.bcjiaoyu.com/head1@3x.png", "user":"18516271364", "nickname":null }, "scores":90, "name":"小明", "grade":"1", "grade_display":"一年级", "certificate_url":"https://www.example.com/certificate.png", "has_certificate": true, "current_time":"2019-03-07 12:45:15.740132", "create_time":"2019-03-05T19:43:58.582293", "had_finished": true, "extra":null}
Response Data Description
| Name |
Description |
| activity |
活动信息 |
| userinfo |
用户信息 |
| scores |
得分 |
| name |
名字 |
| grade |
年级编号 |
| grade_display |
年级 |
| certificate_url |
证书链接 |
| has_certificate |
是否获得证书 |
获取答题结果
Method and URL Structure
| Method |
Method Resource URL |
Descriptions |
Authentications Required |
| GET |
/server/contest/activity/record/${number}/ |
获取答题结果 |
YES |
Request Parameters
| Name |
Description |
Required |
Default |
| number |
活动号 |
YES |
|
cURL Example
curl -X GET -H 'Authorization: Token db4b5deed80091404ec2a295076221cf1f814b3e' http://127.0.0.1:8000/server/contest/activity/record/hhmr2bhnhvslnhot/
Response
{ "pk":3, "activity":{ "pk":1, "number":"hhmr2bhnhvslnhot", "start_time":"2019-03-05T17:09:00", "end_time":"2019-03-05T17:09:00", "grades":{ "1":"一年级", "2":"二年级", "3":"三年级", "4":"四年级", "5":"五年级", "6":"六年级" } }, "userinfo":{ "name":"小橙子_6fhsdr", "avatar":"https://static1.bcjiaoyu.com/head1@3x.png", "user":"18516271364", "nickname":null }, "scores":90, "name":"小明", "grade":"1", "grade_display":"一年级", "certificate_url":"https://www.example.com/certificate.png", "has_certificate": true, "current_time":"2019-03-07 12:45:15.740132", "create_time":"2019-03-05T19:43:58.582293", "had_finished": true, "extra":null}
报名参加
Method and URL Structure
| Method |
Method Resource URL |
Descriptions |
Authentications Required |
| POST |
/server/contest/show-activity/record/${number}/ |
报名参加 |
YES |
Request Parameters
| Name |
Description |
Required |
Default |
| number |
活动号 |
YES |
|
Request Data
| Name |
Description |
Required |
Default |
| name |
名字 |
YES |
|
| grade |
年级编号 |
YES |
|
| school |
学校 |
YES |
|
Request
{ "name": "小明", "grade": "1", "school": "大河小学"}
cURL Example
curl -X POST -H 'Authorization: Token db4b5deed80091404ec2a295076221cf1f814b3e' -H 'Content-Type: application/json' --data '{..}' http://127.0.0.1:8000/server/contest/show-activity/record/hhmr2bhnhvslnhot/
Response
{ "pk":3, "activity":{ "pk":1, "number":"hhmr2bhnhvslnhot", "start_time":"2019-03-05T17:09:00", "end_time":"2019-03-05T17:09:00", "grades":{ "1":"一年级", "2":"二年级", "3":"三年级", "4":"四年级", "5":"五年级", "6":"六年级", "7":"初一", "8":"初二", "9":"初三", "10":"高一", "11":"高二", "12":"高三", } }, "userinfo":{ "name":"小橙子_6fhsdr", "avatar":"https://static1.bcjiaoyu.com/head1@3x.png", "user":"18516271364", "nickname":null }, "name":"小明", "grade":"1", "grade_display":"一年级", "create_time":"2019-03-05T19:43:58.582293", "school":"大河小学"}
生成海报
Method and URL Structure
| Method |
Method Resource URL |
Descriptions |
Authentications Required |
| GET |
/server/contest/poster/ |
生成海报 |
YES |
Request Parameters
| Name |
Description |
Required |
Default |
| name |
姓名 |
YES |
math |
cURL Example
curl http://127.0.0.1:8000/server/contest/poster/?name=张小丽
Response
{ "url":"https://static1.bcjiaoyu.com/7198960580064725845.png"}