diff --git a/school/hooks.py b/school/hooks.py index 929dbd4f..63c792cb 100644 --- a/school/hooks.py +++ b/school/hooks.py @@ -184,7 +184,8 @@ jinja = { "school.lms.utils.is_eligible_to_review", "school.lms.utils.get_initial_members", "school.lms.utils.get_sorted_reviews", - "school.lms.utils.is_instructor" + "school.lms.utils.is_instructor", + "school.lms.utils.convert_number_to_character" ], "filters": [] } diff --git a/school/lms/utils.py b/school/lms/utils.py index 9246bc5a..1eae98e7 100644 --- a/school/lms/utils.py +++ b/school/lms/utils.py @@ -2,6 +2,7 @@ import re import frappe from frappe.utils import flt, cint, cstr from school.lms.md import markdown_to_html +import string RE_SLUG_NOTALLOWED = re.compile("[^a-z0-9]+") @@ -292,3 +293,6 @@ def get_initial_members(course): def is_instructor(course): return len(list(filter(lambda x: x.name == frappe.session.user, get_instructors(course)))) > 0 + +def convert_number_to_character(number): + return string.ascii_uppercase[number] diff --git a/school/lms/widgets/Reviews.html b/school/lms/widgets/Reviews.html index bc785845..92e61a3a 100644 --- a/school/lms/widgets/Reviews.html +++ b/school/lms/widgets/Reviews.html @@ -57,7 +57,7 @@