summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
authorankitjavalkar2016-12-22 20:16:00 +0530
committerankitjavalkar2016-12-22 20:32:48 +0530
commit0e56fc6a77ec21db05c9bafb42b1acc652354a32 (patch)
treeadb07f2709621b8906b5047da02010958bebba67 /yaksh/models.py
parent42ed7c142e2c4ff4dccdaec2365e22d30bc276dd (diff)
downloadonline_test-0e56fc6a77ec21db05c9bafb42b1acc652354a32.tar.gz
online_test-0e56fc6a77ec21db05c9bafb42b1acc652354a32.tar.bz2
online_test-0e56fc6a77ec21db05c9bafb42b1acc652354a32.zip
- Fix grade user rendering issue when question is skipped
- Modify grade user html template to create readable variables for answer and error
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 08feab6..35999d3 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -1027,9 +1027,15 @@ class AnswerPaper(models.Model):
for answer in self.answers.all():
question = answer.question
if question in q_a:
- q_a[question].append((answer, [e for e in json.loads(answer.error)]))
+ q_a[question].append({'answer': answer,
+ 'error_list': [e for e in json.loads(answer.error)]
+ }
+ )
else:
- q_a[question] = [(answer, [e for e in json.loads(answer.error)])]
+ q_a[question] = [{'answer': answer,
+ 'error_list': [e for e in json.loads(answer.error)]
+ }
+ ]
return q_a
def get_questions(self):