__init__.py 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. from fastapi import APIRouter
  4. from app.api.endpoints.review.task import (get_mark_tasks, get_mark_task, get_task_questions,
  5. mark_question, get_student_tasks, get_student_answers,
  6. get_student_task, download_student_task,
  7. task_mark_process, get_task_answers,
  8. mark_process_by_student)
  9. from schemas.app.task import (MarkTaskList, MarkTaskDetail, MarkQuestionDetail,
  10. MarkTaskQuestionList, StudentMarkTaskList, StudentMarkTaskDetail,
  11. StudentAnswerList, MarkProcessList, MarkTaskAnswerList,
  12. StudentMarkProcessList)
  13. router = APIRouter(tags=["作业/考试中心-教师学生端"])
  14. router.add_api_route("/tasks",
  15. get_mark_tasks,
  16. methods=["get"],
  17. response_model=MarkTaskList,
  18. response_model_exclude_none=True,
  19. summary="阅卷任务列表")
  20. router.add_api_route("/tasks/{tid}",
  21. get_mark_task,
  22. methods=["get"],
  23. response_model=MarkTaskDetail,
  24. response_model_exclude_none=True,
  25. summary="阅卷任务详情")
  26. router.add_api_route("/tasks/{tid}/answers",
  27. get_task_answers,
  28. methods=["get"],
  29. response_model=MarkTaskAnswerList,
  30. response_model_exclude_none=True,
  31. summary="作业/考试中心 - 答题分析")
  32. router.add_api_route("/tasks/{tid}/process",
  33. task_mark_process,
  34. methods=["get"],
  35. response_model=MarkProcessList,
  36. response_model_exclude_none=True,
  37. summary="试题批阅进度-按试题")
  38. router.add_api_route("/tasks/{tid}/stu-process",
  39. mark_process_by_student,
  40. methods=["get"],
  41. response_model=StudentMarkProcessList,
  42. response_model_exclude_none=True,
  43. summary="试题批阅进度-按学生")
  44. router.add_api_route("/tasks/{tid}/questions",
  45. get_task_questions,
  46. methods=["get"],
  47. response_model=MarkTaskQuestionList,
  48. response_model_exclude_none=True,
  49. summary="批阅试题列表")
  50. router.add_api_route("/tasks/{tid}/questions/{qid}",
  51. mark_question,
  52. methods=["put"],
  53. response_model=MarkQuestionDetail,
  54. response_model_exclude_none=True,
  55. summary="批阅试题")
  56. router.add_api_route("/stutasks",
  57. get_student_tasks,
  58. methods=["get"],
  59. response_model=StudentMarkTaskList,
  60. response_model_exclude_none=True,
  61. summary="作业/考试中心 - 学生阅卷任务列表")
  62. router.add_api_route("/stutasks/download",
  63. download_student_task,
  64. methods=["get"],
  65. summary="作业/考试中心 - 学生阅卷任务列表导出")
  66. router.add_api_route("/stutasks/{tid}",
  67. get_student_task,
  68. methods=["get"],
  69. response_model=StudentMarkTaskDetail,
  70. response_model_exclude_none=True,
  71. response_model_exclude_unset=True,
  72. summary="作业/考试中心 - 学生阅卷任务详情")
  73. router.add_api_route("/stutasks/{tid}/answers",
  74. get_student_answers,
  75. methods=["get"],
  76. response_model=StudentAnswerList,
  77. response_model_exclude_none=True,
  78. summary="作业/考试中心 - 学生答题详情分析")
  79. __all__ = [router]