信息统计和教师端考试部分API——张星
考试中心API
获取考试详情 POST
Request
{
“course”:id //课程id
}
Response
{
“id”: 1,//考试id
“id_course”: 1,
“name”:“2019-2020年第2学期 算法导论考试”,
“start_time”:”2019-4-1 14:00:00”
“end_time”:”2019-4-1 15:00:00”
“description”:”请同学们不要作弊,祝考试顺利”
“created_at”:“2019-3-31 14:00:00”
“modified_at”:”2019-4-1 9:00:00”,
exam_problem:[
{
“id_problem”:1,
“name”:”滔滔摘苹果”
“type”:”A”,
“weight”:0.3,
“case_number”:10
}
]
}
获取参与学生名单 POST
Request
{
“exam_id”:1
}
Response
[
{
“id”: 1,
“student_number”:”1612945,
“name”:”同学A”,
“type”:”A”,//考卷类型
“password”:”123456”
}
]
获取全部学生名单 GET
Response
[
{
“id”:1,
“student_number”:”1612945,
“name”:”同学A”
}
]
添加参与学生 POST
Request
{
“student_id”:1,
“exam_id”:1
}
Response
[
“result”:“OK” // OK:添加成功,EXISTED:已存在,添加失败
]
删除参与学生 POST
Request
{
“student_id”:1,
“exam_id”:1
}
Response
[
“result”:“OK” // OK:删除成功,NOTEXISTED:该学生不存在,删除失败
]
添加A卷或B卷题目 POST
Request
{
“exam_id”:1,
“problem_id”:1,
“type”:”A”
}
Response
[
“result”:“OK” // OK:添加成功,EXISTED:该题目已添加到该考试A卷中,添加失败,ERROR:该题目不存在,添加失败
]
删除A卷或B卷题目 POST
Request
{
“exam_Id”:1,
“problem_id”:1,
“type”:”A”
}
Response
[
“result”:“OK” // OK:删除成功,NOTEXISTED:该题目未添加到该考试A卷中,删除失败,ERROR:不存在该题目,删除失败
]
统计信息API
获取选课各年级人数 POST
Resquest
{
“id”:1,//课程id
}
Response
[
{
“grade”:”2016”,
“student_total”:118
},
{
“grade”:”2017”,
“student_total”:10
}
]
获取每个课程选课人数 GET
Response
[
{
“id”:1,//课程id
“name”:”C++程序设计”,
“student_total”:120
}
{
“id”:2,//课程id
“name”:”数据结构”,
“student_total”:110
}
]
获取总体AC提交次数 GET
Response
{
“ac_rate”: 33%
}
获取每个课程的题目总数 GET
Response
[
{
“id”:1,//课程id
“name”:”C++程序设计”,
“problem_total”:12
},
{
“id”:2,//课程id
“name”:”数据结构”,
“problem_total”:11
}
]
获取所有教师信息 GET
Response
[
{
“id”:1,//教师id
“name”:”王林”
“description”:”这是一段描述“,
“student_total”:357,
“state”:”online”//online:上线,offline下线
}
]
获取某教师详细信息 POST
Request
{
“teacher_id”:1
}
Response
{
“id”:1,
“teacher_number”:123456//教师工号
“name”:”徐丽丽”,
“email”: “xll@mail.nankai.edu.cn”
“id_gender”:1
}
获取所有课程列表 GET
Response
[
{
“id”:1,//课程id
“name”:”Python课程设计”
“description“:”这是一段该课程的描述“,
“teacher_name”: “王小林”
}
]
获取提交次数统计 POST
Request
{
“course_id”:1,
“start_date”: “2018-08-08”,
“end_date”: “2018-08-18”,
“step”: 2
}
Response
[
{
“date”: “2018-08-08”,
“submission_total”: 100,
“ac_total”:50,
},
{
“date”: “2018-08-10”,
“submission_total”: 100,
“ac_total”:50,
}
]
获取AC题目标签词云 POST
Request
{
“problem”:
[
1,2,3//参与统计分析的题目id
],
“label_total”:10//获取标签个数
}
Response
{
“label”:[
{
“tag_id”:1,
“tag_name”:”贪心问题”
},
{
“tag_id”:2,
“tag_name”:”图论”
}
]
}
获取非AC题目标签词云 POST
Request
{
“problem”:
[
1,2,3//参与统计分析的题目id
],
“label_total”:10//获取标签个数
}
Response
{
“label”:[
{
“tag_id”:1,
“tag_name”:”贪心问题”
},
{
“tag_id”:2,
“tag_name”:”图论”
}
]
}
获取通过测试用例标签词云 POST
Request
{
“problem”:
[
1,2,3//参与统计分析的题目id
],
“label_total”:10//获取标签个数
}
Response
{
“label”:[
{
“tag_id”:1,
“tag_name”:”边界条件”
},
{
“tag_id”:2,
“tag_name”:”输入非整数”
}
]
}
获取未通过测例标签词云 POST
Request
{
“problem”:
[
1,2,3//参与统计分析的题目id
],
“label_total”:10//获取标签个数
}
Response
{
“label”:[
{
“tag_id”:1,
“tag_name”:”空指针”
},
{
“tag_id”:2,
“tag_name”:”类型不匹配”
}
]
}
获取题目执行用时 POST
Request
{
“problem_id”:1
}
Response
{
“execution_time”:[
{
“time”:50//单位ms
“number”:100
},
{
“time”:30//单位ms
“number”:115
}
]
}
获取选定学生的AC率 POST
Request
{
“student_id“:
[
1612945, 1612946
]
“course_id”:[
1, 2, 3
]
}
Response
{
“ac_rate”:35%
}
获取选定学生的作业AC率 POST
Request
{
“student_id“:
[
1612945, 1612946
]
“course_id”:[
1, 2, 3
]
}
Response
{
“ac_rate”:85%
}
获取选定课程学生按宿舍划分的AC率统计结果 POST
Request
{
“course_id“:1
}
Response
{
“list”:[
{
“room”:”349
“ac_rate”:88%,
},
{
“room”:”348
“ac_rate”:98%,
}
]
}
获取选定课程学生按省份划分的AC率统计结果 POST
Request
{
“course_id“:1
}
Response
{
“list”:[
{
“province”:”广东”
“ac_rate”:88%,
},
{
“province”:”北京“
“ac_rate”:98%,
}
]
}
获取选定课程学生按班级划分的AC率统计结果 POST
Request
{
“course_id“:1
}
Response
{
“list”:[
{
“class”:1,
“ac_rate”:88%,
},
{
“class”:2,
“ac_rate”:98%,
}
]
}
获取课程选定题目下男女生的AC人数统计结果 POST
Request
{
“course_id“:1,
“problem”:
[
1, 2, 3
]
}
Response
{
“ac_num”:
[
{
“gender”: “男”,
“ac”: 50
},
{
“gender”: “女”,
“ac”: 50
}
]
}