def get_student():
    """Show information about a student."""

    # github = request.args.get('github', 'jhacks')
    # first, last, github = hackbright.get_student_by_github(github)
    # first, last, github = hackbright.get_student_by_github(github)
    # html =  render_template('student_info.html',
    #     first=first,
    #     last=last,
    #     github=github)

    # return html

    # we are editing code below to show student grades and proejct title.

    github = request.args.get('github', 'jhacks')
    first, last, github = hackbright.get_student_by_github(github)
    # student_github, project_title, grade = hackbright.get_grades_by_github(github)
    rows = hackbright.get_grades_by_github(github)
    print rows
    html = render_template('student_info.html',
                           first=first,
                           last=last,
                           github=github,
                           rows=rows)

    return html
Example #2
0
def get_student():
    """Show information about a student."""

    github = request.args.get('github')

    # student_id, first, last, github = hackbright.get_student_by_github(github)
    #we could also write:
    # row = hackbright.get_student_by_github(github)
    # first = row[0]
    # last = row[1]
    # github = row[2]

    student_id, first, last, github = hackbright.get_student_by_github(github)
    project_and_grade_list = hackbright.get_grades_by_github(github)


    html = render_template("student_info.html",                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                           student_id= student_id,
                           first=first,
                           last=last,
                           github=github,
                           projects_list=project_and_grade_list)
                       
                
    return html
def get_student():
    """Show information about a student."""

    github = request.args.get('github')

    first, last, github = hackbright.get_student_by_github(github)

    try:
        # title, grade = hackbright.get_grades_by_github(github)
        rows = hackbright.get_grades_by_github(github)
        # return html

    except ValueError:
        return render_template('student_info.html',
                               first=first,
                               last=last,
                               github=github)

    else:

        # return render_template('student_info.html', first=first, last=last, github=github, grade=grade, title=title)
        return render_template('student_info.html',
                               student_info=rows,
                               first=first,
                               last=last,
                               github=github)
Example #4
0
def get_student():
    """Show information about a student."""

    github = request.args.get("github", "jhacks")
    page = hackbright.get_grades_by_github(github)

    return page
Example #5
0
def get_student():
    """Show information about a student."""

    # Get github from student_search.html form
    github = request.args.get('github')

    if github:
        # Unpack and get student by their github in our HB database
        first, last, github = hackbright.get_student_by_github(github)
        """
            1. Get List of project titles associated with github username.
            2. Need the grade for each project title.
            3. Return a tuple that contains the PROJECT TITLE and GRADE.
            4. Send to student_info.html the list of titles/grades.
        """
        project_tuples = hackbright.get_grades_by_github(github)
        print('\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n')
        print(project_tuples)

        html = render_template("student_info.html",
                               first=first,
                               last=last,
                               github=github,
                               project_tuples=project_tuples)

        return html

    return redirect("/student_search")
Example #6
0
def get_student():
    """Show information about a student."""

    github = request.args.get('github', 'jhacks')
    first, last, github = hackbright.get_student_by_github(github)
    projects = hackbright.get_grades_by_github(github)
    return render_template("student_info.html", first=first, last=last, 
                            github=github, projects=projects)
def get_student():
    """Show information about a student."""

    github = request.args.get('github')
    first, last, github = hackbright.get_student_by_github(github)
    grades = hackbright.get_grades_by_github(github)
    html = render_template("student_info.html", first=first, last=last, github=github, grades=grades)
    return html
Example #8
0
def get_student():
    """Show information about a student."""
    student_github = request.args.get('github')
    student = hackbright.get_student_by_github(student_github)
    print(student)
    # import pdb; pdb.set_trace();

    # Use if/else statements to determine if a student is already in
    # the session OR already in the database OR if it is a new student
    if 'new_student' in session and student_github == session['new_student'][2]:
        # If the student is already in the session and the github that is input
        # into the search bar is the same as the one in the session, then we want
        # to gather the session information, to be displayed in student_info.html
        github = session['new_student'][2]

        first_name, last_name, github = student

        project_grades = hackbright.get_grades_by_github(github)
        # print(project_grades)

    elif student:
        #     # If the student IS NOT in the session, we will check if they are in the
        #     # database. If the student is in the database (checked by their github),
        #     # then we want to gather the info from the database, to be displayed in
        #     # student_info.html

        # If student has been found in the database, do these  things

        first_name, last_name, github = student

        project_grades = hackbright.get_grades_by_github(student_github)

    else:
        # If the student is not in the session AND not in the database, we will
        # send user to the /student-add-form page, where a function will add
        # the student to the database
        return redirect("/student-add-form")

    # If student is in session or in database, will render the student_info.html
    html = render_template("student_info.html",
                           first=first_name,
                           last=last_name,
                           github=github,
                           projects=project_grades)
    return html
