首页 > Windows开发 > 详细

教师端API——左天衡

时间:2019-05-15 15:55:12      阅读:121      评论:0      收藏:0      [点我收藏+]
//获取全部课程
/teacher/course/get-all-courses GET

Request {

"page": 1

}

Response {

"total_pages": 20,

"current_page": 1,

"courses": [

//上次更新:已经弃置,并不再可用

{

"course_id" : 1,

"name" : "数据结构",

"teacher" : "张三",

"start_time" : 2003-05-17,

"end_time" : 2003-08-17,

"description" : "本课程针对大二学生开设,主要介绍...",

},{

"course_id" : 2,

"name" : "Java程序设计",

"teacher" : "李四",

"start_time" : 2003-05-17,

"end_time" : 2003-08-17,

"description" : "本课程针对大一学生开设,主要介绍...",

}]

}

 

//获取我的课程
/teacher/course/get-my-courses GET

Request {

"page": 1

}

Response {

"total_pages": 10,

"current_page": 1,

"courses":[

//上次更新:已经弃置,并不再可用

{

"course_id" : 1,

"name" : "数据结构",

"teacher" : "张三",

"start_time" : 2003-05-17 12:00,

"end_time" : 2003-08-17 12:00,

"description" : "本课程针对大二学生开设,主要介绍...",

},{

"course_id" : 2,

"name" : "算法导论",

"teacher" : "张三",

"start_time" : 2003-05-17 12:00,

"end_time" : 2003-08-17 12:00,

"description" : "本课程针对大二学生开设,主要介绍...",

}]

}

 

//获取我的某个课程的所有课时
/teacher/lecture/get-my-lectures GET

Request {

"page": 1,

"course_id" : 1,

}

Response{

"total_pages": 10,

"current_page": 1,

"lectures":[

{

"lecture_id" : 1,

"name" : "lecture1"

},{

"lecture_id" : 2,

"name" : "lecture2"

}]

}

 

//获取我的某个课程的所有实验
/teacher/lab/get-my-labs GET

Request {

"page": 1,

"course_id" : 1,

}

Response{

"total_pages": 10,

"current_page": 1,

"labs":[

{

"lab_id" : 1,

"name" : "二叉搜索树"

},{

"lab_id" : 2,

"name" : "B树和B+树"

}]

}

 

//获取我的某个课程的所有考试
/teacher/exam/get-my-exams GET

Request {

"page": 1,

"course_id" : 1,

}

Response{

"total_pages": 1,

"current_page": 1,

"exams":[

{

"exam_id" : 1,

"name" : "期中考试",

"start_time" : 2003-08-15 12:00,

"end_time": 2003-08-15 15:00,

"description": "请遵守考试纪律"

},{

"exam_id" : 2,

"name" : "期末考试"

"start_time" : 2003-09-15 12:00,

"end_time": 2003-09-15 15:00,

"description": "请遵守考试纪律"

}]

}

 

//获取我的某个课程的所有学生
/teacher/course/get-my-students GET

Request {

"page": 1,

"course_id" : 1,

}

Response{

"total_pages": 10,

"current_page": 1,

"students":[

{

"student_id" : 1,

"student_number" : "1612000",

"student_name" : "王五"

},{

"student_id" : 2,

"student_number" : "1612000",

"student_name" : "赵六"

}]

}

 

//删除学生
/teacher/course/delete-my-student POST

Request {

"student_id": 1

}

Response{

//在删除成功时返回200,否则返回具体错误code并且更新error_msg

"error_msg" : ""

}

 

//新建课时

/teacher/lecture/create-lecture POST

Request {

"course_id" : 1,

"name" : "二叉树的搜索",

"description" : "主要介绍二叉树的递归和非递归搜索方式。"

}

Response{

//在新建成功时返回200,否则返回具体错误code并且更新error_msg

"error_msg" : ""

 

//如果发生错误则不存在以下内容,因此前端应该先执行检查

//事实上,前端在获取到任何后端数据时都应先检查是否为200

"lecture_id" : 10

}

 

//编辑课时
/teacher/lecture/edit-lecture POST

Request {

"lecture_id" : 1,

"name" : "二叉树的先序遍历搜索",

"description" : "主要介绍二叉树的先序遍历搜索方式。"

}

Response{

//在编辑成功时返回200,否则返回具体错误code并且更新error_msg

"error_msg" : ""

}

 

//获取某个课时的信息

