예제 #1
0
def view_student_logs():
    """Renders page for viewing past logs for individual student"""

    student = crud.get_student_by_id(session['student_id'])
    teacher = crud.get_teacher_by_id(session["teacher_id"])

    return render_template('charts.html', student=student, teacher=teacher)
예제 #2
0
def go_to_student_profile(student_id):
    """ Allows a teacher to see each of their students's profile page"""

    teacher = crud.get_teacher_by_id(session['teacher_id'])
    student = crud.get_student_by_id(student_id)

    return render_template('student-profile.html',
                           student=student,
                           teacher=teacher)
예제 #3
0
def list_logs_by_student(student_id):
    """Lists every log made by a student depending on their student_id."""

    student = crud.get_student_by_id(student_id)
    student_logs = student.logs

    # student_logs = crud.get_logs_by_student_id(student.student_id)

    return render_template('charts.html',
                           student=student,
                           student_logs=student_logs)
예제 #4
0
def view_student_profile():
    """Renders the VMS student profile page"""

    if 'student_id' not in session:
        return jsonify({'error': 'No student_id in session. Please log in!'})

    student = crud.get_student_by_id(session['student_id'])
    teacher = student.teacher

    return render_template('student-profile.html',
                           student=student,
                           teacher=teacher)
예제 #5
0
def go_to_student_logs(student_id):
    """ Lets a teacher see each of their students's practice log history and data"""

    teacher = crud.get_teacher_by_id(session['teacher_id'])
    student = crud.get_student_by_id(student_id)

    # Get the student's logs through the relationship
    student_logs = student.logs

    return render_template('charts.html',
                           student=student,
                           teacher=teacher,
                           student_logs=student_logs)
예제 #6
0
def list_logs_by_student(student_id):
    """Lists every log made by a student depending on their student_id."""

    student = crud.get_student_by_id(student_id)
    student_logs = student.logs

    if "teacher_id" in session:
        teacher = crud.get_teacher_by_id(session["teacher_id"])
    else:
        teacher = None

    return render_template('charts.html',
                           student=student,
                           teacher=teacher,
                           student_logs=student_logs)
예제 #7
0
def view_log_page():
    """Renders the VMS practice-log page with practice log form"""

    student = crud.get_student_by_id(session['student_id'])

    return render_template('practice-log.html', student=student)