diff options
Diffstat (limited to 'yaksh/models.py')
-rw-r--r-- | yaksh/models.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/yaksh/models.py b/yaksh/models.py index 1094bb0..0456b52 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -2305,6 +2305,17 @@ class AnswerPaper(models.Model): 'answer': answer, 'error_list': [e for e in json.loads(answer.error)] }] + + for question, answers in q_a.items(): + answers = q_a[question] + q_a[question].append({ + 'marks': max([ + answer['answer'].marks + for answer in answers + if question == answer['answer'].question + ]) + }) + return q_a def get_latest_answer(self, question_id): |