summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaheshgudi2017-01-28 01:20:11 +0530
committermaheshgudi2017-01-28 01:21:52 +0530
commit5e7d7190a20ac3eb83ad5dd5e58fa216533eabad (patch)
tree42a1c755c1be20fbf88151d1e2c1a2de5d29ce6f
parentcc2395f9490bea7d4670094a8c40fdc6d583a891 (diff)
downloadonline_test-5e7d7190a20ac3eb83ad5dd5e58fa216533eabad.tar.gz
online_test-5e7d7190a20ac3eb83ad5dd5e58fa216533eabad.tar.bz2
online_test-5e7d7190a20ac3eb83ad5dd5e58fa216533eabad.zip
added select all to remove all trial papers
-rw-r--r--yaksh/static/yaksh/js/moderator_dashboard.js14
-rw-r--r--yaksh/templates/yaksh/moderator_dashboard.html13
2 files changed, 25 insertions, 2 deletions
diff --git a/yaksh/static/yaksh/js/moderator_dashboard.js b/yaksh/static/yaksh/js/moderator_dashboard.js
new file mode 100644
index 0000000..87d039c
--- /dev/null
+++ b/yaksh/static/yaksh/js/moderator_dashboard.js
@@ -0,0 +1,14 @@
+$(document).ready(function(){
+$(".selectall").change(function(){
+ if($(this).prop("checked")) {
+ $("#trial input:checkbox").each(function(index, element) {
+ $(this).prop('checked', true);
+ });
+ }
+ else {
+ $("#trial input:checkbox").each(function(index, element) {
+ $(this).prop('checked', false);
+ });
+ }
+ });
+}); \ No newline at end of file
diff --git a/yaksh/templates/yaksh/moderator_dashboard.html b/yaksh/templates/yaksh/moderator_dashboard.html
index aeeb772..64167f8 100644
--- a/yaksh/templates/yaksh/moderator_dashboard.html
+++ b/yaksh/templates/yaksh/moderator_dashboard.html
@@ -1,6 +1,10 @@
{% extends "manage.html" %}
{% block pagetitle %} Moderator's Dashboard {% endblock pagetitle %}
+{% block script %}
+<script language="JavaScript" type="text/javascript" src="{{ URL_ROOT }}/static/yaksh/js/moderator_dashboard.js"></script>
+{% endblock %}
+
{% block content %}
<center><h4>List of quizzes! Click on the given links to have a look at answer papers for a quiz.</h4></center>
@@ -49,18 +53,23 @@
{% endif %}
</center>
{% if trial_paper %}
- <h5/> You have trial papers.
+ <br/>
+ <p><center><strong> You have trial papers </strong><br/></center></p>
+ &nbsp;&nbsp;<input type="checkbox" class="selectall"/>&nbsp;&nbsp;Select all
+ <br/>
+ <div id="trial">
<table class="table table-bordered">
<form action="" method="post">
{% csrf_token %}
{% for paper in trial_paper %}
<tr>
- <td> <input type = "checkbox" name="delete_paper" value = {{paper.id}}></input></td>
+ <td> <input type = "checkbox" name="delete_paper" class="check" value = {{paper.id}}></input></td>
<td> <a href="{{URL_ROOT}}/exam/manage/gradeuser/{{paper.question_paper.quiz.id}}">{{paper.question_paper.quiz.description}}</a></td>
</tr>
{% endfor %}
</table>
<center><button class="btn" type="submit">Delete Selected</button></center>
</form>
+ </div>
{% endif %}
{% endblock %}