diff options
author | ankitjavalkar | 2020-09-29 17:27:10 +0530 |
---|---|---|
committer | GitHub | 2020-09-29 17:27:10 +0530 |
commit | d2a125668bccad5edca9c07368a58946a136e5ba (patch) | |
tree | bfde45df2ea0cff7b9d234756a4b0f04a3897957 /yaksh/models.py | |
parent | 0af9b77e63aa02a29cc8b150efe6f9ef86c8d344 (diff) | |
parent | 668f3ab5b74977df1793393d596f489d15e2e830 (diff) | |
download | online_test-d2a125668bccad5edca9c07368a58946a136e5ba.tar.gz online_test-d2a125668bccad5edca9c07368a58946a136e5ba.tar.bz2 online_test-d2a125668bccad5edca9c07368a58946a136e5ba.zip |
Merge pull request #771 from ankitjavalkar/recalc-paper-marks
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() |