/teacher/lecture/get-lecture GET

Request {

"lecture_id" : 1,

}

Response{

"name" : "二叉树的先序遍历搜索",

"description" : "主要介绍二叉树的先序遍历搜索方式。"

}

 

//获取某个课时的练习题
/teacher/lecture/get-problems GET

Request {

"lecture_id" : 1,

}

Response{

"problems":[

{

"problem_id" : 1,

"problem_name" : "猴子吃桃问题",

},{

"problem_id" : 2,

"problem_name" : "A + B问题",

}]

}

 

//修改某个课时的练习题
//如果原先没有练习题 则可以理解为新建某个课时的练习题
/teacher/lecture/edit-problems POST

Request {

"lecture_id" : 1,

"problem_ids":[

{

"problem_id" : 1

}, {

"problem_id" : 3

}]

}

Response{

//在编辑成功时返回200,否则返回具体错误code并且更新error_msg

"error_msg" : ""

}

 

 

//添加某个课时的课件
/teacher/lecture/add-file POST(FILE)

Request {

"lecture_id" : 1,

"filename" : "二叉树先序遍历课件.pptx",

"file": [文件信息]########[文件信息]

}

Response{

//在添加成功时返回200,否则返回具体错误code并且更新error_msg

"error_msg" : ""

}

 

//删除某个课时的课件
/teacher/lecture/delete-file POST

Request {

"lecture_id" : 1,

"filename" : "二叉树先序遍历课件.pptx"

}

Response{

//在删除成功时返回200,否则返回具体错误code并且更新error_msg

"error_msg" : ""

}

 

//获取某个课时的全部题目的提交统计

/teacher/lecture/get-all-problems-submissions GET

Request {

"page": 1,

"lecture_id" : 1

}

Response {

"total_pages": 10,

"current_page": 1,

"submissions":[

//查重率:已经弃置,并不再可用

{

"problem_id" : 1,

"problem_name" : "猴子吃桃问题",

//可根据业务逻辑调整

"submissions_count" : 100,

"TLEsubmissions_count" : 50,

"WAsubmissions_count": 30,

"ACsubmissions_count": 20

},{

"problem_id" : 1,

"problem_name" : "A + B问题",

//可根据业务逻辑调整

"submissions_count" : 100,

"TLEsubmissions_count" : 0,

"WAsubmissions_count": 10,

"ACsubmissions_count": 90

}]

}

 

//获取某个题目的所有提交
/teacher/problem/get-all-submissions GET

Request {

"page": 1,

"problem_id" : 1

}

Response{

"total_pages": 10,

"current_page": 1,

"submissions":[

//查重率:已经弃置,并不再可用

{

"submission_id" : 1,

"problem_id" : 1,

"student_id" : 1,

"student_number" : "1612000",

"created_time" : 2003-08-17 15:00,

"succeed_cases_count" : 3,

"all_cases_count" : 5,

"language_id": 1,

},{

"submission_id" : 2,

"problem_id" : 1,

"student_id" : 3,

"student_number" : "1612001",

"created_time" : 2003-08-17 16:20,

"succeed_cases_count" : 5,

"all_cases_count" : 5

"language_id": 2,

}]

}

 

//新建实验
/teacher/lab/create-lab POST

Request {

"course_id" : 1,

"name" : "二叉树的搜索",

"description" : "实验练习二叉树的搜索。",

"start_time" : 2007-06-15,

"end_time" : 2007-06-26,

"report_required" : false

}

Response{

//在新建成功时返回200,否则返回具体错误code并且更新error_msg

"error_msg" : ""

 

//如果发生错误则不存在以下内容,因此前端应该先执行检查

//事实上,前端在获取到任何后端数据时都应先检查是否为200

"lab_id" : 10

}

 

//编辑实验
/teacher/lab/edit-lab POST

Request {

"lab_id" : 1,

"name" : "二叉树的先序遍历搜索",

"description" : "实验练习二叉树的先序遍历搜索。",

"start_time" : 2007-06-25,

"end_time" : 2007-06-30,

"report_required" : true

}

Response{

//在编辑成功时返回200,否则返回具体错误code并且更新error_msg

"error_msg" : ""

}

 

//获取某个实验的信息
/teacher/lab/get-lab GET

Request {

"lab_id" : 1,

}

Response{

"name" : "二叉树的先序遍历搜索",

"description" : "主要介绍二叉树的先序遍历搜索方式。"

"start_time" : 2007-06-25,

"end_time" : 2007-06-30,

"report_required" : true

}

 

