Пример #1
0
def courses_top(trans):
    s1 = factories.SectionFactory()
    s2 = factories.SectionFactory()

    factories.EvaluationFactory(section=s1)
    factories.EvaluationFactory(section=s1)
    factories.EvaluationFactory(section=s2)
    db.session.commit()
Пример #2
0
def professors_top(trans):
    p1 = factories.ProfessorFactory()
    p2 = factories.ProfessorFactory()

    s1 = factories.SectionFactory(professors=[p1])
    s2 = factories.SectionFactory(professors=[p2])

    factories.EvaluationFactory(section=s1, professor=p1)
    factories.EvaluationFactory(section=s2, professor=p2)
    db.session.commit()
Пример #3
0
def class_details(trans):
    q = factories.QuarterFactory(id=1)
    c = factories.CourseFactory(id=1)
    prof = factories.ProfessorFactory(id=1)
    factories.QuarterFactory.reset_sequence(2)
    factories.CourseFactory.reset_sequence(2)
    factories.ProfessorFactory.reset_sequence(2)
    factories.SectionFactory(quarter=q, course=c, professors=[prof])
    db.session.commit()
Пример #4
0
def course_details(trans):
    course = factories.CourseFactory(id=1)
    section = factories.SectionFactory(course=course)
    ev = factories.EvaluationFactory(section=section,
                                     professor=section.professors[0])
    factories.VoteFactory(value=Vote.UPVOTE,
                          student=stash['student'],
                          evaluation=ev)
    db.session.commit()
Пример #5
0
def professors(trans):
    prof = factories.ProfessorFactory()
    course = factories.CourseFactory(id=1)
    quarter = factories.QuarterFactory(id=1)
    section = factories.SectionFactory(course=course, quarter=quarter)
    ev = factories.EvaluationFactory(section=section, professor=prof)
    factories.VoteFactory(value=Vote.UPVOTE,
                          student=stash['student'],
                          evaluation=ev)
    db.session.commit()
Пример #6
0
def quarters(trans):
    now = datetime.now()
    start_prev = (now + timedelta(days=-10)).date()
    end_prev = (now + timedelta(days=-9)).date()

    quarter = factories.QuarterFactory(period=DateRange(start_prev, end_prev))
    factories.QuarterCurrentFactory()
    course = factories.CourseFactory(id=1)
    prof = factories.ProfessorFactory(id=1)
    factories.SectionFactory(quarter=quarter, course=course, professors=[prof])
    factories.QuarterFactory()
    db.session.commit()
Пример #7
0
def student_evaluations(trans):
    prof = factories.ProfessorFactory(id=1)
    course = factories.CourseFactory(id=1)
    quarter = factories.QuarterFactory(id=1)
    sec = factories.SectionFactory(quarter=quarter,
                                   course=course,
                                   professors=[prof])
    ev = factories.EvaluationFactory(section=sec,
                                     professor=prof,
                                     student=stash['student'])
    factories.VoteFactory(value=Vote.UPVOTE,
                          student=stash['student'],
                          evaluation=ev)
    db.session.commit()
Пример #8
0
def evaluations_submit(trans):
    prof = factories.ProfessorFactory(id=1)
    course = factories.CourseFactory(id=1)

    now = datetime.now()
    start_prev = (now - timedelta(days=10)).date()
    end_prev = (now + timedelta(days=10)).date()
    quarter = factories.QuarterFactory(id=1,
                                       period=DateRange(start_prev, end_prev))

    factories.QuarterFactory()

    factories.SectionFactory(quarter=quarter, course=course, professors=[prof])
    db.session.commit()
Пример #9
0
def professor_details(trans):
    prof = factories.ProfessorFactory(id=1)
    factories.SectionFactory(professors=[prof])
    db.session.commit()