summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testapp/static/exam/js/add_question.js4
-rw-r--r--testapp/static/exam/js/add_quiz.js1
-rw-r--r--testapp/static/exam/js/edit_question.js4
-rw-r--r--testapp/templates/exam/question.html9
4 files changed, 8 insertions, 10 deletions
diff --git a/testapp/static/exam/js/add_question.js b/testapp/static/exam/js/add_question.js
index d990291..e001ee7 100644
--- a/testapp/static/exam/js/add_question.js
+++ b/testapp/static/exam/js/add_question.js
@@ -140,9 +140,7 @@ function textareaformat()
$('#id_snippet').bind('blur', function( event ){
document.getElementById("id_snippet").rows=1;
document.getElementById("id_snippet").cols=40;
- $('#id_snippet').val("#To avoid indentation errors use tabs for indentation for Python questions");
- });
-
+ });
$('#id_type').bind('change',function(event){
var value = document.getElementById('id_type').value;
if(value == 'mcq')
diff --git a/testapp/static/exam/js/add_quiz.js b/testapp/static/exam/js/add_quiz.js
index 56b0e95..d5688a8 100644
--- a/testapp/static/exam/js/add_quiz.js
+++ b/testapp/static/exam/js/add_quiz.js
@@ -2,7 +2,6 @@ function test()
{
if (document.getElementById("id_description").value != "")
{
- alert("reached condition");
document.getElementById("submit").innerHTML = "Save";
}
}
diff --git a/testapp/static/exam/js/edit_question.js b/testapp/static/exam/js/edit_question.js
index 8866b9a..a5d4e2b 100644
--- a/testapp/static/exam/js/edit_question.js
+++ b/testapp/static/exam/js/edit_question.js
@@ -154,10 +154,6 @@ function textareaformat()
this.rows = 5;
$(snippet_id).val("");
});
- $(snippet_id).bind('blur',function(event){
- this.rows = 1;
- $(snippet_id).val("#To avoid indentation errors use tab for indentation for Python questions");
- });
$(snippet_id).bind('keydown', function (event){
catchTab(snippet_id,event);
});
diff --git a/testapp/templates/exam/question.html b/testapp/templates/exam/question.html
index 1d801b0..1282130 100644
--- a/testapp/templates/exam/question.html
+++ b/testapp/templates/exam/question.html
@@ -78,6 +78,11 @@ function update_time()
<font size=3 face=arial> {{ question.description|safe }} </font>
{% if error_message %}<h5>ERROR:</h5><div class="alert alert-error">{{ error_message }}</div>{% endif %}
+ {% if success_msg %}
+ <script type="text/javascript">
+ alert("Congratulations, that's correct. Let's go to next question");
+ </script>
+ {% endif %}
<p id="status"></p>
<form id="code" action="{{URL_ROOT}}/exam/{{ question.id }}/check/{{ paper.question_paper.id }}/" method="post">
{% csrf_token %}
@@ -87,9 +92,9 @@ function update_time()
{% endfor %}
{% else %}
- <textarea tabindex=1 rows="3" style="width:750px;margin-bottom:15px;height:auto;" readonly=yes name="snippet" id="snippet" wrap="off">{% if last_attempt %}{% else %}{% if question.type == "bash" %} #!/bin/bash{% else %} #To avoid errors use tabs for indentation for Python questions &#13;&#10; {{ question.snippet }}{% endif %}{% endif %}</textarea>
+ <textarea tabindex=1 rows="3" style="width:750px;margin-bottom:15px;height:auto;" readonly=yes name="snippet" id="snippet" wrap="off">{% if last_attempt %}{{question.snippet}}{% else %}{% if question.type == "bash" %} #!/bin/bash{% else %} #To avoid errors use tabs for indentation for Python questions &#13;&#10; {{ question.snippet }}{% endif %}{% endif %}</textarea>
- <textarea tabindex=1 rows="10" style="width:750px;margin-bottom:10px;" name="answer" id="answer" wrap="off" onkeydown="return catchTab(this,event)">{% if last_attempt %}{{last_attempt.strip}}{% else %}{% if question.type == "bash" %}{% else %}{% endif %}{% endif %}</textarea>
+ <textarea tabindex=1 rows="10" style="width:750px;margin-bottom:10px;" 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>
<br>
<script type="text/javascript">