From caf37373ec546d53db7caaf8aca9d5550d0ed4ad Mon Sep 17 00:00:00 2001 From: maheshgudi Date: Mon, 6 Nov 2017 20:05:40 +0530 Subject: Modify answerpaper wrt to changes in assertion error output --- yaksh/templates/yaksh/grade_user.html | 31 +++++++++++++++++++++++++--- yaksh/templates/yaksh/user_data.html | 32 +++++++++++++++++++++++++---- yaksh/templates/yaksh/view_answerpaper.html | 31 +++++++++++++++++++++++++--- 3 files changed, 84 insertions(+), 10 deletions(-) (limited to 'yaksh/templates') diff --git a/yaksh/templates/yaksh/grade_user.html b/yaksh/templates/yaksh/grade_user.html index 37bc788..3339177 100644 --- a/yaksh/templates/yaksh/grade_user.html +++ b/yaksh/templates/yaksh/grade_user.html @@ -218,9 +218,8 @@ Status : Passed
{% endif %} {% with ans.error_list as err %} {% for error in err %} - {% if not error.expected_output %} -
 {{error|safe}} 
- {% else %} + + {% if error.type == 'stdio' %}
{% if error.given_input %} @@ -262,6 +261,32 @@ Status : Passed
+ {% elif error.type == 'assertion' %} + {% if error.test_case %} + We tried you code with the following test case:

+
{{error.test_case}}
+ {% endif %} +

The following error took place:

+
+ + + + + + + + + + + {% if error.traceback %} + + + {% endif %} + +
Exception Name: {{error.exception}}
Exception Message: {{error.message}}
Full Traceback:
{{error.traceback}}
+
+ {% else %} +
 {{error|safe}} 
{% endif %} {% endfor %} {% endwith %} diff --git a/yaksh/templates/yaksh/user_data.html b/yaksh/templates/yaksh/user_data.html index 6dfaac3..a0219dd 100644 --- a/yaksh/templates/yaksh/user_data.html +++ b/yaksh/templates/yaksh/user_data.html @@ -136,12 +136,10 @@ User IP address: {{ paper.user_ip }}
Correct answer {% else %}
-
Error +
Error
{% with answer.error_list as err %} {% for error in err %} - {% if not error.expected_output %} -
 {{error|safe}} 
- {% else %} + {% if error.type == 'stdio' %}
{% if error.given_input %} @@ -183,6 +181,32 @@ User IP address: {{ paper.user_ip }}
+ {% elif error.type == 'assertion' %} + {% if error.test_case %} + We tried you code with the following test case:

+
{{error.test_case}}
+ {% endif %} +

The following error took place:

+
+ + + + + + + + + + + {% if error.traceback %} + + + {% endif %} + +
Exception Name: {{error.exception}}
Exception Message: {{error.message}}
Full Traceback:
{{error.traceback}}
+
+ {% else %} +
 {{error|safe}} 
{% endif %} {% endfor %} {% endwith %} diff --git a/yaksh/templates/yaksh/view_answerpaper.html b/yaksh/templates/yaksh/view_answerpaper.html index 79987b1..fa16a08 100644 --- a/yaksh/templates/yaksh/view_answerpaper.html +++ b/yaksh/templates/yaksh/view_answerpaper.html @@ -131,9 +131,8 @@ {% with answer.error_list as err %} {% for error in err %} - {% if not error.expected_output %} -
 {{error|safe}} 
- {% else %} + + {% if error.type == 'stdio' %}
{% if error.given_input %} @@ -175,6 +174,32 @@
+ {% elif error.type == 'assertion' %} + {% if error.test_case %} + We tried you code with the following test case:

+
{{error.test_case}}
+ {% endif %} +

The following error took place:

+
+ + + + + + + + + + + {% if error.traceback %} + + + {% endif %} + +
Exception Name: {{error.exception}}
Exception Message: {{error.message}}
Full Traceback:
{{error.traceback}}
+
+ {% else %} +
 {{error|safe}} 
{% endif %} {% endfor %} {% endwith %} -- cgit