//获取某个实验的作业题
/teacher/lab/get-problems GET

Request {

"lab_id" : 1,

}

Response{

"problems":[

{

"problem_id" : 1,

"problem_name" : "猴子吃桃问题",

},{

"problem_id" : 2,

"problem_name" : "A + B问题",

}]

}

 

//修改某个实验的练习题
//如果原先没有练习题 则可以理解为新建某个实验的练习题
/teacher/lab/edit-problems POST

Request {

"lab_id" : 1,

"problem_ids":[

{

"problem_id" : 1

}, {

"problem_id" : 3

}]

}

Response{

//在编辑成功时返回200,否则返回具体错误code并且更新error_msg

"error_msg" : ""

}

 

 

//添加某个实验的课件
/teacher/lab/add-file POST(FILE)

Request {

"lab_id" : 1,

"filename" : "二叉树先序遍历实验要求.pptx",

"file": [文件信息]########[文件信息]

}

Response{

//在添加成功时返回200,否则返回具体错误code并且更新error_msg

"error_msg" : ""

}

 

//删除某个实验的课件
/teacher/lab/delete-file POST

Request {

"lab_id" : 1,

"filename" : "二叉树先序遍历实验要求.pptx"

}

Response{

//在删除成功时返回200,否则返回具体错误code并且更新error_msg

"error_msg" : ""

}

 

//获取某次实验的全部提交
/teacher/lab/get-all-submissions GET

Request {

"page": 1,

"lab_id" : 1

}

Response{

"total_pages": 10,

"current_page": 1,

"submissions" : [

{

"submission_id" : 101,

"student_id" : 1,

"attachment_grade" : 90,

"problem_grade" : 100

}, {

"submission_id" : 102,

"student_id" : 2,

"attachment_grade" : 60,

"problem_grade" : 60

}]

}

 

//获取某次实验提交的具体信息
/teacher/lab/get-submission GET

Request {

"submission_id" : 101

}

Response{

"student_id": 1,

"student_number" : 1612000,

"student_name": "赵六",

"problem_submission_id": 1001,

"attachments" : [

{

"attachment_id" : 10,

"attachment_name" : "实验报告1612000.pdf",

}, {

"attachment_id" : 20,

"attachment_name" : "实验报告2.pdf",

}]

}

 

//下载某个实验的某个课件
/teacher/lab/get-submission-file GET

Request {

"attachment_id" : 10

}

Response{

"file": [文件信息]########[文件信息]

}

 

//获取某个题目的一次提交的详细信息
/teacher/submission/get-submission GET

Request {

"submission_id" : 1001

}

Response{

"id_problem" : 1,

"id_student" : 1,

"code" : "import java.util.*; \n public class Main{ \n public static void main(String []args...",

"created_at" 2007-08-16,

"runtime" : 993ms,

"language_id" : 1,

"memory" : 1036,

"IP" : "10.0.0.91",

"succeed_cases_count" : 5,

"all_cases_count" : 5

}

 

//获取题库中的所有题目
/teacher/problem/get-all-problems GET

Request {

"page": 1,

}

Response{

"total_pages": 10,

"current_page": 1,

"problems": [

{

"problem_id" : 1,

"problem_name" : "猴子吃桃问题",

"created_teacher_id" : 1,

"created_time" : 2007-06-13 14:00,

"submit_count" : 80,

"accepted_count" : 10

}, {

"problem_id" : 2,

"problem_name" : "A + B问题",

"created_teacher_id" : 1,

"created_time" : 2007-06-13 13:00,

"submit_count" : 100,

"accepted_count" : 90

}]

}

 

//获取一个题目的详细信息
/teacher/problem/get-problem GET

Request {

"problem_id": 1,

}

