author | nishanth |
Tue, 20 Apr 2010 23:12:15 +0530 | |
changeset 22 | fe197c0c9903 |
parent 16 | ad51f38d0339 |
child 23 | f57c30096b51 |
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) |
|
15 | 9 |
profession = models.CharField(max_length=20,help_text="(Ex: Faculty, Student etc.)") |
12 | 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() |
|
22
fe197c0c9903
modified the questionbank model and changed in seed_db accordingly
nishanth
parents:
16
diff
changeset
|
19 |
code = models.TextField() |
fe197c0c9903
modified the questionbank model and changed in seed_db accordingly
nishanth
parents:
16
diff
changeset
|
20 |
options = models.TextField() |
12 | 21 |
time_limit = models.PositiveSmallIntegerField() |
22 |
expected_ans = models.TextField() |
|
23 |
||
24 |
class Answer(models.Model): |
|
25 |
""" A model for holding answers submitted by users. |
|
26 |
""" |
|
27 |
||
14
ea7d372bfbff
implemented more constraints on the register for test page
nishanth
parents:
13
diff
changeset
|
28 |
question = models.ForeignKey(QuestionBank) |
12 | 29 |
submitted_ans = models.TextField() |
14
ea7d372bfbff
implemented more constraints on the register for test page
nishanth
parents:
13
diff
changeset
|
30 |
is_correct = models.BooleanField() |
12 | 31 |
|
32 |
class Quiz(models.Model): |
|
33 |
""" A model to hold the proceeding of a quiz. |
|
34 |
""" |
|
35 |
||
36 |
user = models.ForeignKey(User) |
|
37 |
event = models.ForeignKey(Event) |
|
13 | 38 |
user_ip = models.CharField(max_length=15) |
16 | 39 |
key = models.CharField(max_length=10) |
12 | 40 |
|
41 |
quiz_num = models.CharField(max_length=2) |
|
42 |
que_remaining = models.CharField(max_length=100) |
|
43 |
que_answered = models.ManyToManyField(Answer) |
|
15 | 44 |