diff options
author | ankitjavalkar | 2020-09-14 11:57:54 +0530 |
---|---|---|
committer | GitHub | 2020-09-14 11:57:54 +0530 |
commit | 2fbf184c2f18eb52bc4a6c6c6a9168572d2fd23c (patch) | |
tree | 711e958f20f7870d08cdb6be29014e5f1d258f56 /yaksh/models.py | |
parent | 6f5cefcd6614b53285f0747f940c64b97e3783cb (diff) | |
parent | a80fef3789d970d3db17d72f761fe156fe735259 (diff) | |
download | online_test-2fbf184c2f18eb52bc4a6c6c6a9168572d2fd23c.tar.gz online_test-2fbf184c2f18eb52bc4a6c6c6a9168572d2fd23c.tar.bz2 online_test-2fbf184c2f18eb52bc4a6c6c6a9168572d2fd23c.zip |
Merge pull request #751 from CruiseDevice/partial_grade_user
Show max marks for all attempts in answerpaper
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 aa0b916..87454a6 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -2323,6 +2323,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): |