Example #1
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()
Example #2
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()
Example #3
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()
Example #4
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()
Example #5
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()
Example #6
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()
Example #7
0
def search(trans):
    factories.CourseFactory(title='Mathematics and Such')
    factories.ProfessorFactory(first_name='Matthew')
    db.session.commit()
Example #8
0
def professor_details(trans):
    prof = factories.ProfessorFactory(id=1)
    factories.SectionFactory(professors=[prof])
    db.session.commit()