author | nishanth |
Fri, 02 Jul 2010 14:12:25 +0530 | |
changeset 87 | e81b105b1128 |
parent 55 | 8d78e1e62424 |
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) { |
|
55 | 8 |
document.getElementById("time_left").innerHTML = "Time left: " + time_left + " secs"; |
27 | 9 |
setTimeout("dec_counter()", 1000); |
10 |
} |
|
11 |
else { |
|
12 |
dopost(); |
|
13 |
} |
|
14 |
} |
|
15 |
function dopost (){ |
|
19 | 16 |
document.getElementById("queform").submit(); |
17 |
} |
|
52
adab2d07981a
now the counter for questions start after the document has loaded completely
nishanth
parents:
33
diff
changeset
|
18 |
// setTimeout("dec_counter()", 1000); |
19 | 19 |
</script> |
20 |
{% endblock %} |
|
52
adab2d07981a
now the counter for questions start after the document has loaded completely
nishanth
parents:
33
diff
changeset
|
21 |
{% block onload %} onload="dec_counter()" {% endblock %} |
19 | 22 |
{% block content %} |
29 | 23 |
{{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
|
24 |
{% if question.code %} |
29 | 25 |
<br /> |
26 |
<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
|
27 |
{% endif %} |
29 | 28 |
<br /> |
29 |
Answer:<br /> |
|
19 | 30 |
<form action="" method="post" id="queform"> |
29 | 31 |
{% if options %} |
32 |
{% for option in options %} |
|
33 |
<input name="answer" type="radio" value="{{option}}" > {{option}} <br /> |
|
34 |
{% endfor %} |
|
35 |
<br /> |
|
36 |
</select> |
|
37 |
{% else %} |
|
38 |
<textarea name="answer" rows="10" cols="40"></textarea><br /> |
|
39 |
{% endif %} |
|
33
d28d0957a5ab
added intro page and manual submit button in question page
nishanth
parents:
29
diff
changeset
|
40 |
<input type="submit" value="Submit"> |
19 | 41 |
</form> |
55 | 42 |
<h2 id="time_left"> Time left: {{question.time_limit}} secs</h2> |
19 | 43 |
{% endblock %} |