paper.py 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import datetime
  4. from sqlalchemy import Column, Integer, String, DateTime, Float, BOOLEAN
  5. from db.base import Base
  6. class WorkPaper(Base):
  7. """作业标准卷
  8. """
  9. __tablename__ = "work_paper"
  10. id = Column(Integer, primary_key=True, autoincrement=True)
  11. category_id = Column(Integer, nullable=False, comment="资源分类ID")
  12. name = Column(String(255), nullable=False, comment="试卷名称")
  13. pno = Column(String(32), nullable=False, comment="试卷编号")
  14. pages = Column(Integer, default=0, comment="试卷页数")
  15. imgs = Column(String(2000), default="", comment="试卷图片")
  16. uploaded = Column(BOOLEAN(), default=False, comment="试卷图片是否上传")
  17. points = Column(String(1000), default="", comment="标准定位点")
  18. attach_url = Column(String(1000), default="", comment="电子附件URL")
  19. attached = Column(BOOLEAN(), default=False, comment="电子附件是否上传")
  20. cut = Column(Integer, default=False, comment="切割状态")
  21. score = Column(Integer, default=100, comment="满分")
  22. question_amount = Column(Integer, default=0, comment="试题数量")
  23. creator_id = Column(Integer, comment="创建人ID")
  24. creator_name = Column(String(32), comment="创建人名称")
  25. created_at = Column(DateTime, default=datetime.datetime.now)
  26. editor_id = Column(Integer, comment="最后编辑人ID")
  27. editor_name = Column(String(32), comment="最后编辑人名称")
  28. updated_at = Column(DateTime,
  29. default=datetime.datetime.now,
  30. onupdate=datetime.datetime.now)
  31. class WorkPaperQuestion(Base):
  32. """作业标准卷试题
  33. """
  34. __tablename__ = "work_paper_questions"
  35. id = Column(Integer, primary_key=True, autoincrement=True)
  36. pid = Column(Integer, nullable=False, comment="试卷ID")
  37. pno = Column(String(32), comment="试卷编号")
  38. qno = Column(String(32), comment="题号")
  39. sqno = Column(String(32), comment="子题号")
  40. qtype = Column(Integer, nullable=True, comment="题型")
  41. points = Column(String(1000), default="", comment="试题标准坐标点")
  42. imgs = Column(String(1000), default="", comment="试题图片URL")
  43. stuff_points = Column(String(1000), default="", comment="材料标准坐标点")
  44. stuff_imgs = Column(String(1000), default="", comment="材料图片URL")
  45. answer = Column(String(200), default="", comment="标准答案")
  46. analysis = Column(String(1000), default="", comment="答案解析")
  47. score = Column(Float, default=0, comment="试题分数")
  48. stem = Column(String(1000), default="", comment="试题题干")
  49. creator_id = Column(Integer, comment="创建人ID")
  50. creator_name = Column(String(32), comment="创建人名称")
  51. created_at = Column(DateTime, default=datetime.datetime.now)
  52. editor_id = Column(Integer, comment="最后编辑人ID")
  53. editor_name = Column(String(32), comment="最后编辑人名称")
  54. updated_at = Column(DateTime,
  55. default=datetime.datetime.now,
  56. onupdate=datetime.datetime.now)