summaryrefslogtreecommitdiff
path: root/yaksh/templates
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/templates')
-rw-r--r--yaksh/templates/yaksh/add_question.html2
-rw-r--r--yaksh/templates/yaksh/error_template.html11
-rw-r--r--yaksh/templates/yaksh/grade_user.html6
-rw-r--r--yaksh/templates/yaksh/moderator_dashboard.html6
-rw-r--r--yaksh/templates/yaksh/user_data.html4
-rw-r--r--yaksh/templates/yaksh/view_answerpaper.html4
6 files changed, 26 insertions, 7 deletions
diff --git a/yaksh/templates/yaksh/add_question.html b/yaksh/templates/yaksh/add_question.html
index 692af48..c4cd8a7 100644
--- a/yaksh/templates/yaksh/add_question.html
+++ b/yaksh/templates/yaksh/add_question.html
@@ -50,7 +50,9 @@
{% for form in formset %}
<div class="link-formset well">
+ {% autoescape off %}
{{ form.as_p }}
+ {% endautoescape %}
</div>
{% endfor %}
diff --git a/yaksh/templates/yaksh/error_template.html b/yaksh/templates/yaksh/error_template.html
index 5530844..00fa306 100644
--- a/yaksh/templates/yaksh/error_template.html
+++ b/yaksh/templates/yaksh/error_template.html
@@ -1,4 +1,11 @@
+{% block css%}
+ <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/dashboard.css" type="text/css" />
+{% endblock %}
+{% block script %}
+ <script src="{{ URL_ROOT }}/static/yaksh/js/jquery-ui.js"></script>
+{% endblock %}
+
{% load custom_filters %}
{% if error_message %}
<div class="container-fluid row justify-content-center">
@@ -64,8 +71,8 @@
</tr>
{% for expected,user in error.expected_output|zip:error.user_output %}
<td> {{forloop.counter}} </td>
- <td>{{expected|default:""}} </td>
- <td>{{user|default:""}}</td>
+ <td>{{expected|default:""|highlight_spaces|safe}} </td>
+ <td>{{user|default:""|highlight_spaces|safe}}</td>
{% if forloop.counter0 in error.error_line_numbers or not expected or not user %}
<td><span class ="fa fa-times text-warning"/></td>
{% else %}
diff --git a/yaksh/templates/yaksh/grade_user.html b/yaksh/templates/yaksh/grade_user.html
index a76f2c7..b1edba5 100644
--- a/yaksh/templates/yaksh/grade_user.html
+++ b/yaksh/templates/yaksh/grade_user.html
@@ -311,7 +311,9 @@ Status : <b style="color: red;"> Failed </b><br/>
<div class="card-body">
{% if question.type == "code" %}
- <pre><code>{{ ans.answer.answer.strip }}</code></pre>
+ {% pygmentise_user_answer question.language ans.answer.answer.strip as user_answer %}
+ <style type="text/css">{{user_answer.1}}</style>
+ <pre><code>{{user_answer.0|safe}}</code></pre>
{% elif question.type == "mcc"%}
<div class="card">
<div class="card-body">
@@ -346,7 +348,7 @@ Status : <b style="color: red;"> Failed </b><br/>
{% else %}
<div class="card">
<div class="card-body">
- {{ ans.answer.answer.strip }}
+ {{ ans.answer.answer.strip|safe }}
</div>
</div>
{% endif %}
diff --git a/yaksh/templates/yaksh/moderator_dashboard.html b/yaksh/templates/yaksh/moderator_dashboard.html
index 503cc72..59dd123 100644
--- a/yaksh/templates/yaksh/moderator_dashboard.html
+++ b/yaksh/templates/yaksh/moderator_dashboard.html
@@ -102,7 +102,11 @@
</tr>
{% endfor %}
</table>
- <center><button class="btn btn-danger" type="submit">Delete Selected</button></center>
+<center>
+ <button class="btn btn-danger" type="submit">
+ Delete Selected
+ <span class="glyphicon glyphicon-trash"></span>
+</button></center>
</form>
</div>
{% endif %}
diff --git a/yaksh/templates/yaksh/user_data.html b/yaksh/templates/yaksh/user_data.html
index 317cb15..687dc48 100644
--- a/yaksh/templates/yaksh/user_data.html
+++ b/yaksh/templates/yaksh/user_data.html
@@ -223,7 +223,9 @@
</div>
<div class="card-body">
{% if question.type == "code" %}
- <pre><code>{{ ans.answer.answer.strip|safe }}</code></pre>
+ {% pygmentise_user_answer question.language answer.answer.answer.strip as user_answer %}
+ <style type="text/css">{{user_answer.1}}</style>
+ <pre><code>{{user_answer.0|safe}}</code></pre>
{% elif question.type == "mcc"%}
<div class="card">
<div class="card-body">
diff --git a/yaksh/templates/yaksh/view_answerpaper.html b/yaksh/templates/yaksh/view_answerpaper.html
index b87c818..8e085b6 100644
--- a/yaksh/templates/yaksh/view_answerpaper.html
+++ b/yaksh/templates/yaksh/view_answerpaper.html
@@ -241,7 +241,9 @@
{% endfor %}
{% endwith %}
<div class="panel-body">
- <pre><code>{{ answer.answer.answer.strip }}</code></pre>
+ {% pygmentise_user_answer question.language answer.answer.answer.strip as user_answer %}
+ <style type="text/css">{{user_answer.1}}</style>
+ <pre><code>{{user_answer.0|safe}}</code></pre>
</div>
</div>
{% endif %}