diff options
author | ankitjavalkar | 2020-09-28 18:11:08 +0530 |
---|---|---|
committer | ankitjavalkar | 2020-09-28 18:11:08 +0530 |
commit | ba736ced194434e77909a178463e4cb41d6ee367 (patch) | |
tree | 5da9f9b55d6408e598d54078f466985525020a7e /yaksh/models.py | |
parent | db5ea3d7456d77c4e74538d5db120fbdfa9613e9 (diff) | |
download | online_test-ba736ced194434e77909a178463e4cb41d6ee367.tar.gz online_test-ba736ced194434e77909a178463e4cb41d6ee367.tar.bz2 online_test-ba736ced194434e77909a178463e4cb41d6ee367.zip |
Re calculate and save total marks of paper
Diffstat (limited to 'yaksh/models.py')
-rw-r--r-- | yaksh/models.py | 2 |
1 files changed, 2 insertions, 0 deletions
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() |