summaryrefslogtreecommitdiff
path: root/testapp/exam/models.py
diff options
context:
space:
mode:
authorhardythe12012-04-02 18:04:43 +0530
committerhardythe12012-04-02 18:04:43 +0530
commitc0fcc1181e209192f6d11f2ca521e55e33a4ead7 (patch)
tree576b100053a4ef35d4e686ce198f2882d98efbb2 /testapp/exam/models.py
parent64b38d3365f1d65132942fce6e29fed7da076bba (diff)
downloadonline_test-c0fcc1181e209192f6d11f2ca521e55e33a4ead7.tar.gz
online_test-c0fcc1181e209192f6d11f2ca521e55e33a4ead7.tar.bz2
online_test-c0fcc1181e209192f6d11f2ca521e55e33a4ead7.zip
Question Paper generator changes
Diffstat (limited to 'testapp/exam/models.py')
-rw-r--r--testapp/exam/models.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/testapp/exam/models.py b/testapp/exam/models.py
index da45e7d..ad3dad8 100644
--- a/testapp/exam/models.py
+++ b/testapp/exam/models.py
@@ -105,9 +105,13 @@ class Quiz(models.Model):
desc = self.description or 'Quiz'
return '%s: on %s for %d minutes'%(desc, self.start_date, self.duration)
-
################################################################################
class QuestionPaper(models.Model):
+ quiz = models.ForeignKey(Quiz)
+ questions = models.ManyToManyField(Question)
+
+################################################################################
+class AnswerPaper(models.Model):
"""A question paper for a student -- one per student typically.
"""
# The user taking this question paper.
@@ -118,21 +122,14 @@ class QuestionPaper(models.Model):
profile = models.ForeignKey(Profile)
# The Quiz to which this question paper is attached to.
- quiz = models.ForeignKey(Quiz)
+ question_paper = models.ForeignKey(QuestionPaper)
# The time when this paper was started by the user.
start_time = models.DateTimeField()
# User's IP which is logged.
user_ip = models.CharField(max_length=15)
- # Unused currently.
- key = models.CharField(max_length=10)
- # used to allow/stop a user from retaking the question paper.
- active = models.BooleanField(default = True)
-
- # The questions (a list of ids separated by '|')
- questions = models.CharField(max_length=128)
# The questions successfully answered (a list of ids separated by '|')
questions_answered = models.CharField(max_length=128)