diff options
-rw-r--r-- | yaksh/templatetags/custom_filters.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/yaksh/templatetags/custom_filters.py b/yaksh/templatetags/custom_filters.py index df6ecce..1195653 100644 --- a/yaksh/templatetags/custom_filters.py +++ b/yaksh/templatetags/custom_filters.py @@ -1,5 +1,6 @@ from django import template from django.template.defaultfilters import stringfilter +import os try: from itertools import zip_longest except ImportError: @@ -27,3 +28,14 @@ def inprogress(answerpaper): @register.filter(name='zip') def zip_longest_out(a, b): return zip_longest(a, b) + + +@register.filter(name="file_title") +def file_title(name): + return os.path.basename(name) + + +@register.simple_tag +def get_unit_status(course, module, unit, user): + return course.get_unit_completion_status(module, user, unit) + |