summaryrefslogtreecommitdiff
path: root/yaksh/templates
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/templates')
-rw-r--r--yaksh/templates/yaksh/question.html21
1 files changed, 3 insertions, 18 deletions
diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html
index 110c422..b8be99f 100644
--- a/yaksh/templates/yaksh/question.html
+++ b/yaksh/templates/yaksh/question.html
@@ -1,4 +1,5 @@
{% extends "base.html" %}
+{% load custom_filters %}
<!DOCTYPE html>
@@ -66,15 +67,6 @@ updateClock();
var timeinterval = setInterval(updateClock,1000);
}
-// function setSnippetHeight()
-// {
-// var ta = document.getElementById('snippet');
-// var height = ta.scrollHeight+'px';
-// ta.style.height = 'auto';
-// ta.style.height = height;
-// autoresize();
-// }
-
function validate(){
uploaded_file = document.getElementById("assignment").value;
if(uploaded_file == ""){
@@ -186,15 +178,9 @@ function call_skip(url)
{% if question.type == "code" %}
<h4>Program:</h4>
-<!-- <textarea rows="1" class="bash" readonly="yes" name="snippet" id="snippet" wrap="off" >{% if last_attempt %}{{ question.snippet }}{% else %}{% if question.type == "bash" %} #!/bin/bash&#13;&#10;{{ question.snippet }}{% else %}{{ question.snippet }}{% endif %}{% endif %}</textarea> -->
-<!-- <textarea rows="10" class="bash" name="answer" id="answer" wrap="off" onkeydown="return catchTab(this,event)">{% if last_attempt %}{{last_attempt}}{% else %}{% if question.type == "bash" %}{% else %}{% endif %}{% endif %}</textarea> -->
<textarea name="answer" id="answer"></textarea>
<br>
-<!-- <script type="text/javascript">
- addLineNumbers('answer');
- </script>
- <script>addLineNumbers('snippet');</script> -->
{% endif %}
{% if question.type == "mcq" or question.type == "mcc "%}
@@ -234,7 +220,6 @@ function call_skip(url)
<script>
// Codemirror object, language modes and initial content
-
// Get the textarea node
var textarea_node = document.querySelector('#answer');
@@ -253,10 +238,10 @@ function call_skip(url)
var editor = CodeMirror.fromTextArea(textarea_node, options);
// Setting code editors initial content
- editor.setValue('{{last_attempt|safe}}') //.replace(/\"|\'/g, "\'") // .replace(/^\"|\"$/g, "")
+ editor.setValue('{{ last_attempt|escape_quotes|safe }}')
function reset_editor() {
- // editor.setValue('{{ last_attempt|safe }}');
+ editor.setValue('{{ last_attempt|escape_quotes|safe }}');
editor.clearHistory();
}