def get_student():
    """Show information about a student."""

    github = request.args.get('github','jhacks')
    first, last, github = hackbright.get_student_by_github(github)
    list_of_projects_and_grades = hackbright.get_grades_by_github(github)
    return render_template("student_info.html", first=first,
                            last=last, github=github,
                            list_of_projects_and_grades=list_of_projects_and_grades)
def get_student(github):
    """Show information about a student."""

    first, last, github = hackbright.get_student_by_github(github)
    projects_and_grades = hackbright.get_grades_by_github(github)
    return render_template("student_info.html",
                           first=first,
                           last=last,
                           github=github,
                           projects_and_grades = projects_and_grades)
def get_student():
    """Show information about a student."""

    github = request.args.get('github')
    student = hackbright.get_student_by_github(github)
    results = hackbright.get_grades_by_github(github)

    return render_template("student_info.html",
                           student=student,
                           grades=results)
Example #12
0
def get_student():
    """Show information about a student."""

    github = request.args.get('github')

    first, last, github = hackbright.get_student_by_github(github)
    rows = hackbright.get_grades_by_github(github)

    return render_template('student_info.html', github=github,
                           first=first, last=last, rows=rows)
def get_student():
    """Show information about a student."""

    github = request.args.get('github', 'jhacks')
    # get_grades_by_github is a function in hackbright.py 
    grades = hackbright.get_grades_by_github(github)
    first, last, github = hackbright.get_student_by_github(github)
    # Added grades variable in our student_info.html
    
    html = render_template("student_info.html", first=first, last=last, github=github, grades=grades)
    return html
def get_student():
    """Show information about a student."""

    github = request.args.get('github', 'jhacks')
    first, last, github = hackbright.get_student_by_github(github)
    trifecta = hackbright.get_grades_by_github(github)
    html = render_template("student_info.html",
                           first=first,
                           last=last,
                           trifecta=trifecta)
    return html
Example #15
0
def get_student():
    """Show information about a student."""

    github = request.args.get('github')

    first, last, github = hackbright.get_student_by_github(github)

    # return a list of tuples of project and grade for the github user
    grade_listing = hackbright.get_grades_by_github(github)

    return render_template("student_info.html", first=first, last=last, github=github, projects= grade_listing)
def get_student():
    """Show information about a student."""

    github = request.args.get('github', 'jhacks')
    first, last, github = hackbright.get_student_by_github(github)
    project = hackbright.get_grades_by_github(github)
    return render_template('student_info.html',
                            github=github, 
                            first=first,
                            last=last,
                            project=project)
def get_student():
    """Show information about a student."""

    github = request.args.get('github', 'jhacks')
    first, last, github = hackbright.get_student_by_github(github)
    trifecta = hackbright.get_grades_by_github(github)
    import pdb; pdb.set_trace()
    print "TRIFECTA %s" % trifecta
    return render_template("student_info.html",
                           first=first,
                           last=last,
                           trifecta=trifecta)
def get_student_form():
    """Show form for searching for a student."""

    github = request.args.get('github')

    row_student = hackbright.get_student_by_github(github)

    row_grade = hackbright.get_grades_by_github(github)

    return render_template("student_info.html",
                           row_student=row_student,
                           row_grade=row_grade)
def get_student():
    """Show information about a student."""

    github = request.args.get("github")
    first, last, github = hackbright.get_student_by_github(github)
    rows = hackbright.get_grades_by_github(github)
   
    return render_template("student_info.html",
                            first=first,
                            last=last,
                            github=github,
                            rows=rows)
def get_student():
    """Show information about a student."""

    github = request.args.get("github", "jhacks")

    first, last, github = hackbright.get_student_by_github(github)
    grades = hackbright.get_grades_by_github(github)

    return render_template("student_info.html", first=first,
                                                last=last,
                                                github=github,
                                                grades=grades)
