summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrabhu Ramachandran2011-11-21 02:54:14 +0530
committerPrabhu Ramachandran2011-11-21 02:54:14 +0530
commit7de8141a6aa4f7039e8b1eb4f2b1e2db126e902e (patch)
tree261344384454e5b2ec701b84b2de1791ad738941
parent60a68e7d389a9a86496a215de3898b0e7b79fa14 (diff)
downloadonline_test-7de8141a6aa4f7039e8b1eb4f2b1e2db126e902e.tar.gz
online_test-7de8141a6aa4f7039e8b1eb4f2b1e2db126e902e.tar.bz2
online_test-7de8141a6aa4f7039e8b1eb4f2b1e2db126e902e.zip
Deactivate old quiz instead of deleting.
When loading a new exam we don't delete the old quiz.
-rw-r--r--exam/management/commands/load_exam.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/exam/management/commands/load_exam.py b/exam/management/commands/load_exam.py
index 5b8aa81..157a94a 100644
--- a/exam/management/commands/load_exam.py
+++ b/exam/management/commands/load_exam.py
@@ -12,8 +12,10 @@ def clear_exam():
for question in Question.objects.all():
question.delete()
+ # Deactivate old quizzes.
for quiz in Quiz.objects.all():
- quiz.delete()
+ quiz.active = False
+ quiz.save()
def load_exam(filename):
"""Load questions and quiz from the given Python file. The Python file