class UserStoryAttempt(db.Model):
    id = db.Column(db.Integer(), primary_key=True, autoincrement=True)
    user_id = db.Column(db.Integer(), db.ForeignKey('user.id'))
    short_story_id = db.Column(db.Integer(), db.ForeignKey('short_story.id'))
    short_story_translation_id = db.Column(db.Integer(), db.ForeignKey('short_story_translation.id'))
    language = db.Column(db.String(10))
    score = db.Column(db.Float())
    responses = db.Column(db.JSON())
    is_complete = db.Column(db.Boolean())
    created_at = db.Column(db.DateTime(timezone=True), server_default=func.now())
    updated_at = db.Column(db.DateTime(timezone=True), onupdate=func.now())
    deleted_at = db.Column(db.DateTime())
Esempio n. 2
0
class MultipleChoiceQuestionTranslation(db.Model):
    id = db.Column(db.Integer(), primary_key=True, autoincrement=True)
    short_story_id = db.Column(db.Integer(), db.ForeignKey('short_story.id'))
    multiple_choice_question_id = db.Column(db.Integer(), db.ForeignKey('multiple_choice_question.id'))
    language = db.Column(db.String(10))
    question = db.Column(db.Text())
    sequence = db.Column(db.Integer())
    created_at = db.Column(db.DateTime(timezone=True), server_default=func.now())
    updated_at = db.Column(db.DateTime(timezone=True), onupdate=func.now())
    deleted_at = db.Column(db.DateTime())

    multiple_choice_answer_translations = relationship('MultipleChoiceAnswerTranslation')
class ShortStoryTranslation(db.Model):
    id = db.Column(db.Integer(), primary_key=True, autoincrement=True)
    short_story_id = db.Column(db.Integer(), db.ForeignKey('short_story.id'))
    language = db.Column(db.String(10))
    title = db.Column(db.String(256))
    sequence = db.Column(db.Integer())
    word_count = db.Column(db.Integer())
    difficulty = db.Column(db.String(20))
    translated_by = db.Column(db.String(256))
    translated_by_user_id = db.Column(db.Integer(), db.ForeignKey('user.id'))
    published_at = db.Column(db.DateTime())
    created_at = db.Column(db.DateTime(timezone=True),
                           server_default=func.now())
    updated_at = db.Column(db.DateTime(timezone=True), onupdate=func.now())
    deleted_at = db.Column(db.DateTime())
class MultipleChoiceAnswerTranslation(db.Model):
    id = db.Column(db.Integer(), primary_key=True, autoincrement=True)
    multiple_choice_question_id = db.Column(
        db.Integer(), db.ForeignKey('multiple_choice_question.id'))
    multiple_choice_question_translation_id = db.Column(
        db.Integer(), db.ForeignKey('multiple_choice_question_translation.id'))
    multiple_choice_answer_id = db.Column(
        db.Integer(), db.ForeignKey('multiple_choice_answer.id'))
    language = db.Column(db.String(10))
    answer = db.Column(db.Text())
    order = db.Column(db.Integer())
    is_correct = db.Column(db.Boolean())
    created_at = db.Column(db.DateTime(timezone=True),
                           server_default=func.now())
    updated_at = db.Column(db.DateTime(timezone=True), onupdate=func.now())
    deleted_at = db.Column(db.DateTime())
Esempio n. 5
0
class UserRole(db.Model):
    id = db.Column(db.Integer(), primary_key=True, autoincrement=True)
    user_id = db.Column(db.Integer(), db.ForeignKey('user.id'))
    role = db.Column(db.String(20))
    created_at = db.Column(db.DateTime(timezone=True), server_default=func.now())
    updated_at = db.Column(db.DateTime(timezone=True), onupdate=func.now())
    deleted_at = db.Column(db.DateTime())
class ShortStoryContent(db.Model):
    id = db.Column(db.Integer(), primary_key=True, autoincrement=True)
    short_story_id = db.Column(db.Integer(), db.ForeignKey('short_story.id'))
    language = db.Column(db.String(10))
    content = db.Column(db.Text())
    created_at = db.Column(db.DateTime(timezone=True),
                           server_default=func.now())
    updated_at = db.Column(db.DateTime(timezone=True), onupdate=func.now())
    deleted_at = db.Column(db.DateTime())
Esempio n. 7
0
class LanguageHistory(db.Model):
    id = db.Column(db.Integer(), primary_key=True, autoincrement=True)
    user_id = db.Column(db.Integer(), db.ForeignKey('user.id'))
    language = db.Column(db.String(10))
    years_of_study = db.Column(db.Integer())
    proficiency_level = db.Column(db.String(30))
    created_at = db.Column(db.DateTime(timezone=True), server_default=func.now())
    updated_at = db.Column(db.DateTime(timezone=True), onupdate=func.now())
    deleted_at = db.Column(db.DateTime())
Esempio n. 8
0
class SchoolLevelTranslation(db.Model):
    id = db.Column(db.Integer(), primary_key=True, autoincrement=True)
    school_level_id = db.Column(db.Integer(), db.ForeignKey('school_level.id'))
    language = db.Column(db.String(10))
    name = db.Column(db.String(100))
    sequence = db.Column(db.Integer())
    created_at = db.Column(db.DateTime(timezone=True),
                           server_default=func.now())
    updated_at = db.Column(db.DateTime(timezone=True), onupdate=func.now())
    deleted_at = db.Column(db.DateTime())
Esempio n. 9
0
class ShortStory(db.Model):
    id = db.Column(db.Integer(), primary_key=True, autoincrement=True)
    school_level_id = db.Column(db.Integer(), db.ForeignKey('school_level.id'))
    # Added a separate ShortStoryTranslation table, but we will keep all these other fields
    # and have the English translation on here as well as a record on the ShortStoryTranslation table
    language = db.Column(db.String(10))
    title = db.Column(db.String(256)) # Default title in English
    illustration_url = db.Column(db.String(128))
    sequence = db.Column(db.Integer())
    word_count = db.Column(db.Integer())
    difficulty = db.Column(db.String(20))
    story_by = db.Column(db.String(256))
    story_by_user_id = db.Column(db.Integer(), db.ForeignKey('user.id'))
    published_at = db.Column(db.DateTime())
    created_at = db.Column(db.DateTime(timezone=True), server_default=func.now())
    updated_at = db.Column(db.DateTime(timezone=True), onupdate=func.now())
    deleted_at = db.Column(db.DateTime())
    # TODO Eventually add who translated/vetted the story?

    short_story_content = relationship('ShortStoryContent')
    short_story_translation = relationship('ShortStoryTranslation')
    multiple_choice_questions = relationship('MultipleChoiceQuestion')
Esempio n. 10
0
class UserResetPasswordToken(db.Model):
    id = db.Column(db.Integer(), primary_key=True, autoincrement=True)
    user_id = db.Column(db.Integer(), db.ForeignKey('user.id'))
    token = db.Column(db.String(36))
    created_at = db.Column(db.DateTime(timezone=True),
                           server_default=func.now())