author | nishanth |
Tue, 20 Apr 2010 21:06:54 +0530 | |
changeset 16 | ad51f38d0339 |
parent 15 | 99af908a4174 |
child 22 | fe197c0c9903 |
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() |
|
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) |
16 | 38 |
key = models.CharField(max_length=10) |
12 | 39 |
|
40 |
quiz_num = models.CharField(max_length=2) |
|
41 |
que_remaining = models.CharField(max_length=100) |
|
42 |
que_answered = models.ManyToManyField(Answer) |
|
15 | 43 |