def get_student():
    """Show information about a student."""

    github = request.args.get("github")
    first, last, github = hackbright.get_student_by_github(github)
    rows = hackbright.get_grades_by_github(github)
    #return "%s is the GitHub account for %s %s" % (github, first, last)
    html = render_template("student_info.html",
                           first=first,
                           last=last,
                           github=github, rows=rows)
    return html
def get_student():
    """Show information about a student."""

    github = request.args.get('github', 'jhacks')
    first, last, github = hackbright.get_student_by_github(github)
    grades = hackbright.get_grades_by_github(github)
    html = render_template('student_info.html', first = first, last = last, github=github, grades=grades)
    # return "%s is the GitHub account for %s %s" % (github, first, last)

    print grades 

    return html
def get_student():
    """Show information about a student."""

    github = request.args.get('github','jhacks')
    first, last, github = hackbright.get_student_by_github(github)
    project_information = hackbright.get_grades_by_github(github)
    # return "%s is the GitHub account for %s %s" % (github, first, last)
    return render_template("student_info.html",
                            github=github, 
                            first=first, 
                            last=last,
                            project_information=project_information)
def get_student():
    """Show information about a student."""

    github = request.args.get('github', 'jhacks')
    first, last, github = hackbright.get_student_by_github(github)

    grades_all = hackbright.get_grades_by_github(github)

    return render_template('student.html',
                           first=first,
                           last=last,
                           github=github,
                           grades_all=grades_all)
Example #25
0
def get_student():
    """Show information about a student."""

    github = request.args.get("github")
    first, last, github = hackbright.get_student_by_github(github)

    project_list = hackbright.get_grades_by_github(github)
    html = render_template("student_info.html",
                           github=github,
                           first=first,
                           last=last,
                           project_list=project_list)
    return html
Example #26
0
def get_student():
    """Show information about a student."""

    github = request.args.get('github')  # Gets github from form or URL arguments

    first, last, github = hackbright.get_student_by_github(github)  # Unpacks tuple
    project_grades = hackbright.get_grades_by_github(github)  # List of tuples

    #passes first, last, github to html
    html = render_template('student_info.html', first=first, last=last, github=github, project_grades=project_grades)

    #return rendered template with args
    return html
def get_student():
    """Show information about a student."""

    github = request.args.get('github') 

    first, last, github = hackbright.get_student_by_github(github)

    #call grades function
    student_grade = hackbright.get_grades_by_github(github)

    html = render_template("student_info.html", first=first, last=last, github=github, grades=student_grade) #feed grades list of tuples into template)

    return html
def adding_title_and_grade():
    title = request.args.get('title')

    title = hackbright.get_project_by_title(title)

    github = request.args.get('github')

    grades = hackbright.get_grades_by_github(github)

    html = render_template("student_info.html",
                           title=title,
                           grades=grades)
    return html
def get_student():
    """Show information about a student."""

    github = request.args.get ("github", "jhacks")
    first, last, github = hackbright.get_student_by_github(github)
    project_info = hackbright.get_grades_by_github(github)
    html = render_template("student_info.html",
    						first=first,
    						last=last,
    						github=github,
    						project_info=project_info)

    return html
def get_student():
    """Show information about a student."""
    #why do we need a placeholder for the gthub name?
    github = request.args.get('github')
    first, last, github = hackbright.get_student_by_github(github)
    project_grade = hackbright.get_grades_by_github(github)
    html = render_template("student_info.html", 
                            first=first,
                            last=last,
                            github=github,
                            project_grade=project_grade,    
                            )
    return html
Example #31
0
def get_student(github):
    """Show information about a student."""

    # github = request.args.get('github')

    first, last, github = hackbright.get_student_by_github(github)
    grades = hackbright.get_grades_by_github(github)
    session[github] = {"first": first, "last": last, "github": github}

    return render_template("student_info.html",
                           first=first,
                           last=last,
                           github=github,
                           grades=grades)
def get_student():
    """Show information about a student."""

    github = request.args.get('github', 'sdevelops')
    title_grade = hackbright.get_grades_by_github(github)

    first, last, github = hackbright.get_student_by_github(github)
    html = render_template("student_info.html", 
                           first=first, 
                           last=last, 
                           github=github, 
                           title_grade=title_grade)

    return html
