diff options
author | ankitjavalkar | 2016-10-07 16:04:25 +0530 |
---|---|---|
committer | ankitjavalkar | 2016-10-13 15:12:33 +0530 |
commit | 3d1d4a50524301d03526e4857844d0e6e4536527 (patch) | |
tree | 5fe8c99eb9a52451bb0314a22bd8983c6ca2234d /yaksh/models.py | |
parent | 40c43990ce2b352b85711beef2763aa22763faa9 (diff) | |
download | online_test-3d1d4a50524301d03526e4857844d0e6e4536527.tar.gz online_test-3d1d4a50524301d03526e4857844d0e6e4536527.tar.bz2 online_test-3d1d4a50524301d03526e4857844d0e6e4536527.zip |
Minor fixes: Hide question instead of deletion
Diffstat (limited to 'yaksh/models.py')
-rw-r--r-- | yaksh/models.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/yaksh/models.py b/yaksh/models.py index 432f25e..60c4349 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -623,8 +623,7 @@ class QuestionPaper(models.Model): def _get_questions_for_answerpaper(self): """ Returns fixed and random questions for the answer paper""" - questions = [] - questions = list(self.fixed_questions.all()) + questions = list(self.fixed_questions.filter(active=True)) for question_set in self.random_questions.all(): questions += question_set.get_random_questions() return questions @@ -993,7 +992,7 @@ class AnswerPaper(models.Model): return q_a def get_questions(self): - return self.questions.all() + return self.questions.filter(active=True) def get_questions_answered(self): return self.questions_answered.all() |