Exemple #1
0
class Child(db.Model):
    id = db.Column(db.Integer, db.ForeignKey('user.id'), primary_key=True)
    parent_id = db.Column(db.Integer,
                          db.ForeignKey('parent.id'),
                          nullable=False)
    grade = db.Column(db.String(2), nullable=False)
    game_characters = db.relationship('Game_Character_Save',
                                      backref='child',
                                      lazy=True)

    def __repr__(self):
        user = User.query.filter_by(id=self.id).first()
        return f"Child('{self.id}', '{user.first_name}')"
Exemple #2
0
class PlayTime(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    child_id = db.Column(db.Integer, db.ForeignKey('child.id'), nullable=False)
    date = db.Column(db.DateTime, nullable=False, default=datetime.utcnow)
    start = db.Column(db.DateTime, nullable=False, default=datetime.utcnow)
    duration = db.Column(db.Integer, nullable=False, default=0)
    end = db.Column(db.DateTime, nullable=True)
Exemple #3
0
class DailyProgress(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    child_id = db.Column(db.Integer, db.ForeignKey('child.id'), nullable=False)
    date = db.Column(db.Date, nullable=False, default=datetime.utcnow)
    subject = db.Column(db.String(3), nullable=False)
    operation = db.Column(db.String(), nullable=False)
    total_attempted = db.Column(db.Integer, nullable=False)
    ans_correct = db.Column(db.Integer, nullable=False)
    avg_duration = db.Column(db.Integer, nullable=False)
Exemple #4
0
class MonthlyProgress(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    child_id = db.Column(db.Integer, db.ForeignKey('child.id'), nullable=False)
    year = db.Column(db.Integer, nullable=False)
    month = db.Column(db.Integer, nullable=False)
    subject = db.Column(db.String(3), nullable=False)
    operation = db.Column(db.String(), nullable=False)
    total_attempted = db.Column(db.Integer, nullable=False)
    ans_correct = db.Column(db.Integer, nullable=False)
    avg_duration = db.Column(db.Integer, nullable=False)
Exemple #5
0
class Parent(db.Model):
    id = db.Column(db.Integer, db.ForeignKey('user.id'), primary_key=True)
    email = db.Column(db.String(120), unique=True, nullable=True)
    last_name = db.Column(db.String(20), nullable=True)
    phone = db.Column(db.Integer, nullable=False)
    address = db.Column(db.Text, nullable=False)
    children = db.relationship('Child', backref='parent', lazy=True)

    def __repr__(self):
        user = User.query.filter_by(id=self.id).first()
        return f"Parent('{self.id}', '{user.first_name}')"
Exemple #6
0
class Progress(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    child_id = db.Column(db.Integer, db.ForeignKey('child.id'), nullable=False)
    date = db.Column(db.DateTime, nullable=False, default=datetime.utcnow)
    subject = db.Column(db.String(3), nullable=False)
    result = db.Column(db.Boolean, nullable=False)
    operation = db.Column(db.String(), nullable=False)
    question = db.Column(db.String(), nullable=False)
    correct_ans = db.Column(db.String(), nullable=False)
    ans_chosen = db.Column(db.String(), nullable=False)
    duration = db.Column(db.Integer, nullable=False)
Exemple #7
0
class Game_Character_Save(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    child_id = db.Column(db.Integer, db.ForeignKey('child.id'), nullable=False)
    game_character = db.Column(db.Text, nullable=False)
    save_date = db.Column(db.DateTime, nullable=False)
Exemple #8
0
class Enroll(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    child_id = db.Column(db.Integer, db.ForeignKey('child.id'), nullable=False)
    subject = db.Column(db.String(3), nullable=False)
    valid_until = db.Column(db.Date, nullable=False)