Skip to content

Commit

Permalink
Fixed weight ignore issue on grade calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
amir-qayyum-khan committed Jun 17, 2015
1 parent 1a0b28d commit fdd006b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions edx_sga/sga.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ def student_state(self):
"annotated": annotated,
"graded": graded,
"max_score": self.max_score(),
'weight': self.weight,
"upload_allowed": self.upload_allowed(),
}

Expand Down Expand Up @@ -329,6 +330,7 @@ def get_student_data():
return {
'assignments': list(get_student_data()),
'max_score': self.max_score(),
'weight': self.weight,
'display_name': self.display_name
}

Expand Down
9 changes: 6 additions & 3 deletions edx_sga/templates/staff_graded_assignment/show.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
<p>No file has been uploaded.</p>
<% } %>
<% if (graded) { %>
<p>Your score is <%= graded.score %> / <%= max_score %><br/>
<% if (weight > 0) { %>
<p>Your score is <%= (graded.score / max_score) * weight %> / <%= weight %><br/>
<% } %>
<% if (graded.comment) { %>
<b>Instructor comment</b> <%= graded.comment %>
<% } %>
Expand Down Expand Up @@ -73,8 +75,9 @@
<td><%= assignment.timestamp %></td>
<td>
<% if (assignment.score !== null) { %>
<%= assignment.score %> /
<%= max_score %>
<% if (weight > 0) { %>
<%= (assignment.score / max_score) * weight %> / <%= weight %>
<% } %>
<% if (! assignment.approved) { %>
({% trans "Awaiting instructor approval" %})
<% } %>
Expand Down

0 comments on commit fdd006b

Please sign in to comment.