author | nishanth |
Wed, 21 Apr 2010 12:11:19 +0530 | |
changeset 29 | ea1c0110e989 |
parent 28 | 456b7b9e3d13 |
child 33 | d28d0957a5ab |
permissions | -rw-r--r-- |
19 | 1 |
{% extends 'base.html' %} |
2 |
{% block script %} |
|
27 | 3 |
<script language="javascript"> |
4 |
var time_left = {{question.time_limit}}; |
|
5 |
function dec_counter (){ |
|
6 |
time_left -= 1; |
|
7 |
if (time_left) { |
|
8 |
document.getElementById("time_left").value = "Time left: " + time_left + " secs"; |
|
9 |
setTimeout("dec_counter()", 1000); |
|
10 |
} |
|
11 |
else { |
|
12 |
dopost(); |
|
13 |
} |
|
14 |
} |
|
15 |
function dopost (){ |
|
19 | 16 |
document.getElementById("queform").submit(); |
17 |
} |
|
27 | 18 |
setTimeout("dec_counter()", 1000); |
19 | 19 |
</script> |
20 |
{% endblock %} |
|
21 |
{% block content %} |
|
29 | 22 |
{{question.description|linebreaksbr}} <br /> |
28
456b7b9e3d13
created a question bank xml file and created a seed_que command for adding questions to db from xml
nishanth
parents:
27
diff
changeset
|
23 |
{% if question.code %} |
29 | 24 |
<br /> |
25 |
<fieldset><pre>{{question.code}}</pre></fieldset> |
|
28
456b7b9e3d13
created a question bank xml file and created a seed_que command for adding questions to db from xml
nishanth
parents:
27
diff
changeset
|
26 |
{% endif %} |
29 | 27 |
<br /> |
28 |
Answer:<br /> |
|
19 | 29 |
<form action="" method="post" id="queform"> |
29 | 30 |
{% if options %} |
31 |
{% for option in options %} |
|
32 |
<input name="answer" type="radio" value="{{option}}" > {{option}} <br /> |
|
33 |
{% endfor %} |
|
34 |
<br /> |
|
35 |
</select> |
|
36 |
{% else %} |
|
37 |
<textarea name="answer" rows="10" cols="40"></textarea><br /> |
|
38 |
{% endif %} |
|
27 | 39 |
<input type="button" value="Time left: {{question.time_limit}} secs" id="time_left"> |
19 | 40 |
</form> |
41 |
{% endblock %} |