summaryrefslogtreecommitdiff
path: root/website/models.py
diff options
context:
space:
mode:
authorAkshen2018-10-10 10:50:20 +0530
committerAkshen2018-10-10 10:50:20 +0530
commitbed6d3bec534ec5cd207e1fa00580749aaa14112 (patch)
tree8c13a8cd762971e86bb39a95029eb2a16784ded0 /website/models.py
parent63bde864f757953faed546a537bc8ea77d3e3de2 (diff)
downloadnccps-2018-bed6d3bec534ec5cd207e1fa00580749aaa14112.tar.gz
nccps-2018-bed6d3bec534ec5cd207e1fa00580749aaa14112.tar.bz2
nccps-2018-bed6d3bec534ec5cd207e1fa00580749aaa14112.zip
Add DWSIM Online Quiz
- Moderator can add, edit questions and view leaderboard - Participant can take quiz specified for that day
Diffstat (limited to 'website/models.py')
-rw-r--r--website/models.py28
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