diff options
author | FOSSEE Git User | 2018-10-10 19:32:10 +0530 |
---|---|---|
committer | FOSSEE Git User | 2018-10-10 19:32:10 +0530 |
commit | 4099238c0bc191ab6ad0b236a1f45d530559982d (patch) | |
tree | e4e2238e3927951fcc825504aead2ef6737090ba /website/models.py | |
parent | fdf46a6dd8d33d96f5b3d0e032bcfa153b6155a5 (diff) | |
parent | df5b673cfb13f4ce66146723384172ee981a6a07 (diff) | |
download | nccps-2018-4099238c0bc191ab6ad0b236a1f45d530559982d.tar.gz nccps-2018-4099238c0bc191ab6ad0b236a1f45d530559982d.tar.bz2 nccps-2018-4099238c0bc191ab6ad0b236a1f45d530559982d.zip |
Merge branch 'master' of https://github.com/FOSSEE/nccps-2018
Diffstat (limited to 'website/models.py')
-rw-r--r-- | website/models.py | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/website/models.py b/website/models.py index 7906960..2481177 100644 --- a/website/models.py +++ b/website/models.py @@ -1,9 +1,12 @@ from django.db import models from django.contrib.auth.models import User +from django.utils import timezone +from datetime import datetime, timedelta from social.apps.django_app.default.models import UserSocialAuth from nccps2018 import settings from django.core.validators import RegexValidator import os +import pytz position_choices = ( ("student", "Student"), @@ -98,7 +101,26 @@ class Profile(models.Model): self.user.last_name, self.user.email ) - - + + +class Question(models.Model): + + question = models.TextField() + option_1 = models.CharField(max_length=255) + option_2 = models.CharField(max_length=255) + option_3 = models.CharField(max_length=255) + option_4 = models.CharField(max_length=255) + correct_answer = models.CharField(max_length=255, + help_text='please write it as written in the option \ + above(Case-sensitive)') -
\ No newline at end of file + # The date for the question. + question_day = models.DateField() + + +class AnswerPaper(models.Model): + + participant = models.ForeignKey(Profile, on_delete=models.CASCADE) + answered_q = models.ForeignKey(Question, on_delete=models.CASCADE) + validate_ans = models.BooleanField() + date = models.DateTimeField(auto_now=True)
\ No newline at end of file |