From c118c7eff7abaeba18f7c375828d2e022d21cb9f Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Fri, 3 Mar 2017 19:16:46 +0530 Subject: Modify UI for notifications in submitted code questions --- yaksh/templates/yaksh/question.html | 19 +++++++++++++++---- yaksh/views.py | 4 +++- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html index f94298e..5b5326d 100644 --- a/yaksh/templates/yaksh/question.html +++ b/yaksh/templates/yaksh/question.html @@ -137,9 +137,15 @@ function call_skip(url) {% block main %}

{% if notification %} - + {% if question.type == "code" %} + + {% else %} + + {% endif %} {% endif %}
{% csrf_token %} @@ -204,10 +210,15 @@ function call_skip(url) {% elif question.type == "upload" %}
   {% else %} -    + {% if notification == None %} +    + {% endif %} {% endif %} + {% if paper.question_paper.quiz.allow_skip and not paper.get_questions_unanswered|length_is:"1" %} + {% if notification == None %} + {% endif %} diff --git a/yaksh/views.py b/yaksh/views.py index 163c12f..1089067 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -413,7 +413,9 @@ def show_question(request, question, paper, error_message=None, notification=Non reason='Your time is up!' return complete(request, reason, paper.attempt_number, paper.question_paper.id) if question in paper.questions_answered.all(): - notification = 'You have already attempted this question' + notification = 'You have already attempted this question successfully' \ + if question.type == "code" else \ + 'You have already attempted this question' test_cases = question.get_test_cases() files = FileUpload.objects.filter(question_id=question.id, hide=False) context = {'question': question, 'paper': paper, 'error_message': error_message, -- cgit