summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh')
-rw-r--r--yaksh/templates/yaksh/add_question.html1
-rw-r--r--yaksh/templates/yaksh/grade_user.html15
-rw-r--r--yaksh/templates/yaksh/question.html1
-rw-r--r--yaksh/templates/yaksh/user_data.html20
-rw-r--r--yaksh/templates/yaksh/view_answerpaper.html14
5 files changed, 43 insertions, 8 deletions
diff --git a/yaksh/templates/yaksh/add_question.html b/yaksh/templates/yaksh/add_question.html
index 75802b4..b01ddc3 100644
--- a/yaksh/templates/yaksh/add_question.html
+++ b/yaksh/templates/yaksh/add_question.html
@@ -8,6 +8,7 @@
{% block script %}
<script src="{{ URL_ROOT }}/static/yaksh/js/add_question.js"></script>
+<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"></script>
{% endblock %}
{% block onload %} onload='javascript:textareaformat();' {% endblock %}
diff --git a/yaksh/templates/yaksh/grade_user.html b/yaksh/templates/yaksh/grade_user.html
index 63ff5eb..d20695b 100644
--- a/yaksh/templates/yaksh/grade_user.html
+++ b/yaksh/templates/yaksh/grade_user.html
@@ -4,6 +4,11 @@
{% block content %}
+{% block script %}
+<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"></script>
+{% endblock script %}
+
+
{% if course_details %}
<table id="course-details" class="table table-bordered">
<tr>
@@ -160,7 +165,15 @@ Status : <b style="color: green;"> Passed </b><br/>
<div><pre>{{ err }}</pre></div>
{% endfor %}
</div>
- <div class="panel-body"><pre><code>{{ ans.answer.answer.strip|safe }}</code></pre></div>
+ <div class="panel-body">
+ {% if question.type != "code" %}
+ <div class="well well-sm">
+ {{ ans.answer.answer.strip|safe }}
+ </div>
+ {% else %}
+ <pre><code>{{ ans.answer.answer.strip|safe }}</code></pre>
+ {% endif %}
+ </div>
</div>
{% endfor %}
{% with answers|last as answer %}
diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html
index 9dd0de5..eaaacbf 100644
--- a/yaksh/templates/yaksh/question.html
+++ b/yaksh/templates/yaksh/question.html
@@ -19,6 +19,7 @@
<script src="{{ URL_ROOT }}/static/yaksh/js/codemirror/mode/python/python.js"></script>
<script src="{{ URL_ROOT }}/static/yaksh/js/codemirror/mode/clike/clike.js"></script>
<script src="{{ URL_ROOT }}/static/yaksh/js/codemirror/mode/shell/shell.js"></script>
+<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"></script>
<script>
var time_left = {{ paper.time_left }}
diff --git a/yaksh/templates/yaksh/user_data.html b/yaksh/templates/yaksh/user_data.html
index 16707b2..6679599 100644
--- a/yaksh/templates/yaksh/user_data.html
+++ b/yaksh/templates/yaksh/user_data.html
@@ -5,7 +5,8 @@
{% block content %}
{% block script %}
- <script src= "{{ URL_ROOT }}/static/yaksh/js/edit_question.js"></script>
+<script src= "{{ URL_ROOT }}/static/yaksh/js/edit_question.js"></script>
+<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"></script>
{% endblock %}
<form action="" method="post">
@@ -83,7 +84,7 @@ User IP address: {{ paper.user_ip }}
{%endif%}
</div>
</div>
- {% if question.type == "mcq" or question.type == "mcc" %}
+ {% if question.type != "code" %}
{% if "Correct answer" in answers.0.error_list %}
<div class="panel panel-success">
{% else %}
@@ -94,7 +95,9 @@ User IP address: {{ paper.user_ip }}
</div>
<div class="panel-body">
<h5><u>Student answer:</u></h5>
- <pre><code>{{forloop.counter}}. {{ answers.0.answer|safe }}</code></pre>
+ <div class="well well-sm">
+ {{ answers.0.answer|safe }}
+ </div>
</div>
</div>
{% else %}
@@ -114,7 +117,16 @@ User IP address: {{ paper.user_ip }}
{% endif %}
</div>
- <div class="panel-body"><pre><code>{{ answer.answer.answer.strip }}</code></pre></div>
+ <div class="panel-body">
+ {% if question.type != "code" %}
+ <div class="well well-sg">
+ {{question.type}}
+ {{ answer.answer.answer.strip|safe }}
+ </div>
+ {% else %}
+ <pre><code>{{ answer.answer.answer.strip|safe }}</code></pre>
+ {% endif %}
+ </div>
</div>
{% endfor %}
diff --git a/yaksh/templates/yaksh/view_answerpaper.html b/yaksh/templates/yaksh/view_answerpaper.html
index 5eb55df..f4edf67 100644
--- a/yaksh/templates/yaksh/view_answerpaper.html
+++ b/yaksh/templates/yaksh/view_answerpaper.html
@@ -2,6 +2,10 @@
{% block pagetitle %} Answer Paper for {{ quiz.description }}{% endblock pagetitle %}
+{% block script %}
+<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"></script>
+{% endblock script %}
+
{% block main %}
{% if not data.papers %}
@@ -60,7 +64,7 @@
</div>
</div>
- {% if question.type == "mcq" or question.type == "mcc" %}
+ {% if question.type != "code" %}
{% if "Correct answer" in answers.0.error_list %}
<div class="panel panel-success">
{% else %}
@@ -71,7 +75,9 @@
</div>
<div class="panel-body">
<h5><u>Student answer:</u></h5>
- <pre><code>{{forloop.counter}}. {{ answers.0.answer|safe }}</code></pre>
+ <div class="well well-sm">
+ {{ answers.0.answer|safe }}
+ </div>
</div>
</div>
{% else %}
@@ -84,7 +90,9 @@
<div class="panel panel-danger">
{% endif %}
<div class="panel-heading">Autocheck: {{ answer.error }}</div>
- <div class="panel-body"><pre><code>{{ answer.answer.strip }}</code></pre></div>
+ <div class="panel-body">
+ <pre><code>{{ answer.answer.answer.strip }}</code></pre>
+ </div>
</div>
{% endif %}
{% endfor %}