From b41cf01f58544a6c71c16bab1854142a3ffc8e03 Mon Sep 17 00:00:00 2001 From: CruiseDevice Date: Fri, 28 Aug 2020 18:30:42 +0530 Subject: Show max marks for all attempts in answerpaper - Latest attempt marks were shown in the answerpaper, which made it difficult to analyze the paper. This PR fixes the issue and the best marks of all the attempt are provided. --- yaksh/models.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'yaksh/models.py') 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): -- cgit From a80fef3789d970d3db17d72f761fe156fe735259 Mon Sep 17 00:00:00 2001 From: CruiseDevice Date: Tue, 1 Sep 2020 11:54:01 +0530 Subject: Fix tests, Fix PEP8 --- yaksh/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'yaksh/models.py') diff --git a/yaksh/models.py b/yaksh/models.py index 0456b52..eeae4af 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -2311,8 +2311,8 @@ class AnswerPaper(models.Model): q_a[question].append({ 'marks': max([ answer['answer'].marks - for answer in answers - if question == answer['answer'].question + for answer in answers + if question == answer['answer'].question ]) }) -- cgit From 4f09013487e17e40b8fd14a3e4c574702c302fbb Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Thu, 3 Sep 2020 17:31:21 +0530 Subject: Fetch only distinct answered questions --- yaksh/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'yaksh/models.py') diff --git a/yaksh/models.py b/yaksh/models.py index 6542daa..1fee87b 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -2316,7 +2316,7 @@ class AnswerPaper(models.Model): return self.questions.filter(active=True) def get_questions_answered(self): - return self.questions_answered.all() + return self.questions_answered.all().distinct() def get_questions_unanswered(self): return self.questions_unanswered.all() -- cgit From 89d7fb87fdacef4a15f36188938ab7044350f44e Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Fri, 11 Sep 2020 10:44:08 +0530 Subject: Multiple changes - Increase max_limit for files names in AssignmentUploads - Add email display to Added Teacher/TA screen --- yaksh/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'yaksh/models.py') diff --git a/yaksh/models.py b/yaksh/models.py index 84cad1e..d051e68 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -2531,7 +2531,7 @@ class AssignmentUploadManager(models.Manager): class AssignmentUpload(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) assignmentQuestion = models.ForeignKey(Question, on_delete=models.CASCADE) - assignmentFile = models.FileField(upload_to=get_assignment_dir) + assignmentFile = models.FileField(upload_to=get_assignment_dir, max_length=255) question_paper = models.ForeignKey(QuestionPaper, blank=True, null=True, on_delete=models.CASCADE) course = models.ForeignKey(Course, null=True, blank=True, -- cgit