__init__.py 3.5 KB

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