equal
deleted
inserted
replaced
1 {% extends 'base.html' %} |
1 {% extends 'base.html' %} |
2 {% block script %} |
2 {% block script %} |
3 <script language="javascript"> |
3 <script language="javascript"> |
4 function dipost (){ |
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 (){ |
5 document.getElementById("queform").submit(); |
16 document.getElementById("queform").submit(); |
6 } |
17 } |
7 setTimeout("dipost()", {{question.time_limit}} * 1000) |
18 setTimeout("dec_counter()", 1000); |
8 </script> |
19 </script> |
9 {% endblock %} |
20 {% endblock %} |
10 {% block content %} |
21 {% block content %} |
11 <form action="" method="post" id="queform"> |
22 <form action="" method="post" id="queform"> |
12 {{question.description}} <br /> |
23 {{question.description}} <br /> |
13 <textarea name="answer"></textarea> |
24 <textarea name="answer"></textarea><br /> |
|
25 <input type="button" value="Time left: {{question.time_limit}} secs" id="time_left"> |
14 </form> |
26 </form> |
15 {% endblock %} |
27 {% endblock %} |