123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- import datetime
- from sqlalchemy import Column, Integer, String, DateTime, Float, BOOLEAN
- from db.base import Base
- class WorkPaper(Base):
- """作业标准卷
- """
- __tablename__ = "work_paper"
- id = Column(Integer, primary_key=True, autoincrement=True)
- category_id = Column(Integer, nullable=False, comment="资源分类ID")
- name = Column(String(255), nullable=False, comment="试卷名称")
- pno = Column(String(32), nullable=False, comment="试卷编号")
- pages = Column(Integer, default=0, comment="试卷页数")
- imgs = Column(String(2000), default="", comment="试卷图片")
- uploaded = Column(BOOLEAN(), default=False, comment="试卷图片是否上传")
- points = Column(String(1000), default="", comment="标准定位点")
- attach_url = Column(String(1000), default="", comment="电子附件URL")
- attached = Column(BOOLEAN(), default=False, comment="电子附件是否上传")
- cut = Column(Integer, default=False, comment="切割状态")
- score = Column(Integer, default=100, comment="满分")
- question_amount = Column(Integer, default=0, comment="试题数量")
- creator_id = Column(Integer, comment="创建人ID")
- creator_name = Column(String(32), comment="创建人名称")
- created_at = Column(DateTime, default=datetime.datetime.now)
- editor_id = Column(Integer, comment="最后编辑人ID")
- editor_name = Column(String(32), comment="最后编辑人名称")
- updated_at = Column(DateTime,
- default=datetime.datetime.now,
- onupdate=datetime.datetime.now)
- class WorkPaperQuestion(Base):
- """作业标准卷试题
- """
- __tablename__ = "work_paper_questions"
- id = Column(Integer, primary_key=True, autoincrement=True)
- pid = Column(Integer, nullable=False, comment="试卷ID")
- pno = Column(String(32), comment="试卷编号")
- qno = Column(String(32), comment="题号")
- sqno = Column(String(32), comment="子题号")
- qtype = Column(Integer, nullable=True, comment="题型")
- points = Column(String(1000), default="", comment="试题标准坐标点")
- imgs = Column(String(1000), default="", comment="试题图片URL")
- stuff_points = Column(String(1000), default="", comment="材料标准坐标点")
- stuff_imgs = Column(String(1000), default="", comment="材料图片URL")
- answer = Column(String(200), default="", comment="标准答案")
- analysis = Column(String(1000), default="", comment="答案解析")
- score = Column(Float, default=0, comment="试题分数")
- stem = Column(String(1000), default="", comment="试题题干")
- creator_id = Column(Integer, comment="创建人ID")
- creator_name = Column(String(32), comment="创建人名称")
- created_at = Column(DateTime, default=datetime.datetime.now)
- editor_id = Column(Integer, comment="最后编辑人ID")
- editor_name = Column(String(32), comment="最后编辑人名称")
- updated_at = Column(DateTime,
- default=datetime.datetime.now,
- onupdate=datetime.datetime.now)
|