diff options
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/yaksh/grade_user.html | 6 | ||||
-rw-r--r-- | yaksh/templates/yaksh/user_data.html | 4 | ||||
-rw-r--r-- | yaksh/templates/yaksh/view_answerpaper.html | 4 |
3 files changed, 10 insertions, 4 deletions
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/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 %} |