From f2309db2490ec0bd5b910c5acd1dc18026a14306 Mon Sep 17 00:00:00 2001 From: Prabhu Ramachandran Date: Mon, 21 Nov 2011 17:45:22 +0530 Subject: ENH: Added an active attribute to Questions. This allows us to enable/disable questions in a question paper. Only questions that are active are used to create a question paper. I've also modified the load_exam/load_questions_xml to deactivate rather than delete old questions. --- exam/models.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'exam/models.py') diff --git a/exam/models.py b/exam/models.py index 09529b9..fb06576 100644 --- a/exam/models.py +++ b/exam/models.py @@ -15,9 +15,11 @@ class Profile(models.Model): ################################################################################ class Question(models.Model): """A question in the database.""" - # An optional one-line summary of the question. + + # A one-line summary of the question. summary = models.CharField(max_length=256) - # The question text. + + # The question text, should be valid HTML. description = models.TextField() # Number of points for the question. @@ -26,7 +28,11 @@ class Question(models.Model): # Test cases for the question in the form of code that is run. # This is simple Python code. test = models.TextField() - + + # Is this question active or not. If it is inactive it will not be used + # when creating a QuestionPaper. + active = models.BooleanField(default=True) + def __unicode__(self): return self.summary -- cgit