-
Notifications
You must be signed in to change notification settings - Fork 0
/
f.py~
41 lines (39 loc) · 2.31 KB
/
f.py~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from django.db import models
from django.contrib.auth.models import User
class Players(models.Model):
pname1=models.CharField(max_length=100,blank = True,null=True)
phone1=models.CharField(max_length=100, blank=False,null=False)
email1=models.EmailField(max_length=100,blank=False,null=False)
pname2=models.CharField(max_length=100)
phone2=models.CharField(max_length=100)
email2=models.EmailField(max_length=100)
level = models.BooleanField(default = 1)#0 for junior 1 for senior
total_score = models.IntegerField(default = 0)
fibonacci_status = models.BooleanField(default=0) #fibonacci lifeline currently in use or not
fibonacci_marks = models.IntegerField(default = 0) #to calculate the total marks to be awarded
f_counter = models.IntegerField(default = 3) #number of times fibonacci used
coins_status = models.IntegerField(default = 0,) #to update the number of coins
skips = models.IntegerField(default = 0) #number of skips
coins=models.CharField(default=3,max_length=10) #number of coins
user=models.OneToOneField(User,null=True,blank=True)
"""def __str__(self):
return(self.pname1,self.phone1,self.email1,self.pname2,self.phone2,self.email2,self.level,self.total_score,self.fibonacci_status,self.fibonacci_marks,self.f_counter,self.coins_status,self.skips,self.coins,self.user)
"""##############################################################################################################
class Question(models.Model):
question=models.TextField(max_length = 1000000)
select_option = models.CharField(max_length = 500)
#option_b = models.CharField(max_length = 500)
#option_c = models.CharField(max_length = 500)
#option_d = models.CharField(max_length = 500)
correct_option=models.CharField(max_length = 1) #Doubt
level = models.BooleanField(default = 0)#0 for junior 1 for senior
"""def __str__(self):
return(self.question,self.option_a,self.option_b,self.option_c,self.option_d,self.level)
"""
class Qatempt(models.Model):
status = models.BooleanField()
user = models.ForeignKey(User)
question = models.ForeignKey(Question)
def __unicode__(self):
return(self.status,self.user,self.question)
#############################################################################################################