Response{

"problem_name" : "猴子吃桃问题",

"description": "有m个猴子,n个桃子,请设计一种算法,使得..."

"created_teacher_id" : 1,

"created_time" : 2007-06-13 14:00,

"modified_time" : 2007-06-13 15:00,

"runtime_limit" : 1024,

"memory_limit" : 1024,

"tags":[{

"tag_id" : 1,

"tag_name" : "贪心"

}, {

"tag_id" : 2,

"tag_name" : "动态规划"

}]

"cases":[{

"case_id" : 1001,

"input" : "2, 3, 4",

"output" : "5"

"tags":[{

"tag_id" : 1,

"tag_name" : "数组越界检查"

}, {

"tag_id" : 2,

"tag_name" : "除零错检查"

}]

}, {

"case_id" : 1002,

"input" : "2, 3, 0",

"output" : "0"

"tags":[{

"tag_id" : 2,

"tag_name" : "除零错检查"

}, {

"tag_id" : 3,

"tag_name" : "栈溢出检查"

}]

]

}

 

//新建一道题目
/teacher/problem/create-problem POST

Request {

"problem_name" : "猴子吃桃问题",

"description": "有m个猴子,n个桃子,请设计一种算法,使得..."

"created_teacher_id" : 1,

"runtime_limit" : 1024,

"memory_limit" : 1024,

"tags":[{

"tag_id" : 1,

"tag_name" : "贪心"

}, {

"tag_id" : 2,

"tag_name" : "动态规划"

}]

"cases":[{

"case_id" : 1001,

"input" : "2, 3, 4",

"output" : "5"

"tags":[{

"tag_id" : 1,

"tag_name" : "数组越界检查"

}, {

"tag_id" : 2,

"tag_name" : "除零错检查"

}]

}, {

"case_id" : 1002,

"input" : "2, 3, 0",

"output" : "0"

"tags":[{

"tag_id" : 2,

"tag_name" : "除零错检查"

}, {

"tag_id" : 3,

"tag_name" : "栈溢出检查"

}]

]

}

Response{

//在新建成功时返回200,否则返回具体错误code并且更新error_msg

"error_msg" : ""

 

//如果发生错误则不存在以下内容,因此前端应该先执行检查

//事实上,前端在获取到任何后端数据时都应先检查是否为200

"problem_id" : 3

}

 

//编辑一道题目
/teacher/problem/edit-problem POST

Request {

"problem_id" : 3,

"problem_name" : "猴子吃桃问题",

"description": "有m个猴子,n个桃子,请设计一种算法,使得..."

"created_teacher_id" : 1,

"runtime_limit" : 1024,

"memory_limit" : 1024,

"tags":[{

"tag_id" : 1,

"tag_name" : "贪心"

}, {

"tag_id" : 2,

"tag_name" : "动态规划"

}]

"cases":[{

"case_id" : 1001,

"input" : "2, 3, 4",

"output" : "5"

"tags":[{

"tag_id" : 1,

"tag_name" : "数组越界检查"

}, {

"tag_id" : 2,

"tag_name" : "除零错检查"

}]

}, {

"case_id" : 1002,

"input" : "2, 3, 0",

"output" : "0"

"tags":[{

"tag_id" : 2,

"tag_name" : "除零错检查"

}, {

"tag_id" : 3,

"tag_name" : "栈溢出检查"

}]

]

}

Response{

//在编辑成功时返回200,否则返回具体错误code并且更新error_msg

"error_msg" : ""

}

 

//查看一定时间段的所有题目提交
/teacher/submission/get-all-submissions POST

Request {

"page": 1,

//为空表示最早时间

"begin_time":2007-06-17 15:00,

//为空表示最晚时间

"end_time":2007-06-17 15:00

}

Response{

"total_pages": 10,

"current_page": 1,

"submissions": [

{

"submission_id" : 1,

"problem_id" : 1,

"student_id" : 1,

"student_number" : "1612000",

"created_time" : 2003-08-17 15:00,

"succeed_cases_count" : 3,

"all_cases_count" : 5,

"language_id": 1

}, {

"submission_id" : 2,

"problem_id" : 1,

"student_id" : 1,

"student_number" : "1612000",

"created_time" : 2003-08-17 16:00,

"succeed_cases_count" : 5,

"all_cases_count" : 5,

"language_id": 1

}]

}

 

//获取自己的个人信息
/teacher/information/get-information GET

Request {

}

Response {

"teacher_id" : 1,

"name" : "张三",

"email" : "zhangsan@gmail.com",

"gender_id" : 0,

}

 

//修改自己的个人信息

/teacher/information/edit-information POST

Request {

"teacher_id" : 1,

"password" : "*******",

"name" : "张三",

"email" : "zhangsan@gmail.com",

"gender_id" : 0,

}

Response {

//在编辑成功时返回200,否则返回具体错误code并且更新error_msg

"error_msg" : ""

}

教师端API——左天衡

原文:https://www.cnblogs.com/cs-sunday/p/10869122.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!