paper.py 808 B

123456789101112131415161718192021222324252627282930
  1. # -*- coding: utf-8 -*-
  2. from typing import List, Dict
  3. from pydantic import BaseModel, Field
  4. from schemas.base import ListMixin
  5. class QuestionItem(BaseModel):
  6. id: int = Field(..., description="试题ID")
  7. qno: str = Field(..., description="题号")
  8. sqno: str = Field(..., description="子题号")
  9. imgs: str = Field(..., description="试题图片URL")
  10. answer: str = Field(..., description="试题答案")
  11. analysis: str = Field(..., description="试题分析")
  12. stuff_imgs: str = Field(..., description="试题材料URL")
  13. class Config:
  14. orm_mode = True
  15. anystr_strip_whitespace = True
  16. class QuestionAnalysisItem(BaseModel):
  17. answer: QuestionItem
  18. dist: List[Dict[str, int]] = []
  19. class QuestionList(ListMixin):
  20. data: List[QuestionAnalysisItem] = []