From ba736ced194434e77909a178463e4cb41d6ee367 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Mon, 28 Sep 2020 18:11:08 +0530 Subject: Re calculate and save total marks of paper --- yaksh/models.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'yaksh/models.py') diff --git a/yaksh/models.py b/yaksh/models.py index dc08307..1b76eed 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -1769,6 +1769,8 @@ class QuestionPaper(models.Model): for question in questions: marks += question.points for question_set in self.random_questions.all(): + question_set.marks = question_set.questions.first().points + question_set.save() marks += question_set.marks * question_set.num_questions self.total_marks = marks self.save() -- cgit