summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
authoradityacp2020-09-23 19:57:14 +0530
committeradityacp2020-09-23 19:57:14 +0530
commit8444e93ac160f64d03525940f738ff5aa52cd20a (patch)
treea67b0e0d5649af9e8b1bdf004907f3e9a0d1337b /yaksh/models.py
parent7589f9838ac5080a5f2fb5f9c92522bc722ab80b (diff)
parentdb5ea3d7456d77c4e74538d5db120fbdfa9613e9 (diff)
downloadonline_test-8444e93ac160f64d03525940f738ff5aa52cd20a.tar.gz
online_test-8444e93ac160f64d03525940f738ff5aa52cd20a.tar.bz2
online_test-8444e93ac160f64d03525940f738ff5aa52cd20a.zip
Fix conflicts
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 8db054d..6a6fe12 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -2250,7 +2250,14 @@ class AnswerPaper(models.Model):
return questions
def set_extra_time(self, time=0):
- self.extra_time = time
+ now = timezone.now()
+ self.extra_time += time
+ if self.status == 'completed' and self.end_time < now:
+ self.extra_time = time
+ quiz_time = self.question_paper.quiz.duration
+ self.start_time = now - timezone.timedelta(minutes=quiz_time)
+ self.end_time = now + timezone.timedelta(minutes=time)
+ self.status = 'inprogress'
self.save()
def time_left(self):