Пример #1
0
def check_attendance():
    user = session['user']
    if user['type'] != 'Mentor':
        return redirect(url_for('index'))
    return render_template('check_attendance.html',
                           students=Student.get_list_of_students(),
                           user=user)
Пример #2
0
def create_team():
    user = session['user']
    if user['type'] != 'Mentor':
        return redirect(url_for('index'))
    if request.method == 'POST':
        team_name = request.form['new_team_name']
        chosen_members = []
        member1 = request.form['member1']
        member2 = request.form['member2']
        member3 = request.form['member3']
        member4 = request.form['member4']
        if member1:
            chosen_members.append(Student.get_student_by_id(member1))
        if member2:
            chosen_members.append(Student.get_student_by_id(member2))
        if member3:
            chosen_members.append(Student.get_student_by_id(member3))
        if member4:
            chosen_members.append(Student.get_student_by_id(member4))
        if len(team_name) > 0:
            Team.add_new_team(team_name, chosen_members)
        return redirect('teams.html')
    return render_template('team_create.html',
                           student_list=Student.get_list_of_students(),
                           user=user)
Пример #3
0
def grade_assigment(assigment_id):
    user = session['user']
    if user['type'] != 'Mentor':
        return redirect(url_for('index'))
    assigment = Assigment.get_assigment_by_id(assigment_id)
    if assigment.task_type == 'Personal':
        students_list = Student.get_list_of_students()
        return render_template('assignment_grade.html',
                               assigment=assigment,
                               students_list=students_list,
                               user=user)
    elif assigment.task_type == 'Team':
        team_list = Team.get_list_of_teams()
        return render_template('assignment_grade.html',
                               assigment=assigment,
                               team_list=team_list,
                               user=user)
Пример #4
0
 def get_list_of_students_by_team_id(cls, team_id):
     team_members = []
     for student in Student.get_list_of_students():
         if student.team_id == team_id:
             team_members.append(student)
     return team_members
Пример #5
0
def student_list():
    user = session['user']
    if user['type'] in ('Mentor', 'Employee'):
        return render_template('student_list.html',
                               user=user,
                               students=Student.get_list_of_students())