summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
authorCruiseDevice2019-02-13 15:50:00 +0530
committerCruiseDevice2019-02-18 16:45:17 +0530
commited532c50d3f5c61ba3ce39d07c8c0c21e6c9c171 (patch)
treeeef34dda8c184f7070aedbec402f7f9b00db030e /yaksh
parentb71b517173cac8b4f266f36d0cbc918551b3ee73 (diff)
downloadonline_test-ed532c50d3f5c61ba3ce39d07c8c0c21e6c9c171.tar.gz
online_test-ed532c50d3f5c61ba3ce39d07c8c0c21e6c9c171.tar.bz2
online_test-ed532c50d3f5c61ba3ce39d07c8c0c21e6c9c171.zip
Add Preview QuestionPaper button in Quiz view page
Diffstat (limited to 'yaksh')
-rw-r--r--yaksh/templates/exam.html9
-rw-r--r--yaksh/views.py2
2 files changed, 9 insertions, 2 deletions
diff --git a/yaksh/templates/exam.html b/yaksh/templates/exam.html
index 29ad167..0b292bb 100644
--- a/yaksh/templates/exam.html
+++ b/yaksh/templates/exam.html
@@ -98,6 +98,15 @@
{% endfor %}
</tbody>
</table>
+ <br>
+ {% if user.profile.is_moderator %}
+ {% if quiz.questionpaper_set.get %}
+ <a href="{{URL_ROOT}}/exam/manage/preview_questionpaper/{{quiz.questionpaper_set.get.id}}" class="btn btn-primary active btn-xs" target="_blank">
+ View Question Paper
+ </a>
+ <br>
+ {% endif %}
+ {% endif %}
</div> <!--end of sidebar -->
<a href="#sidebar" data-toggle="collapse" id="sidebaricon"><i class="fa fa-navicon fa-lg"></i></a>
diff --git a/yaksh/views.py b/yaksh/views.py
index 6c7a12e..bcaaf5f 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -2822,8 +2822,6 @@ 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')