templates/display_question.html
author nishanth
Wed, 21 Apr 2010 19:17:47 +0530
changeset 33 d28d0957a5ab
parent 29 ea1c0110e989
child 52 adab2d07981a
permissions -rw-r--r--
added intro page and manual submit button in question page
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19
4911302379ac the basic quiz workflow is ready
nishanth
parents:
diff changeset
     1
{% extends 'base.html' %}
4911302379ac the basic quiz workflow is ready
nishanth
parents:
diff changeset
     2
{% block script %}
27
6233cf13fc12 added the time left info on disp question page
nishanth
parents: 19
diff changeset
     3
<script language="javascript">
6233cf13fc12 added the time left info on disp question page
nishanth
parents: 19
diff changeset
     4
		var time_left = {{question.time_limit}};
6233cf13fc12 added the time left info on disp question page
nishanth
parents: 19
diff changeset
     5
		function dec_counter (){
6233cf13fc12 added the time left info on disp question page
nishanth
parents: 19
diff changeset
     6
				time_left -= 1;
6233cf13fc12 added the time left info on disp question page
nishanth
parents: 19
diff changeset
     7
				if (time_left) {
6233cf13fc12 added the time left info on disp question page
nishanth
parents: 19
diff changeset
     8
						document.getElementById("time_left").value = "Time left: " + time_left + " secs";
6233cf13fc12 added the time left info on disp question page
nishanth
parents: 19
diff changeset
     9
						setTimeout("dec_counter()", 1000);
6233cf13fc12 added the time left info on disp question page
nishanth
parents: 19
diff changeset
    10
				}
6233cf13fc12 added the time left info on disp question page
nishanth
parents: 19
diff changeset
    11
				else {
6233cf13fc12 added the time left info on disp question page
nishanth
parents: 19
diff changeset
    12
						dopost();
6233cf13fc12 added the time left info on disp question page
nishanth
parents: 19
diff changeset
    13
				}
6233cf13fc12 added the time left info on disp question page
nishanth
parents: 19
diff changeset
    14
		}
6233cf13fc12 added the time left info on disp question page
nishanth
parents: 19
diff changeset
    15
        function dopost (){
19
4911302379ac the basic quiz workflow is ready
nishanth
parents:
diff changeset
    16
            document.getElementById("queform").submit();
4911302379ac the basic quiz workflow is ready
nishanth
parents:
diff changeset
    17
        }
27
6233cf13fc12 added the time left info on disp question page
nishanth
parents: 19
diff changeset
    18
		setTimeout("dec_counter()", 1000);
19
4911302379ac the basic quiz workflow is ready
nishanth
parents:
diff changeset
    19
    </script>
4911302379ac the basic quiz workflow is ready
nishanth
parents:
diff changeset
    20
{% endblock %}
4911302379ac the basic quiz workflow is ready
nishanth
parents:
diff changeset
    21
{% block content %}
29
ea1c0110e989 fixed the display of question
nishanth
parents: 28
diff changeset
    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
ea1c0110e989 fixed the display of question
nishanth
parents: 28
diff changeset
    24
<br />
ea1c0110e989 fixed the display of question
nishanth
parents: 28
diff changeset
    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
ea1c0110e989 fixed the display of question
nishanth
parents: 28
diff changeset
    27
<br />
ea1c0110e989 fixed the display of question
nishanth
parents: 28
diff changeset
    28
Answer:<br />
19
4911302379ac the basic quiz workflow is ready
nishanth
parents:
diff changeset
    29
<form action="" method="post" id="queform">
29
ea1c0110e989 fixed the display of question
nishanth
parents: 28
diff changeset
    30
		{% if options %}
ea1c0110e989 fixed the display of question
nishanth
parents: 28
diff changeset
    31
		{% for option in options %}	
ea1c0110e989 fixed the display of question
nishanth
parents: 28
diff changeset
    32
		<input name="answer" type="radio" value="{{option}}" > {{option}} <br />
ea1c0110e989 fixed the display of question
nishanth
parents: 28
diff changeset
    33
		{% endfor %}
ea1c0110e989 fixed the display of question
nishanth
parents: 28
diff changeset
    34
		<br />
ea1c0110e989 fixed the display of question
nishanth
parents: 28
diff changeset
    35
</select>
ea1c0110e989 fixed the display of question
nishanth
parents: 28
diff changeset
    36
{% else %}
ea1c0110e989 fixed the display of question
nishanth
parents: 28
diff changeset
    37
<textarea name="answer" rows="10" cols="40"></textarea><br />
ea1c0110e989 fixed the display of question
nishanth
parents: 28
diff changeset
    38
{% endif %}
33
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
    39
<input type="submit" value="Submit">
19
4911302379ac the basic quiz workflow is ready
nishanth
parents:
diff changeset
    40
</form>
33
d28d0957a5ab added intro page and manual submit button in question page
nishanth
parents: 29
diff changeset
    41
<input type="button" value="Time left: {{question.time_limit}} secs" id="time_left">
19
4911302379ac the basic quiz workflow is ready
nishanth
parents:
diff changeset
    42
{% endblock %}