From 7de8141a6aa4f7039e8b1eb4f2b1e2db126e902e Mon Sep 17 00:00:00 2001 From: Prabhu Ramachandran Date: Mon, 21 Nov 2011 02:54:14 +0530 Subject: Deactivate old quiz instead of deleting. When loading a new exam we don't delete the old quiz. --- exam/management/commands/load_exam.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit