Skip to content

Commit

Permalink
Merge pull request #44 from GatorEducator/bugfix/class-grades-and-inv…
Browse files Browse the repository at this point in the history
…alid-links

Fix class grade display and invalid links
  • Loading branch information
Michionlion authored May 9, 2019
2 parents ba3c3c6 + b830848 commit 5952279
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
12 changes: 6 additions & 6 deletions application/db_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ def get_class_students(class_id):

def get_class_grades(class_id):
"""Get grades given to students in a specified class"""

grades = []
quiz_grades = query_db(
"SELECT people.name, quizzes.name, grade FROM quiz_grades JOIN people "
Expand All @@ -288,8 +287,9 @@ def get_class_grades(class_id):
[class_id],
)
for grade in quiz_grades:
grade_class = {}
grade_class["student_name"] = grade[0]
grade_class["quiz_name"] = grade[1]
grade_class["grade"] = grade[2]
grades.append(grade_class)
class_grade = {}
class_grade["student_name"] = grade[0]
class_grade["quiz_name"] = grade[1]
class_grade["grade"] = grade[2]
grades.append(class_grade)
return grades
4 changes: 2 additions & 2 deletions application/templates/students/class_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h2>Quizzes</h2>
</div>
<div class="row">
<div class="span8">
<h2>Grades Given to You</h2>
<h2>Grades</h2>
<table class="table table-striped table-hover table-bordered">
<thead>
<tr>
Expand All @@ -38,7 +38,7 @@ <h2>Grades Given to You</h2>
{% for grade in grades %}
<tr>
<td>{{grade.quiz_name}}</td>
<td>{{grade.grade}}</td>
<td>{{grade.grade|safe}}</td>
</tr>
{% endfor %}
</tbody>
Expand Down
2 changes: 1 addition & 1 deletion application/templates/students/quiz_grade.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h1>{{class_name}}: {{quiz_name}}</h1>
<div class="row">
<div class="span8">
<h2>Grade Received</h2>
{{grade}}
{{grade|safe}}
</div>
</div>
</div>
Expand Down
7 changes: 4 additions & 3 deletions application/templates/teachers/classes/class_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ <h2 class="inline">Quizzes</h2>
<h2>Students Enrolled</h2>
<ul>
{% for student in students %}
<li><a href="/people/{{student.id}}/">{{student.name}}</a></li>
<!--<li><a href="/people/{{student.id}}/">{{student.name}}</a></li>-->
<li>{{student.name}}</li>
{% endfor %}
</ul>
</div>
Expand All @@ -56,7 +57,7 @@ <h2>Grades Given to This Class</h2>
<thead>
<tr>
<th>Student Name</th>
<th>Assignment/Quiz Name</th>
<th>Quiz Name</th>
<th>Grade (%)</th>
</tr>
</thead>
Expand All @@ -65,7 +66,7 @@ <h2>Grades Given to This Class</h2>
<tr>
<td>{{grade.student_name}}</td>
<td>{{grade.quiz_name}}</td>
<td>{{grade.grade}}</td>
<td>{{grade.grade|safe}}</td>
</tr>
{% endfor %}
</tbody>
Expand Down

0 comments on commit 5952279

Please sign in to comment.