author | nishanth |
Tue, 20 Apr 2010 15:44:43 +0530 | |
changeset 14 | ea7d372bfbff |
parent 13 | ad193c5014b2 |
child 15 | 99af908a4174 |
permissions | -rw-r--r-- |
12 | 1 |
from django.db import models |
2 |
from django.contrib.auth.models import User |
|
3 |
||
4 |
from offline.event.models import Event |
|
5 |
||
6 |
class Profile(models.Model): |
|
7 |
||
8 |
user = models.ForeignKey(User) |
|
9 |
profession = models.CharField(max_length=20,help_text="(Ex: Faculty,Student etc.)") |
|
10 |
affiliated_to = models.CharField(max_length=100, verbose_name="College/Company") |
|
11 |
||
12 |
class QuestionBank(models.Model): |
|
13 |
""" A model for holding the database of questions. |
|
14 |
""" |
|
15 |
||
16 |
quiz_num = models.CharField(max_length=2) |
|
17 |
||
18 |
description = models.TextField() |
|
19 |
type = models.CharField(max_length=1) |
|
20 |
time_limit = models.PositiveSmallIntegerField() |
|
21 |
expected_ans = models.TextField() |
|
22 |
||
23 |
class Answer(models.Model): |
|
24 |
""" A model for holding answers submitted by users. |
|
25 |
""" |
|
26 |
||
14
ea7d372bfbff
implemented more constraints on the register for test page
nishanth
parents:
13
diff
changeset
|
27 |
question = models.ForeignKey(QuestionBank) |
12 | 28 |
submitted_ans = models.TextField() |
14
ea7d372bfbff
implemented more constraints on the register for test page
nishanth
parents:
13
diff
changeset
|
29 |
is_correct = models.BooleanField() |
12 | 30 |
|
31 |
class Quiz(models.Model): |
|
32 |
""" A model to hold the proceeding of a quiz. |
|
33 |
""" |
|
34 |
||
35 |
user = models.ForeignKey(User) |
|
36 |
event = models.ForeignKey(Event) |
|
13 | 37 |
user_ip = models.CharField(max_length=15) |
12 | 38 |
|
39 |
quiz_num = models.CharField(max_length=2) |
|
40 |
que_remaining = models.CharField(max_length=100) |
|
41 |
que_answered = models.ManyToManyField(Answer) |