summaryrefslogtreecommitdiff
path: root/testapp/exam/templates
diff options
context:
space:
mode:
authorprathamesh2015-02-24 14:13:38 +0530
committerprathamesh2015-02-24 14:13:38 +0530
commitda7014b32635f47d0fd66931ce5961e54f82ae94 (patch)
tree762157219f97e1669230aa5df96f9776f6920df6 /testapp/exam/templates
parentff5fc201bf7f44a6dc9d6d93fee7bc0ce47d1be2 (diff)
downloadonline_test-da7014b32635f47d0fd66931ce5961e54f82ae94.tar.gz
online_test-da7014b32635f47d0fd66931ce5961e54f82ae94.tar.bz2
online_test-da7014b32635f47d0fd66931ce5961e54f82ae94.zip
Answer is now saved from the question navigator as well
Diffstat (limited to 'testapp/exam/templates')
-rw-r--r--testapp/exam/templates/exam/question.html20
1 files changed, 14 insertions, 6 deletions
diff --git a/testapp/exam/templates/exam/question.html b/testapp/exam/templates/exam/question.html
index 96e7bd6..5d03b37 100644
--- a/testapp/exam/templates/exam/question.html
+++ b/testapp/exam/templates/exam/question.html
@@ -48,7 +48,12 @@ function setSnippetHeight()
ta.style.height = height;
autoresize();
}
-
+function call_skip(url)
+{
+ form = document.forms["code"]
+ form.action = url
+ form.submit();
+}
</script>
{% endblock script %}
@@ -82,17 +87,18 @@ function setSnippetHeight()
</div>
</div>
</div>
+
<div class = container>
-<div class="sidebar">
+ <div class="sidebar">
<p>Question Navigator </p>
<div class="pagination">
<ul>
{% for qid, num in questions.items %}
{% if qid in to_attempt %}
{% if qid == question.id|slugify %}
- <li class="active"><a href="{{ URL_ROOT }}/exam/{{ qid }}/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/">{{ num }}</a></li>
+ <li class="active"><a href="#" onclick="call_skip('{{ URL_ROOT }}/exam/{{ qid }}/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/')">{{ num }}</a></li>
{% else %}
- <li><a href="{{ URL_ROOT }}/exam/{{ qid }}/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/">{{ num }}</a></li>
+ <li><a href="#" onclick="call_skip('{{ URL_ROOT }}/exam/{{ qid }}/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/')">{{ num }}</a></li>
{% endif %}
{% endif %}
{% if qid in submitted %}
@@ -101,7 +107,7 @@ function setSnippetHeight()
{% endfor %}
</ul>
</div>
-</div>
+ </div>
</div>
<h4><u> {{ question.summary }} </u><font class=pull-right>(Marks : {{ question.points }}) </font></h4><br>
@@ -117,7 +123,9 @@ function setSnippetHeight()
<p id="status"></p>
<form id="code" action="{{URL_ROOT}}/exam/{{ question.id }}/check/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/" method="post" enctype="multipart/form-data">
- {% csrf_token %}
+ {% csrf_token %}
+ <input type=hidden name="question_id" id="question_id" value={{ question.id }}></input>
+
{% if question.type == "mcq" %}
{% for option in question.options.strip.splitlines %}
<input name="answer" type="radio" value="{{option}}" />{{option}} <br/>