diff options
author | ankitjavalkar | 2016-10-04 18:34:00 +0530 |
---|---|---|
committer | ankitjavalkar | 2016-10-13 15:12:07 +0530 |
commit | 40c43990ce2b352b85711beef2763aa22763faa9 (patch) | |
tree | cc2c9e5c2446e9813c8f2b14cf70a7ec451e83fd /yaksh/models.py | |
parent | 9b60cc7b8f000f96d5f818f759a6c63d5a26f239 (diff) | |
download | online_test-40c43990ce2b352b85711beef2763aa22763faa9.tar.gz online_test-40c43990ce2b352b85711beef2763aa22763faa9.tar.bz2 online_test-40c43990ce2b352b85711beef2763aa22763faa9.zip |
Hide questions instead of deletion
Diffstat (limited to 'yaksh/models.py')
-rw-r--r-- | yaksh/models.py | 7 |
1 files changed, 4 insertions, 3 deletions
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], |