summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh')
-rw-r--r--yaksh/templates/yaksh/question.html3
-rw-r--r--yaksh/templatetags/custom_filters.py5
2 files changed, 7 insertions, 1 deletions
diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html
index e67a260..3bdabd1 100644
--- a/yaksh/templates/yaksh/question.html
+++ b/yaksh/templates/yaksh/question.html
@@ -256,6 +256,9 @@ question_type = "{{ question.type }}"
{% endif %}
{% if question.type == "arrange" %}
+ {% if last_attempt %}
+ {% get_arrange_user_answer last_attempt question as test_cases %}
+ {% endif %}
<input name="answer" type="hidden" id='arrange_order'/>
<div class="list-group">
<ol class="arrange">
diff --git a/yaksh/templatetags/custom_filters.py b/yaksh/templatetags/custom_filters.py
index 05c363c..e24a792 100644
--- a/yaksh/templatetags/custom_filters.py
+++ b/yaksh/templatetags/custom_filters.py
@@ -71,7 +71,10 @@ def get_ordered_testcases(question, answerpaper):
@register.simple_tag
def get_arrange_user_answer(ans, question):
- ans = str(ans)
+ if type(ans) == bytes:
+ ans = ans.decode("utf-8")
+ else:
+ ans = str(ans)
ans_list = literal_eval(ans)
testcase_list = []
for answer_id in ans_list: