summaryrefslogtreecommitdiff
path: root/exam
diff options
context:
space:
mode:
authorPrabhu Ramachandran2011-11-27 01:00:25 +0530
committerPrabhu Ramachandran2011-11-27 01:00:25 +0530
commitca63bd41c8ae023e30eed73e5afd878d7bba4e96 (patch)
tree8a1e301fafa004c0624a00736fb7cbb3696c9722 /exam
parent9b7c400f915e83492826be272d5201abfe1779f1 (diff)
downloadonline_test-ca63bd41c8ae023e30eed73e5afd878d7bba4e96.tar.gz
online_test-ca63bd41c8ae023e30eed73e5afd878d7bba4e96.tar.bz2
online_test-ca63bd41c8ae023e30eed73e5afd878d7bba4e96.zip
BUG: Was not selecting QP for active Quiz.
Diffstat (limited to 'exam')
-rw-r--r--exam/views.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/exam/views.py b/exam/views.py
index 98fe7c7..892b35f 100644
--- a/exam/views.py
+++ b/exam/views.py
@@ -159,7 +159,7 @@ def question(request, q_id):
return my_redirect('/exam/login/')
q = get_object_or_404(Question, pk=q_id)
try:
- paper = QuestionPaper.objects.get(user=request.user)
+ paper = QuestionPaper.objects.get(user=request.user, quiz__active=True)
except QuestionPaper.DoesNotExist:
return my_redirect('/exam/start')
if not paper.quiz.active:
@@ -189,7 +189,7 @@ def check(request, q_id):
if not user.is_authenticated():
return my_redirect('/exam/login/')
question = get_object_or_404(Question, pk=q_id)
- paper = QuestionPaper.objects.get(user=user)
+ paper = QuestionPaper.objects.get(user=user, quiz__active=True)
answer = request.POST.get('answer')
skip = request.POST.get('skip', None)