diff options
author | ankitjavalkar | 2017-11-07 15:49:35 +0530 |
---|---|---|
committer | ankitjavalkar | 2018-03-06 11:39:06 +0530 |
commit | 7a892b8c664a69bd054efc6c662281e839546b7d (patch) | |
tree | 426fc4d65d62e99c9609c1fe0b32c54bae134571 | |
parent | 91fa9c6a40e16f43d935db9641b6833605afc1e8 (diff) | |
download | online_test-7a892b8c664a69bd054efc6c662281e839546b7d.tar.gz online_test-7a892b8c664a69bd054efc6c662281e839546b7d.tar.bz2 online_test-7a892b8c664a69bd054efc6c662281e839546b7d.zip |
- Change function names and urls to 'preview_questionpaper'
- Add snippet to the questionpaper preview
-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 ) |