Skip to content

Commit 6591266

Browse files
committed
Use percentages in one outcome summary
1 parent 162d86a commit 6591266

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

web/attempts/outcome.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ def summary(self):
5555
empty = f'{self.empty} { _("empty") }'
5656
return f"{valid} / {invalid} / {empty}"
5757

58+
def percentage_summary(self):
59+
valid = f'{self.valid_percentage}% { _("valid") }'
60+
invalid = f'{self.invalid_percentage}% { _("invalid") }'
61+
empty = f'{self.empty_percentage}% { _("empty") }'
62+
return f"{valid} / {invalid} / {empty}"
63+
5864
@classmethod
5965
def group_dict(cls, parts, users, parts_group_by, users_group_by):
6066
part_group_sizes = _group_sizes(parts, *parts_group_by)

web/templates/courses/_problem_set.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{% if course.is_taught %}
55
{% spaceless %}
66
<div data-toggle="tooltip"
7-
title="{{ problem_set.outcome.summary }} ">
7+
title="{{ problem_set.outcome.percentage_summary }} ">
88
{% if problem_set.outcome.valid_percentage %}
99
<hr class="indicator background5" width="{{ problem_set.outcome.valid_percentage }}%">
1010
{% endif %}

0 commit comments

Comments
 (0)