aboutsummaryrefslogtreecommitdiffstats
path: root/client/templatetags/app_filter.py
diff options
context:
space:
mode:
Diffstat (limited to 'client/templatetags/app_filter.py')
-rw-r--r--client/templatetags/app_filter.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/client/templatetags/app_filter.py b/client/templatetags/app_filter.py
index 9f378e1..df92775 100644
--- a/client/templatetags/app_filter.py
+++ b/client/templatetags/app_filter.py
@@ -34,4 +34,16 @@ def doc_count(doc):
if doc.max_instances != 0:
doc_count += "/" + str(doc.max_instances)
- return doc_count \ No newline at end of file
+ return doc_count
+
+@register.filter(name="parse_multiple_choice")
+def parse_multiple_choice(str):
+ if len(str) < 3:
+ return [str, []]
+
+ str = str[3:]
+ arr = str.split(",")
+ if len(arr) < 2:
+ return [arr[0], []]
+
+ return [arr[0], arr[1:]] \ No newline at end of file