summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
authorCruiseDevice2019-02-14 15:05:42 +0530
committerCruiseDevice2019-02-18 16:45:17 +0530
commit89c0367ba2364319e6febab191fd46b822b4f6bc (patch)
treea963a054c7c63bc1165bbd650a779fff195f7abc /yaksh/views.py
parented532c50d3f5c61ba3ce39d07c8c0c21e6c9c171 (diff)
downloadonline_test-89c0367ba2364319e6febab191fd46b822b4f6bc.tar.gz
online_test-89c0367ba2364319e6febab191fd46b822b4f6bc.tar.bz2
online_test-89c0367ba2364319e6febab191fd46b822b4f6bc.zip
Add Preview Question Paper button in add_quiz template
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index bcaaf5f..6c7a12e 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -2822,6 +2822,8 @@ def _update_course_percent(course, user):
@email_verified
def preview_questionpaper(request, questionpaper_id):
user = request.user
+ if not is_moderator(user):
+ raise Http404('You are not allowed to view this page!')
paper = QuestionPaper.objects.get(id=questionpaper_id)
if not paper.quiz.creator == user:
raise Http404('This questionpaper does not belong to you')