From 6c4ab452538fd23d67c1c2d508cb4768e601d688 Mon Sep 17 00:00:00 2001 From: mahesh Date: Wed, 17 May 2017 18:29:33 +0530 Subject: changes answerpaper design to accommodate new stdio error look --- yaksh/templates/yaksh/grade_user.html | 57 +++++++++++++++++++++++++++-- yaksh/templates/yaksh/user_data.html | 54 +++++++++++++++++++++++++-- yaksh/templates/yaksh/view_answerpaper.html | 52 +++++++++++++++++++++++++- 3 files changed, 155 insertions(+), 8 deletions(-) (limited to 'yaksh/templates') diff --git a/yaksh/templates/yaksh/grade_user.html b/yaksh/templates/yaksh/grade_user.html index c93ec10..a711fc2 100644 --- a/yaksh/templates/yaksh/grade_user.html +++ b/yaksh/templates/yaksh/grade_user.html @@ -1,4 +1,5 @@ {% extends "manage.html" %} +{% load custom_filters %} {% block title %} Grade User {% endblock %} @@ -132,6 +133,7 @@ Status : Passed
{% csrf_token %} {% for question, answers in paper.get_question_answers.items %} +
Details: {{forloop.counter}}. {{ question.summary }} @@ -198,10 +200,57 @@ Status : Passed
Error: {% endif %} - {% for err in ans.error_list %} -
{{ err }}
- {% endfor %} + {% with ans.error_list as err %} + {% for error in err %} + {% if not error.expected_output %} +
 {{error|safe}} 
+ {% else %} +
+ {% if error.given_input %} + + + + + + +
For given Input value(s):{{error.given_input}}
+ {% endif %} + + + + + + + + + + + + {% for expected,user in error.expected_output|zip:error.user_output %} + + + + {% if forloop.counter0 in error.error_no or not expected or not user %} + + {% else %} + + {% endif %} + + {% endfor %} +
Line No.
Expected Output
User output
Status
{{forloop.counter}} {{expected|default:""}} {{user|default:""}}
+ + + + + + +
Error:{{error.error}}
+ {% endif %} + {% endfor %} + {% endwith %} +
+
{% if question.type != "code" %}
@@ -220,6 +269,7 @@ Status : Passed
value="{{ answer.answer.marks }}">

{% endwith %}
+
{% endfor %} {# for question, answers ... #}

Teacher comments:

@@ -233,6 +283,7 @@ Status : Passed
{% endif %} {# if paper.answers.count #} + {% endfor %} {# for paper in data.papers #} {% endif %} {# if data.papers #} diff --git a/yaksh/templates/yaksh/user_data.html b/yaksh/templates/yaksh/user_data.html index 6e62b66..1af27e6 100644 --- a/yaksh/templates/yaksh/user_data.html +++ b/yaksh/templates/yaksh/user_data.html @@ -1,4 +1,5 @@ {% extends "manage.html" %} +{% load custom_filters %} {% block pagetitle %} Data for user {{ data.user.get_full_name.title }} {% endblock pagetitle %} @@ -118,11 +119,56 @@ User IP address: {{ paper.user_ip }} {% else %}
Error - - {% for error in answer.error_list %} -
{{ error }}
+ {% with answer.error_list as err %} + {% for error in err %} + {% if not error.expected_output %} +
 {{error|safe}} 
+ {% else %} +
+ {% if error.given_input %} + + + + + + +
For given Input value(s):{{error.given_input}}
+ {% endif %} + + + + + + + + + + + + {% for expected,user in error.expected_output|zip:error.user_output %} + + + + {% if forloop.counter0 in error.error_no or not expected or not user %} + + {% else %} + + {% endif %} + + {% endfor %} +
Line No.
Expected Output
User output
Status
{{forloop.counter}} {{expected|default:""}} {{user|default:""}}
+ + + + + + +
Error:{{error.error}}
+
+ {% endif %} {% endfor %} - {% endif %} + {% endwith %} + {% endif %}
diff --git a/yaksh/templates/yaksh/view_answerpaper.html b/yaksh/templates/yaksh/view_answerpaper.html index f4c8846..71536eb 100644 --- a/yaksh/templates/yaksh/view_answerpaper.html +++ b/yaksh/templates/yaksh/view_answerpaper.html @@ -1,4 +1,5 @@ {% extends "user.html" %} +{% load custom_filters %} {% block pagetitle %} Answer Paper for {{ quiz.description }}{% endblock pagetitle %} @@ -102,7 +103,56 @@ {% else %}
{% endif %} -
Autocheck: {{ answer.error }}
+
Error:
+ {% with answer.error_list as err %} + {% for error in err %} + {% if not error.expected_output %} +
 {{error|safe}} 
+ {% else %} +
+ {% if error.given_input %} + + + + + + +
For given Input value(s):{{error.given_input}}
+ {% endif %} + + + + + + + + + + + + {% for expected,user in error.expected_output|zip:error.user_output %} + + + + {% if forloop.counter0 in error.error_no or not expected or not user %} + + {% else %} + + {% endif %} + + {% endfor %} +
Line No.
Expected Output
User output
Status
{{forloop.counter}} {{expected|default:""}} {{user|default:""}}
+ + + + + + +
Error:{{error.error}}
+
+ {% endif %} + {% endfor %} + {% endwith %}
{{ answer.answer.answer.strip }}
-- cgit