diff options
Diffstat (limited to 'yaksh')
-rw-r--r-- | yaksh/templates/yaksh/preview_questionpaper.html (renamed from yaksh/templates/yaksh/download_questionpaper.html) | 4 | ||||
-rw-r--r-- | yaksh/urls.py | 3 | ||||
-rw-r--r-- | yaksh/views.py | 4 |
3 files changed, 9 insertions, 2 deletions
diff --git a/yaksh/templates/yaksh/download_questionpaper.html b/yaksh/templates/yaksh/preview_questionpaper.html index 8b04874..411e4a6 100644 --- a/yaksh/templates/yaksh/download_questionpaper.html +++ b/yaksh/templates/yaksh/preview_questionpaper.html @@ -24,6 +24,10 @@ </div> <div class="panel-body"> <h5><u>Question:</u></h5> <strong>{{ question.description|safe }}</strong> + <br/><b>Answer:</b><br/> + {% if question.type == "code" %} + <div class="well">{{ question.snippet }}<br/></div> + {% endif %} {% if question.type == "mcq" or question.type == "mcc" %} <h5> <u>Choices:</u></h5> {% for testcase in question.get_test_cases %} diff --git a/yaksh/urls.py b/yaksh/urls.py index 3120705..b4da1c0 100644 --- a/yaksh/urls.py +++ b/yaksh/urls.py @@ -141,6 +141,7 @@ urlpatterns = [ url(r'^manage/courses/download_yaml_template/', views.download_yaml_template, name="download_yaml_template"), <<<<<<< HEAD +<<<<<<< HEAD url(r'^manage/download_sample_csv/', views.download_sample_csv, name="download_sample_csv"), url(r'^manage/courses/edit_lesson/$', @@ -175,4 +176,6 @@ urlpatterns = [ views.course_status, name="course_status"), url(r'^manage/download_questionpaper/(?P<questionpaper_id>\d+)/$', views.download_questionpaper, name="download_questionpaper"), + url(r'^manage/preview_questionpaper/(?P<questionpaper_id>\d+)/$', + views.preview_questionpaper, name="preview_questionpaper"), ] diff --git a/yaksh/views.py b/yaksh/views.py index 0dab227..94335a2 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -2749,7 +2749,7 @@ def _update_unit_status(course_id, user, unit): @login_required @email_verified -def download_questionpaper(request, questionpaper_id): +def preview_questionpaper(request, questionpaper_id): user = request.user if not is_moderator(user): raise Http404('You are not allowed to view this page!') @@ -2760,5 +2760,5 @@ def download_questionpaper(request, questionpaper_id): } return my_render_to_response( - 'yaksh/download_questionpaper.html', context + 'yaksh/preview_questionpaper.html', context ) |