123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- from fastapi import APIRouter
- from schemas.base import DetailMixin
- from schemas.paper import (PaperList, PaperDetail, QuestionDetail, MarkTaskList,
- MarkTaskDetail)
- from ._paper import (get_papers, get_papers_info, create_paper, import_paper,
- update_paper, delete_paper)
- from .marktask import create_mark_task, update_mark_task, get_mark_task, get_mark_tasks, delete_mark_task
- from .question import (create_question, update_question, get_question,
- get_question_list, delete_question, save_pieces)
- router = APIRouter(tags=["试卷管理"])
- router.add_api_route("/papers",
- get_papers,
- methods=["get"],
- response_model=PaperList,
- response_model_exclude_none=True,
- summary="试卷列表")
- router.add_api_route("/papers/{pid}",
- get_papers_info,
- methods=["get"],
- response_model=PaperDetail,
- response_model_exclude_none=True,
- summary="试卷详情")
- router.add_api_route("/papers",
- create_paper,
- methods=["post"],
- response_model=PaperDetail,
- response_model_exclude_none=True,
- summary="创建试卷")
- router.add_api_route("/papers/{pid}",
- update_paper,
- methods=["put"],
- response_model=PaperDetail,
- response_model_exclude_none=True,
- summary="更新试卷")
- router.add_api_route("/papers/{pid}",
- delete_paper,
- methods=["delete"],
- response_model=PaperDetail,
- response_model_exclude_none=True,
- summary="删除试卷")
- router.add_api_route("/papers/bulk",
- import_paper,
- methods=["post"],
- response_model=PaperDetail,
- response_model_exclude_none=True,
- summary="批量导入试卷")
- # 试卷切割
- router.add_api_route("/questions/savepieces",
- save_pieces,
- methods=["post"],
- response_model=DetailMixin,
- response_model_exclude_none=True,
- summary="保存试卷切割")
- router.add_api_route("/questions",
- update_question,
- methods=["put"],
- response_model=QuestionDetail,
- response_model_exclude_none=True,
- summary="修改试卷切割/设置分值")
- router.add_api_route("/questions/{qid}",
- get_question,
- methods=["get"],
- response_model=QuestionDetail,
- response_model_exclude_none=True,
- summary="试卷切割详情")
- router.add_api_route("/questions/{qid}",
- delete_question,
- methods=["delete"],
- response_model=QuestionDetail,
- response_model_exclude_none=True,
- summary="删除试题")
- # 阅卷任务
- router.add_api_route("/marktask",
- create_mark_task,
- methods=["post"],
- response_model=MarkTaskDetail,
- response_model_exclude_none=True,
- summary="新增阅卷任务")
- router.add_api_route("/marktask/{tid}",
- update_mark_task,
- methods=["put"],
- response_model=MarkTaskDetail,
- response_model_exclude_none=True,
- summary="修改阅卷任务")
- router.add_api_route("/marktask/{tid}",
- get_mark_task,
- methods=["get"],
- #response_model=MarkTaskDetail,
- response_model_exclude_none=True,
- summary="阅卷任务详情")
- router.add_api_route("/marktask/{tid}",
- delete_mark_task,
- methods=["delete"],
- response_model=MarkTaskDetail,
- response_model_exclude_none=True,
- summary="删除阅卷任务")
- router.add_api_route("/marktasks",
- get_mark_tasks,
- methods=["get"],
- response_model=MarkTaskList,
- response_model_exclude_none=True,
- summary="阅卷任务列表")
- __all__ = [router]
|