def get_student():
    """Show information about a student."""

    github = request.args.get('github')

    first, last, github = hackbright.get_student_by_github(github)
    grades = hackbright.get_grades_by_github(github)

    # return "{} is the GitHub account for {} {}".format(github, first, last)
    return render_template("student_info.html",
                           first=first,
                           last=last,
                           github=github,
                           grades=grades)
Example #34
0
def get_student():
    """Show information about a student."""

    github = request.args.get('github', 'jhacks')
    first, last, github = hackbright.get_student_by_github(github)
    rows = hackbright.get_grades_by_github(
        github
    )  #rows returns list of tuples which includes project_title [0], grade [1]

    return render_template("student_info.html",
                           first=first,
                           last=last,
                           github=github,
                           rows=rows)
def get_student():
    """Show information about a student."""

    github = request.args.get('github')
    first, last, github = hackbright.get_student_by_github(github)
    grade_title = hackbright.get_grades_by_github(github)
    html = render_template("student_info.html",
                            first=first,
                            last=last,
                            github=github,
                            grade_title=grade_title)


    return html
def get_student():
    """Show information about a student."""

    github = request.args.get('github', 'jhacks')
    first, last, github = hackbright.get_student_by_github(github)
    # return "%s is the GitHub account for %s %s" % (github, first, last)
    project_grades = hackbright.get_grades_by_github(github)

    html = render_template("student_info.html",
                           first=first,
                           last=last,
                           github=github,
                           grades=project_grades)
    return html
def get_student():
    """Show information about a student."""

    github = request.args.get('github')
    first, last, github = hackbright.get_student_by_github(github)
    # get project/title info
    rows = hackbright.get_grades_by_github(github)
    # print "This is rows: %s" % rows
    html = render_template("student_info.html",
                           first=first,
                           last=last,
                           github=github,
                           rows=rows) #update to pass list

    return html
def get_student():
    """Show information about a student."""

    github = request.args.get('github', 'jhacks')
    first, last, github = hackbright.get_student_by_github(github)

    # call function to return project title and grade in tuples
    title_grade_list = hackbright.get_grades_by_github(github)

    html = render_template("student_info.html",
                            first=first,
                            last=last,
                            github=github, 
                            title_grade_list=title_grade_list)
    return html
Example #39
0
def get_student():
    """Show information about a student."""

    github = request.args.get('github', 'jhacks') # Always says jhacks
    first, last, github = hackbright.get_student_by_github(github)
    proj_grade_tuple = hackbright.get_grades_by_github(github)
    print proj_grade_tuple

    html = render_template("student_info.html",
                            first=first,
                            last=last,
                            github=github,
                            projinfo=proj_grade_tuple)

    return html
def get_student():
    """Show information about a student."""

    github = request.args.get('github')

    student_info = hackbright.get_student_by_github(github)

    # print("{} is the GitHub account for {} {}".format(github, first, last))
    project_data = hackbright.get_grades_by_github(github)
    # print(f"project title: {project_title}")
    # print(project_data)

    return render_template("student_info.html",
                           student=student_info,
                           project_data=project_data)
Example #41
0
def get_student():
    """Show information about a student."""

    github = request.args.get('github')
    first, last, github = hackbright.get_student_by_github(github)
    #print first, last, github
    projects = hackbright.get_grades_by_github(github)
    # [(u'Markov', 10), (u'Blockly', 2), (u'Markov', 10), (u'Blockly', 2)]
    # print "MY ", projects
    html = render_template("student_info.html",
                           first=first,
                           last=last,
                           github=github,
                           projects=projects)

    return html
def get_student():
    """Show information about a student."""

    github = request.args.get("github")
    # if github == 'None':
    #     return "Please request a valid github account in the form /student?github=[USERNAME]"
    try:
        first, last, github = hackbright.get_student_by_github(github)

        grade_data = hackbright.get_grades_by_github(github)

        html = render_template("student_info.html", first=first, last=last, github=github, grade_data=grade_data)
    except TypeError:
        html = "This is not a valid student, <a href='/student-search'>please try again</a>."

    return html
