diff options
author | maheshgudi | 2017-10-26 18:34:36 +0530 |
---|---|---|
committer | maheshgudi | 2017-11-07 14:50:09 +0530 |
commit | 16e8d4b3c096e6034c0066adffc8f5a520f272c7 (patch) | |
tree | af551bc18cb679bd816a78b45b8087beabf8a5be /yaksh/templates/exam.html | |
parent | 807a52e45a9b6c6ac64a7a5e4bd8248900fb4367 (diff) | |
download | online_test-16e8d4b3c096e6034c0066adffc8f5a520f272c7.tar.gz online_test-16e8d4b3c096e6034c0066adffc8f5a520f272c7.tar.bz2 online_test-16e8d4b3c096e6034c0066adffc8f5a520f272c7.zip |
Beautiful error outputs
Diffstat (limited to 'yaksh/templates/exam.html')
-rw-r--r-- | yaksh/templates/exam.html | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/yaksh/templates/exam.html b/yaksh/templates/exam.html index 9596c1c..7b6d54e 100644 --- a/yaksh/templates/exam.html +++ b/yaksh/templates/exam.html @@ -88,17 +88,31 @@ <div class="panel-heading">Testcase 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' %} + We tried the calling your function with the following test case:<br/> + <pre><code><strong>{{error.test_case}}</strong></code></pre> + <table> + <tr> But the following error took place: </tr> + <tr> + <td>Exception Name</td> + <td><mark style="background-color:#ff9999;">{{error.exception}}</mark> + </td> + </tr> + <tr> + <td>Exception Message</td><td>{{error.message}}</td> </tr> - </table> + </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"> <col width="10%"> |