From 88a37e73cabe8f396631132b2cffdddd5bcae17f Mon Sep 17 00:00:00 2001 From: maheshgudi Date: Wed, 4 Oct 2017 21:26:12 +0530 Subject: User can see previously submitted answers for non code questions --- yaksh/templates/yaksh/grade_user.html | 2 +- yaksh/templates/yaksh/question.html | 32 +++++++++++++++++++------------- 2 files changed, 20 insertions(+), 14 deletions(-) (limited to 'yaksh/templates') diff --git a/yaksh/templates/yaksh/grade_user.html b/yaksh/templates/yaksh/grade_user.html index 9cdfb1a..52f319c 100644 --- a/yaksh/templates/yaksh/grade_user.html +++ b/yaksh/templates/yaksh/grade_user.html @@ -114,7 +114,7 @@ Status : Passed
{% for question, answers in paper.get_question_answers.items %} {% with answers|last as answer %} - {{ question.id }} + {{ question.summary }} {{ answer.answer.marks }} {% endwith %} diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html index 3a3066c..eb6eb3d 100644 --- a/yaksh/templates/yaksh/question.html +++ b/yaksh/templates/yaksh/question.html @@ -53,7 +53,7 @@ function updateClock(){ var ss = ('0' + t.seconds).slice(-2); if(t.total<0){ - + document.forms["code"].submit(); clearInterval(timeinterval); return null; @@ -77,10 +77,7 @@ function validate(){ $("#upload_alert").modal("show"); return false; } - else - { - send_request(); - } + return true; } function call_skip(url) @@ -155,32 +152,44 @@ lang = "{{ question.language }}"
{% if question.type == "mcq" %} {% for test_case in test_cases %} - {{ test_case.options|safe }}
+ {% if last_attempt and last_attempt|safe == test_case.options|safe %} + + {{ test_case.options|safe }}
+ {% else %} + + {{ test_case.options|safe }}
+ {% endif %} {% endfor %} {% endif %} {% if question.type == "integer" %} Enter Integer:
- +

{% endif %} {% if question.type == "string" %} Enter Text:
- +

{% endif %} {% if question.type == "float" %} Enter Decimal Value :
- +

{% endif %} {% if question.type == "mcc" %} {% for test_case in test_cases %} - {{ test_case.options|safe }} + {% if last_attempt and test_case.options|safe in last_attempt|safe %} + {{ test_case.options }}
+ {% else %} + + {{ test_case.options}} +
+ {% endif %} {% endfor %} {% endif %} {% if question.type == "upload" %} @@ -241,6 +250,3 @@ lang = "{{ question.language }}"
{% endblock main %} - - - -- cgit