summaryrefslogtreecommitdiff
path: root/testapp/templates/exam/showquestions.html
blob: edcba6fece09e94a10f16daf760e48951b216dc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{% extends "manage.html" %}


{% block subtitle %} 
List of Questions 
{% endblock %}

{% block script %}
<script type='text/javascript'>
function confirm_delete(frm)
{
       var r = confirm("Are you Sure ?");
       if(r==false)
       {
               for(i=0;i<frm.question.length;i++)
               {
                       frm.question[i].checked=false;
               }
               location.replace("{{URL_ROOT}}/exam/manage/showquestion");
       }
}
function confirm_edit(frm)
{
	var n = 0;
	for(i=0;i<frm.question.length;i++)
	{
		if(frm.question[i].checked==true)
			n = n+1;
	}
	if(n==0)
		location.replace("{{URL_ROOT}}/exam/manage/showquestion");

}
</script>
{% endblock %}

{% block manage %}
<form name=frm action="" method="post">
{% csrf_token %}
{% for i in questions %}
<input type="checkbox" name="question" value="{{ i.id }}">&nbsp;&nbsp;<a href="{{URL_ROOT}}/exam/manage/addquestion/{{ i.id }}">{{ i }}</a><br>
{% endfor %}
<br>
<button class="btn" type="button" onclick='location.replace("{{URL_ROOT}}/exam/manage/addquestion/");'>Add Question</button>&nbsp;&nbsp;
<button class="btn" type="submit" name='edit' value='edit' onClick="confirm_edit(frm);">Edit Selected</button>&nbsp;&nbsp;
<button class="btn" type="submit" onClick="confirm_delete(frm);" name='delete' value='delete'>Delete Selected</button>

</form>
{% endblock %}