summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
authorankitjavalkar2020-09-29 17:27:10 +0530
committerGitHub2020-09-29 17:27:10 +0530
commitd2a125668bccad5edca9c07368a58946a136e5ba (patch)
treebfde45df2ea0cff7b9d234756a4b0f04a3897957 /yaksh/models.py
parent0af9b77e63aa02a29cc8b150efe6f9ef86c8d344 (diff)
parent668f3ab5b74977df1793393d596f489d15e2e830 (diff)
downloadonline_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.py2
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()