diff options
author | Prabhu Ramachandran | 2011-11-21 17:45:22 +0530 |
---|---|---|
committer | Prabhu Ramachandran | 2011-11-21 17:45:22 +0530 |
commit | f2309db2490ec0bd5b910c5acd1dc18026a14306 (patch) | |
tree | 0cd0f97c1d65bb7dd6d79f493b781a7fd4aba504 /exam/views.py | |
parent | 4df6fb51be0661aaf0f852e4f2bedc2bb72e1eef (diff) | |
download | online_test-f2309db2490ec0bd5b910c5acd1dc18026a14306.tar.gz online_test-f2309db2490ec0bd5b910c5acd1dc18026a14306.tar.bz2 online_test-f2309db2490ec0bd5b910c5acd1dc18026a14306.zip |
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.
Diffstat (limited to 'exam/views.py')
-rw-r--r-- | exam/views.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/exam/views.py b/exam/views.py index 729b1e6..b880c4d 100644 --- a/exam/views.py +++ b/exam/views.py @@ -133,7 +133,7 @@ def start(request): | stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR \ | stat.S_IRGRP | stat.S_IWGRP | stat.S_IXGRP) - questions = [ str(_.id) for _ in Question.objects.all() ] + questions = [ str(_.id) for _ in Question.objects.filter(active=True) ] random.shuffle(questions) new_paper.questions = "|".join(questions) |