summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
authorprathamesh2016-08-31 01:32:16 +0530
committerprathamesh2016-08-31 01:32:16 +0530
commit11dec9deba7120f85d3d2b47cfd31fca8587bbbc (patch)
tree22c99d7a50f193b9a206732a05d246921f487cf6 /yaksh/views.py
parentc0909251ecffcdc0df34bb9ad4a90994708c3a5c (diff)
downloadonline_test-11dec9deba7120f85d3d2b47cfd31fca8587bbbc.tar.gz
online_test-11dec9deba7120f85d3d2b47cfd31fca8587bbbc.tar.bz2
online_test-11dec9deba7120f85d3d2b47cfd31fca8587bbbc.zip
Added testcases for model and view.
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index 9e0edac..9d1ab99 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -1279,7 +1279,7 @@ def test_quiz(request, mode, quiz_id):
def view_answerpaper(request, questionpaper_id):
user = request.user
quiz = get_object_or_404(QuestionPaper, pk=questionpaper_id).quiz
- if quiz.view_answerpaper:
+ if quiz.view_answerpaper and user in quiz.course.students.all():
data = AnswerPaper.objects.get_user_data(user, questionpaper_id)
context = {'data': data, 'quiz': quiz}
return my_render_to_response('yaksh/view_answerpaper.html', context)