def search_by_student_github():
    """Shows student info that is linked to given github account."""

    github = request.args.get('github')

    first, last, github = hackbright.get_student_by_github(github)

    all_grades = hackbright.get_grades_by_github(github)

    html = render_template("student_info.html",
                           first=first,
                           last=last,
                           github=github,
                           all_grades=all_grades)

    return html
Example #44
0
def get_student():
    """Show information about a student."""

    github = request.args.get('github')

    first, last, github = hackbright.get_student_by_github(github)
    # import pdb; pdb.set_trace()
    grades = hackbright.get_grades_by_github(github)
    print grades
    html = render_template("student_info.html",
                           first=first,
                           last=last,
                           github=github,
                           grades=grades)

    return html
def get_student():
    """Show information about a student."""

    github = request.args.get('github')

    first, last, github = hackbright.get_student_by_github(github)

    rows = hackbright.get_grades_by_github(github)

    # return f"{github} is the GitHub account for {first} {last}"

    return render_template("student_info.html",
                           first=first,
                           last=last,
                           github=github,
                           rows=rows)
Example #46
0
def get_student():
    """Show information about a student."""
    if request.args.get('github'):
        github = request.args.get('github')

        first, last, github = hackbright.get_student_by_github(github)
        project_grade_list = hackbright.get_grades_by_github(github)


        return render_template("student_info.html",
                            github=github, 
                            first=first, 
                            last=last,
                            project_grade_list=project_grade_list)
    else:
        return redirect('/student-search')
def get_student():
    """Show information about a student."""

    github = request.args.get('github')
    first, last, github = hackbright.get_student_by_github(github)
    #print first, last, github
    projects = hackbright.get_grades_by_github(github)
    # [(u'Markov', 10), (u'Blockly', 2), (u'Markov', 10), (u'Blockly', 2)]
    # print "MY ", projects
    html = render_template("student_info.html",
    						first=first,
    						last=last,
    						github=github,
    						projects=projects)

    return html
Example #48
0
def get_student():
    """Show information about a student."""

    github = request.args.get('github', 'jhacks')
    first, last, github = hackbright.get_student_by_github(github)

    # [ (project_title, grade ), (project_title, grade )]
    grades = hackbright.get_grades_by_github(github)
    
    descriptions = hackbright.get_project_by_title(title)

    html = render_template("student_info.html", 
                            first=first,
                            last=last,
                            github=github,
                            grades=grades)
    return html
def get_student():
    """Show information about a student."""

    # run select statement, bind 'github' to resulting tuple
    github = request.args.get('github', 'jhacks')

    # unpack tuple
    first, last, github = hackbright.get_student_by_github(github)
    
    # list of tuples (project, grade)
    all_grades = hackbright.get_grades_by_github(github)

    # render student info page
    html = render_template("student_info.html",
                           first=first,
                           last=last,
                           github=github,
                           all_grades=all_grades)
    return html
def display_student(firstname, lastname):
    """Display student info"""

    first = firstname
    print first
    last = lastname
    print last
          
    github = hackbright.get_github_by_student(first, last)
    # pass github to get_grades_by_github
    # get project/title info
    rows = hackbright.get_grades_by_github(github)
    # print "This is rows: %s" % rows
    html = render_template("student_info.html",
                           first=first,
                           last=last,
                           github=github,
                           rows=rows) #update to pass list

    return html
def get_student():
    """Show information about a student."""

    github = request.args.get('github')

    first, last, github = hackbright.get_student_by_github(github)
    project_info = hackbright.get_grades_by_github(github)

    project_info = [{'title': title, 'grade':grade} for title, grade in project_info]
    

    html = render_template('student_info.html',
                            first=first,
                            last=last,
                            github=github,
                            project_info=project_info
                            )
                            

    return html
def get_student():
    """Show information about a student."""

    github = request.args.get('github', 'jhacks')

    first, last, github = hackbright.get_student_by_github(github)
    raw_list = hackbright.get_grades_by_github(github)

    projects = []
    grades = []
    for item in raw_list:
      title = item[0]
      grade = item[1]

      projects.append(title)
      grades.append(grade)
      
    html = render_template("student_info.html",
                               first=first,
                               last=last,
                               github=github, projects=projects, grades=grades)
    return html