From 81e119899ebc04b53ac9c15c66286c8dbc08726b Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Thu, 9 Jul 2015 16:19:24 +0530 Subject: Add Date-Time limits for exams --- testapp/yaksh_app/models.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'testapp/yaksh_app/models.py') diff --git a/testapp/yaksh_app/models.py b/testapp/yaksh_app/models.py index 9e37ef5..62ac9bc 100644 --- a/testapp/yaksh_app/models.py +++ b/testapp/yaksh_app/models.py @@ -160,7 +160,14 @@ class Quiz(models.Model): """ # The start date of the quiz. - start_date = models.DateField("Date of the quiz") + start_date_time = models.DateTimeField("Start Date and Time of the quiz", + default=datetime.datetime.now(), + null=True) + + # The end date and time of the quiz + end_date_time = models.DateTimeField("End Date and Time of the quiz", + default=datetime.datetime(2199, 1, 1, 0, 0, 0, 0), + null=True) # This is always in minutes. duration = models.IntegerField("Duration of quiz in minutes", default=20) @@ -192,7 +199,7 @@ class Quiz(models.Model): def __unicode__(self): desc = self.description or 'Quiz' - return '%s: on %s for %d minutes' % (desc, self.start_date, + return '%s: on %s for %d minutes' % (desc, self.start_date_time, self.duration) -- cgit