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 %}
|
|
22 |
<form action="" method="post" id="queform">
|
|
23 |
{{question.description}} <br />
|
27
|
24 |
<textarea name="answer"></textarea><br />
|
|
25 |
<input type="button" value="Time left: {{question.time_limit}} secs" id="time_left">
|
19
|
26 |
</form>
|
|
27 |
{% endblock %}
|