summaryrefslogtreecommitdiff
path: root/yaksh/templates/exam.html
diff options
context:
space:
mode:
authorPrabhu Ramachandran2017-11-10 17:50:48 +0530
committerGitHub2017-11-10 17:50:48 +0530
commit96f8e0af5b39338741c758de918e32e02b95f0c8 (patch)
tree80fb17501e7995ed3abb34ac3b0d62dd8decc560 /yaksh/templates/exam.html
parentcfcb2ed39c724639fe17338e29e327d08ae641b2 (diff)
parent95f862caee8ca6077ee8f9a8fc88d9ca44db1cdf (diff)
downloadonline_test-96f8e0af5b39338741c758de918e32e02b95f0c8.tar.gz
online_test-96f8e0af5b39338741c758de918e32e02b95f0c8.tar.bz2
online_test-96f8e0af5b39338741c758de918e32e02b95f0c8.zip
Merge pull request #380 from maheshgudi/beautify_assertions
Prettify assertion error output
Diffstat (limited to 'yaksh/templates/exam.html')
-rw-r--r--yaksh/templates/exam.html45
1 files changed, 34 insertions, 11 deletions
diff --git a/yaksh/templates/exam.html b/yaksh/templates/exam.html
index 9596c1c..a1f0df4 100644
--- a/yaksh/templates/exam.html
+++ b/yaksh/templates/exam.html
@@ -80,27 +80,50 @@
{% block main %}
{% endblock %}
</div>
+ <br/>
{% if question.type == 'code' or question.type == 'upload' %}
{% if error_message %}
<div class="row" id="error_panel">
{% for error in error_message %}
<div class="panel panel-danger">
- <div class="panel-heading">Testcase No. {{ forloop.counter }}</div>
+ <div class="panel-heading">Error No. {{ forloop.counter }}</div>
<div class="panel-body">
<div class="well well-sm">
- {% if not error.expected_output %}
+ {% if not error.type %}
<pre><code> {{error|safe}} </code></pre>
- {% else %}
- {% if error.given_input %}
- <table class="table table-bordered">
- <col width="30%">
- <tr class = "active">
- <td> For given Input value(s):</td>
- <td>{{error.given_input}}</td>
+ {% elif error.type == 'assertion' %}
+ {% if error.test_case %}
+ <strong> We tried your code with the following test case:</strong><br/></br>
+ <pre><code><strong style="color:#d9534f">{{error.test_case}}</strong></code></pre>
+ {% endif %}
+ <p> <b>The following error took place: </b></p>
+ <table class="table table-bordered" width="100%" id='assertion'>
+ <col width="30%">
+ <tr class = "active">
+ <td><b>Exception Name: </b></td>
+ <td><span style="color: #d9534f">{{error.exception}}</span></td>
+ </tr>
+ <tr>
+ <td><b>Exception Message: </b></td><td>{{error.message}}</td>
</tr>
- </table>
+ <tr>
+ {% if error.traceback %}
+ <td><b>Full Traceback: </b></td>
+ <td><pre>{{error.traceback}}</pre></td>
+ {% endif %}
+ </tr>
+ </table>
+ {% elif error.type == 'stdio' %}
+ {% if error.given_input %}
+ <table class="table table-bordered">
+ <col width="30%">
+ <tr class = "active">
+ <td> For given Input value(s):</td>
+ <td>{{error.given_input}}</td>
+ </tr>
+ </table>
{% endif %}
- <table class="table table-bordered" width="100%" id="output">
+ <table class="table table-bordered" width="100%" id="stdio">
<col width="10%">
<col width="40%">
<col width="40%">