def get_student(): hackbright_app.connect_to_db() print request.args student_github = request.args.get("github") row = hackbright_app.get_student_by_github(student_github) html = render_template("student_info.html", first_name = row[0], last_name=row[1], github=row[2]) return html
def get_student(): hackbright_app.connect_to_db() student_github = request.args.get("github") row = hackbright_app.get_student_by_github(student_github) row2 = hackbright_app.get_student_report(student_github) return render_template("student_info.html", first_name=row[0], last_name=row[1], github=row[2], list_of_grades=row2)
def get_project_info(): hackbright_app.connect_to_db() student_project = request.args.get("project_title") # student_github = request.args.get("github") row = hackbright_app.get_project_grade(student_project) html = render_template("student_projects.html", student = row, project_title = student_project) return html
def make_new_grade(): hackbright_app.connect_to_db() github = request.form.get("github") project = request.form.get("project") grade = request.form.get("grade") hackbright_app.make_new_grade(github, project, grade) return redirect("/project?project=%s"%project)
def get_student(): hackbright_app.connect_to_db() student_github = request.args.get("github") row = hackbright_app.get_student_by_github(student_github) first_name = row[0] last_name = row[1] grades = hackbright_app.show_grades(first_name,last_name) print grades # project_names, grades = zip(*grades) html = render_template("index.html", first_name = row[0], last_name = row[1], github = row[2], grades = grades # project_names = project_names ) # def list_project_grades(): # hackbright_app return html
def new_student(): hackbright_app.connect_to_db() github = request.args.get("github") first_name = request.args.get("first_name") last_name = request.args.get("last_name") new_student = hackbright_app.make_new_student(first_name, last_name, github) return redirect("/")
def make_project(): hackbright_app.connect_to_db() ptitle = request.args.get("ptitle") description = request.args.get("description") max_score = request.args.get("max_score") hackbright_app.make_new_project(ptitle, description, max_score) return redirect("/project?name="+ptitle)
def get_project(): hackbright_app.connect_to_db() project_name = request.args.get("name") grades = hackbright_app.get_grades_by_project(project_name) return render_template("project_info.html", name = project_name, grades = grades)
def make_student(): hackbright_app.connect_to_db() first = request.args.get("first") last = request.args.get("last") github = request.args.get("github") hackbright_app.make_new_student(first, last, github) return redirect("/student?github="+github)
def get_student(): hackbright_app.connect_to_db() student_github = request.args.get("github") row = hackbright_app.get_student_by_github(student_github) row2 = hackbright_app.get_student_grades(student_github) html = render_template("student_info.html", first_name=row[0], last_name=row[1], github=row[2], project_title=row2[2], grade=row2[3]) return html
def make_grade(): hackbright_app.connect_to_db() grade = request.args.get("grade") ptitle = request.args.get("title") github = request.args.get("github") hackbright_app.update_grade(grade, ptitle, github) return redirect("/student?github="+github)
def show_project_grades(): hackbright_app.connect_to_db() project_name = request.args.get("project_name") rows = hackbright_app.show_grades_by_project(project_name) html = render_template("project_info.html", rows = rows, project = project_name) return html
def get_project(): hackbright_app.connect_to_db() project_title = request.args.get("project") project_grades = hackbright_app.all_project_grades(project_title) html = render_template("project_grades.html",project=project_title, grades=project_grades) return html
def create_grade(): hackbright_app.connect_to_db() student_github = request.args.get('student_github') project_title = request.args.get('project_title') grade = request.args.get('grade') grades = hackbright_app.student_grade_project(project_title) does_exist = False for row in grades: if row[0] == student_github: does_exist = True break if not does_exist: grade = hackbright_app.give_grade_to_student( student_github, project_title, grade, ) return "Success: %s %s %s" % grade else: return "Student %s already has a grade for this project" % student_github
def new_project(): hackbright_app.connect_to_db() new_student_first_name = request.args.get("new_student_first_name") new_student_last_name = request.args.get("new_student_last_name") new_student_github = request.args.get("new_student_github") hackbright_app.make_new_student(new_student_first_name, new_student_last_name, new_student_github) return render_template("new_project.html", new_student_first_name = new_student_first_name, new_student_last_name= new_student_last_name)
def get_project_grades(): hackbright_app.connect_to_db() project_title = request.args.get("project") names_and_grades = hackbright_app.return_all_student_grades(project_title) # student_github = row[0] html = render_template("return_grades_on_a_project.html", project_title = project_title, names_and_grades = names_and_grades) return html
def add_grade(): hackbright_app.connect_to_db() project_title = request.args.get("project") grade = request.args.get("grade") github = request.args.get("github") hackbright_app.give_grade(github, project_title, grade) return get_student(github)
def add_project(): hackbright_app.connect_to_db() title = request.args.get("title") description = request.args.get("description") max_grade = request.args.get("max_grade") new_project = hackbright_app.make_new_project(title, description, max_grade) return redirect("/") # , title=title, description=description, max_grade=max_grade)
def add_project(): hackbright_app.connect_to_db() project_title = request.args.get("project") desc = request.args.get("desc") max_grade = request.args.get("max_grade") hackbright_app.add_project(project_title, desc, max_grade) return render_template("main.html")
def add_student(): hackbright_app.connect_to_db() first_name = request.args.get("first_name") last_name = request.args.get("last_name") github = request.args.get("github") hackbright_app.make_new_student(first_name, last_name, github) return render_template("student_info.html", first_name=first_name, last_name=last_name, github=github)
def get_grades(): hackbright_app.connect_to_db() project = request.args.get("project") grades = hackbright_app.get_grade_by_project(project) html = render_template("project_info.html", project_title=project, grades=grades) return html
def get_project_info(): hackbright_app.connect_to_db() project = request.args.get("project") row = hackbright_app.get_grades_by_project(project) html = render_template("project_info.html", project_list=row) return html
def add_new_project(): hackbright_app.connect_to_db() projectname = request.args.get("projectname") projectgrade = request.args.get("projectgrade") row2 = hackbright_app.make_new_project(projectname, projectgrade) html = render_template("new_student_record.html", newprojectgrade = row2) return html
def get_grades(): hackbright_app.connect_to_db() student_github = request.args.get("github") rows = hackbright_app.show_all_grades(student_github) html = render_template("student_info.html", student_github=student_github, grades=rows) return html
def create_project(): hackbright_app.connect_to_db() project = request.args.get("project") description = request.args.get("description") max_grade = request.args.get("max_grade") hackbright_app.make_new_project(project, description, max_grade) return get_projects()
def get_student(): hackbright_app.connect_to_db() student_github = request.args.get("student") row = hackbright_app.get_student_by_github(student_github) grade = hackbright_app.show_all_grades(row[0], row[1]) html = render_template("student_info.html", first_name=row[0], last_name=row[1], github=row[2], grade= grade) return html
def get_project(): hackbright_app.connect_to_db() project_title = request.args.get("project") projects = hackbright_app.show_grades_by_project(project_title) html = render_template("get_project.html", projects = projects) return html
def new_grade_page(): hackbright_app.connect_to_db() grade = request.args.get("grade") github = request.args.get("github") project = request.args.get("project") hackbright_app.give_a_grade(github, project, grade) return get_student()
def get_grades_for_project(): hackbright_app.connect_to_db() project_title = request.args.get("project_title") rows = hackbright_app.get_grades_for_project(project_title) html = render_template("student_grades.html", project_titles = rows) return html
def get_studentgrades(): hackbright_app.connect_to_db() student_github = request.args.get("student") rows = hackbright_app.get_grades_by_student(student_github) html = render_template("student_info.html", rows = rows , student_github = student_github) # Note need to put student_github in there so it passes through Jinja - left side goes to Jinja/html, right side references python var return html
def create_new_student(): #####################################################3 first_name = request.args.get("first_name") last_name = request.args.get("last_name") github = request.args.get("github") hackbright_app.connect_to_db() if hackbright_app.make_new_student(first_name, last_name, github): html = render_template("new_student.html", first_name=first_name, last_name=last_name, github=github) return html
def get_project(): hackbright_app.connect_to_db() project_title = request.args.get("project") all_project_grades_list = hackbright_app.get_all_grades_by_project(project_title) # first_name = project_grades[0] # last_name = project_grades[1] # project_name = project_grades[2] # student_grade = project_grades[3] html = render_template("project_info.html", project_title=project_title, all_project_grades_list=all_project_grades_list) return html
def create_grade(): hackbright_app.connect_to_db() github = request.args.get("github") title = request.args.get("title") grade = request.args.get("grade") row = hackbright_app.give_grade(github, title, grade) html = render_template("grade_confirmation_screen.html", firstname=row[0], lastname=row[1], title=row[2], grade=row[3]) return html
def get_student(): hackbright_app.connect_to_db() student_github = request.args.get("student") row = hackbright_app.get_student_by_github(student_github) grades = hackbright_app.show_all_grades(row[0], row[1]) html = render_template("student_info.html", first_name=row[0], last_name=row[1], github=row[2], grades=grades) return html
def get_project_grades(): hackbright_app.connect_to_db() project = request.args.get("title") print " ______________________ %r ______________________" % project row = hackbright_app.all_grades_for_project(project) print "__________________%r_________________" % row html = render_template("project_grades.html", row=row, title=project, first_name=row[0], last_name=row[1], grade=row[2], github=row[3]) return html
def new_student_created(): hackbright_app.connect_to_db() first_name = request.args.get("first_name") last_name = request.args.get("last_name") github = request.args.get("github") status = hackbright_app.make_new_student(first_name, last_name, github) if status == 1: return render_template("new_student_created.html", first_name=first_name, last_name=last_name, github=github) else: return render_template( "error.html", error_message="Oops, we failed to create the new student %s %s." % (first_name, last_name))
def new_project_created(): hackbright_app.connect_to_db() title = request.args.get("title") description = request.args.get("description") max_grade = request.args.get("max_grade") status = hackbright_app.add_a_project(title, description, max_grade) if status == 1: return render_template("new_project_created.html", title=title, description=description, max_grade=max_grade) else: return render_template( "error.html", error_message="Oops, we failed to create the new project %s." % (title))
def grade_given(): hackbright_app.connect_to_db() github = request.args.get("github") project = request.args.get("project") grade = request.args.get("grade") status = hackbright_app.give_student_grade(github, project, grade) if status == 1: return render_template("grade_given.html", github=github, project=project, grade=grade) else: return render_template( "error.html", error_message= "Oops, we failed to add the grade %s to the project %s for account %s." % (grade, project, github))
def get_student(): hackbright_app.connect_to_db() student_github = request.args.get("github") student_github_tuple = hackbright_app.get_student_by_github(student_github) first_name = student_github_tuple[0] last_name = student_github_tuple[1] github = student_github_tuple[2] student_grades_list = hackbright_app.get_grades_by_student(first_name,last_name) # title = student_grades_tuple[0] # grade = student_grades_tuple[1] # max_grade = student_grades_tuple[2] html = render_template("student_info.html", first_name=first_name, last_name=last_name, github=github, student_grades_list=student_grades_list) return html
def get_student(): hackbright_app.connect_to_db() student_github = request.args.get("github") row1 = hackbright_app.get_student_by_github(student_github) row2 = hackbright_app.query_grades_by_student(row1[1]) print "********************************************" print "this is row 2", row2 print "********************************************" get_grades = [] get_project = [] for i in range(len(row2)): get_project.append(row2[i][0]) get_grades.append(row2[i][1]) html = render_template("student_info.html", first_name=row1[0], last_name=row1[1], github=row1[2], projects=get_project, grades=get_grades) return html
def get_project_grades(): hackbright_app.connect_to_db() project_title = request.args.get("title") rows = hackbright_app.all_project_grades(project_title) # returns list html = render_template("project.html", students=rows) return html
def get_project(): hackbright_app.connect_to_db() project_title = request.args.get("project_title") project = hackbright_app.get_project(project_title) return render_template("main.html", view_project=True, title=project[0], description=project[1], max_grade=project[2])
def get_grades(): hackbright_app.connect_to_db() project_title = request.args.get("project_title") project_grades = hackbright_app.show_all_grades(project_title) html = render_template("project_grades.html", project_title=project_title, project_grades = project_grades) return html
def all_students(): hackbright_app.connect_to_db() names = hackbright_app.show_all_students() return render_template("main.html", all_students=True, active_students="active", students=names)
def all_projects(): hackbright_app.connect_to_db() projects = hackbright_app.show_all_projects() return render_template("main.html", all_projects=True, active_projects="active", projects=projects)
def get_project_title(): hackbright_app.connect_to_db() projects = hackbright_app.get_all_projects() return render_template("all_projects.html", projects=projects)
def get_grades_byproject(): hackbright_app.connect_to_db() project = request.args.get("title") rows = hackbright_app.get_grades_by_project(project) html = render_template("project_grades.html", rows=rows) return html
def get_projectgrades(projectname): hackbright_app.connect_to_db() # project_title = request.args.get("projectname") #Don't need this because active user input not in URL or web form projects = hackbright_app.get_all_studentgrades(projectname) html = render_template("project_grades.html", projects = projects) return html
def grades_by_project(): hackbright_app.connect_to_db()