From 40c43990ce2b352b85711beef2763aa22763faa9 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Tue, 4 Oct 2016 18:34:00 +0530 Subject: Hide questions instead of deletion --- yaksh/models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'yaksh/models.py') diff --git a/yaksh/models.py b/yaksh/models.py index f098cd2..432f25e 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -271,7 +271,7 @@ class Question(models.Model): return json.dumps(question_data) def dump_questions(self, question_ids, user): - questions = Question.objects.filter(id__in=question_ids, user_id=user.id) + questions = Question.objects.filter(id__in=question_ids, user_id=user.id, active=True) questions_dict = [] zip_file_name = string_io() zip_file = zipfile.ZipFile(zip_file_name, "a") @@ -764,8 +764,9 @@ class AnswerPaperManager(models.Manager): attempt_number) questions = self.get_all_questions(questionpaper_id, attempt_number) all_questions = Question.objects.filter( - id__in=set(questions) - ).order_by('type') + id__in=set(questions), + active=True + ).order_by('type') for question in all_questions: if question.id in questions_answered: question_stats[question] = [questions_answered[question.id], -- cgit