summaryrefslogtreecommitdiff
path: root/testapp/templates/exam/show_quiz.html
blob: 684cfd2a9fc4c7031f1b1bdb398d48301cc93277 (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
50
51
52
53
54
55
56
{% extends "manage.html" %}

{% block title %} Quiz List {% endblock title %}

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

   </script>
{% endblock %}
{% block subtitle %} Quiz List {% endblock %}
{% block manage %}
{% if not quizzes and not quiz %}
<center><h5> No quizzes available. </h5></center>
{% endif %}

{# ############################################################### #}
{# This is rendered when we are just viewing exam/monitor #}
{% if quizzes %}
<form method="post" action="" name='frm'>
{% csrf_token %}

{% for quiz in quizzes %}
<input type=checkbox name='quiz' value={{quiz.id}} />&nbsp;&nbsp;<a href="{{URL_ROOT}}/exam/manage/addquiz/{{quiz.id}}/">{{ quiz.description }}</a><br>
{% endfor %}

<br><br>
<button class="btn" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/addquiz");'>Add New Quiz</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" name="delete" value='delete' onClick="my_confirm(frm);">Delete Selected</button>
</form>
{% endif %}

{% endblock %}