summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrabhu Ramachandran2017-03-08 15:59:59 +0530
committerGitHub2017-03-08 15:59:59 +0530
commit69951e247ea02196ec6e65324f77898d9ea389b3 (patch)
tree8718d260500a4c35d4ab6c97234eb0c3f1a4e4a7
parent63d2febfdf37c538e3503338409fba050667c126 (diff)
parent7f815f58c6af4b5020fba0dc490c8e7f9d328589 (diff)
downloadonline_test-69951e247ea02196ec6e65324f77898d9ea389b3.tar.gz
online_test-69951e247ea02196ec6e65324f77898d9ea389b3.tar.bz2
online_test-69951e247ea02196ec6e65324f77898d9ea389b3.zip
Merge pull request #235 from ankitjavalkar/fix-del-questions
Hide inactive/deleted questions in Questionpaper creation and question filter
-rw-r--r--yaksh/views.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index 1089067..63653e6 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -768,7 +768,7 @@ def ajax_questions_filter(request):
"""Ajax call made when filtering displayed questions."""
user = request.user
- filter_dict = {"user_id": user.id}
+ filter_dict = {"user_id": user.id, "active": True}
question_type = request.POST.get('question_type')
marks = request.POST.get('marks')
language = request.POST.get('language')
@@ -792,7 +792,10 @@ def _get_questions(user, question_type, marks):
if question_type is None and marks is None:
return None
if question_type:
- questions = Question.objects.filter(type=question_type, user=user)
+ questions = Question.objects.filter(type=question_type,
+ user=user,
+ active=True
+ )
if marks:
questions = questions.filter(points=marks)
return questions