1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- from typing import List, Optional
- from pydantic import Field
- from pydantic.main import BaseModel
- from schemas.base import ListMixin, Datetime2Str, DetailMixin
- class QuestionInfo(BaseModel):
- id: Optional[int] = None
- pid: Optional[int] = None
- pno: str = Field(..., description="试卷编号")
- qno: str = Field(..., description="题号")
- sqno: str = Field(..., description="子题号")
- qtype: Optional[int] = None
- points: str = Field(..., description="试题标准点坐标")
- imgs: Optional[str] = None
- stuff_points: Optional[str] = None
- stuff_imgs: Optional[str] = None
- answer: Optional[str] = None
- analysis: Optional[str] = None
- score: Optional[float] = None
- stem: Optional[str] = None
- creator_name: Optional[str] = None
- created_at: Datetime2Str = None
- class Config:
- orm_mode = True
- anystr_strip_whitespace = True
- class QuestionList(ListMixin):
- data: List[QuestionInfo] = []
- class QuestionDetail(DetailMixin):
- data: Optional[QuestionInfo] = {}
- class Point(BaseModel):
- x: Optional[float] = None
- y: Optional[float] = None
- w: Optional[float] = None
- h: Optional[float] = None
- class QuestionPieceInfo(BaseModel):
- id: Optional[int] = None
- page: Optional[int] = None
- qno: str = Field(..., description="题号")
- sqno: str = Field(..., description="子题号")
- imgtype: Optional[int] = None
- points: List[Point] = None
- imgs: List[str] = []
- class SaveQuePieceInfo(BaseModel):
- id: Optional[int] = None
- pid: Optional[int] = None
- pno: Optional[str] = None
- ques: List[QuestionPieceInfo] = None
|