diff options
-rw-r--r-- | yaksh/admin.py | 2 | ||||
-rw-r--r-- | yaksh/static/yaksh/js/moderator_dashboard.js | 14 | ||||
-rw-r--r-- | yaksh/templates/yaksh/add_quiz.html | 11 | ||||
-rw-r--r-- | yaksh/templates/yaksh/course_detail.html | 125 | ||||
-rw-r--r-- | yaksh/templates/yaksh/courses.html | 1 | ||||
-rw-r--r-- | yaksh/templates/yaksh/moderator_dashboard.html | 28 | ||||
-rw-r--r-- | yaksh/views.py | 4 |
7 files changed, 161 insertions, 24 deletions
diff --git a/yaksh/admin.py b/yaksh/admin.py index 72496b2..79d4930 100644 --- a/yaksh/admin.py +++ b/yaksh/admin.py @@ -6,7 +6,7 @@ from django.contrib import admin class AnswerPaperAdmin(admin.ModelAdmin): search_fields = ['user__first_name', 'user__last_name','user__username', - "question_paper__quiz__description" ] + "question_paper__quiz__description","user_ip" ] admin.site.register(Question) diff --git a/yaksh/static/yaksh/js/moderator_dashboard.js b/yaksh/static/yaksh/js/moderator_dashboard.js new file mode 100644 index 0000000..e40e67e --- /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); + }); + } + }); +}); diff --git a/yaksh/templates/yaksh/add_quiz.html b/yaksh/templates/yaksh/add_quiz.html index 38773b5..08bb124 100644 --- a/yaksh/templates/yaksh/add_quiz.html +++ b/yaksh/templates/yaksh/add_quiz.html @@ -41,11 +41,11 @@ <button class="btn" type="button" name="button" onClick='usermode("{{URL_ROOT}}/exam/manage/usermode/{{quiz_id}}");'>User Mode</button> <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/godmode/{{quiz_id}}");'>God Mode</button> - <a href="" onclick="$('#help').show(); return false;">Help </a> - </center> - <br/> - <div style="display: none;" id="help"> - <ol> + <a data-toggle="collapse" data-target="#help"> + <span class="glyphicon glyphicon-info-sign">Help</span></a> + <div id="help" class="collapse"> + <br/> + <ul> <li><b>User Mode:</b> Attempt quiz the way normal users will attempt i.e. - <ul> <li><i>Quiz will have the same duration as that of the original quiz.</li> @@ -54,7 +54,6 @@ </ul> </p> <li> <b>God Mode:</b> Attempt quiz without any time or eligibilty constraints.</p> - <a href="" onclick="$('#help').hide(); return false"> Close </a> </div> {% endif %} <style type="text/css"> diff --git a/yaksh/templates/yaksh/course_detail.html b/yaksh/templates/yaksh/course_detail.html index 57193fe..5fb92f9 100644 --- a/yaksh/templates/yaksh/course_detail.html +++ b/yaksh/templates/yaksh/course_detail.html @@ -26,9 +26,48 @@ <div class="row"> <div class="col-md-3" style="padding-top:10px"> <input type="checkbox" name="check" value="{{ request.id }}"> - <a href="#" data-toggle="tooltip" title=" Full Name: {{ request.get_full_name }}
Institute: {{ request.profile.institute }}
Department: {{ request.profile.department}}
Roll Number: {{ request.profile.roll_number }}"> {{ request.username }}</a> + <a href="#" data-toggle="modal" data-target="#request_detail_{{forloop.counter}}"> + {{ request.username }}</a> + <div class="modal fade" id="request_detail_{{forloop.counter}}" role="dialog"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal">×</button> + <h4 class="modal-title">Information for {{ request.username }} </h4> + </div> + <div class="modal-body"> + <table> + <tr> + <td><strong>Full Name :</strong></td> + <td> {{request.get_full_name}}</td> + </tr> + <tr> + <td><strong>Email ID :</strong></td> + <td> {{request.email}}</td> + </tr> + <tr> + <td><strong>Roll Number :</strong></td> + <td> {{request.profile.roll_number}}</td> + </tr> + <tr> + <td><strong>Institute :</strong></td> + <td> {{request.profile.institute}}</td> + </tr> + <tr> + <td><strong>Department :</strong></td> + <td> {{request.profile.department}}</td> + </tr> + <tr> + </table> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> + </div> + </div> + </div> + </div> </div> - <a class="btn success" href="{{URL_ROOT}}/exam/manage/enroll/{{ course.id }}/{{ request.id }}/"> Enroll </a> <a class="btn danger" href="{{URL_ROOT}}/exam/manage/reject/{{ course.id }}/{{ request.id }}/"> Reject </a> + <a class="btn btn-success" href="{{URL_ROOT}}/exam/manage/enroll/{{ course.id }}/{{ request.id }}/"> Enroll </a> <a class="btn btn-danger" href="{{URL_ROOT}}/exam/manage/reject/{{ course.id }}/{{ request.id }}/"> Reject </a> </div> </div> {% endfor %} @@ -49,7 +88,46 @@ <div class="row"> <div class="col-md-4" style="padding-top:10px"> <input type="checkbox" name="check" value="{{ rejected.id }}"> - <a href="#" data-toggle="tooltip" title=" Full Name: {{ rejected.get_full_name }}
Institute: {{ rejected.profile.institute }}
Department: {{ rejected.profile.department}}
Roll Number: {{ rejected.profile.roll_number }}"> {{ rejected.username }}</a> + <a href="#" data-toggle="modal" data-target="#reject_detail_{{forloop.counter}}"> + {{ rejected.username }}</a> + <div class="modal fade" id="reject_detail_{{forloop.counter}}" role="dialog"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal">×</button> + <h4 class="modal-title">Information for {{ rejected.username }} </h4> + </div> + <div class="modal-body"> + <table> + <tr> + <td><strong>Full Name :</strong></td> + <td> {{rejected.get_full_name}}</td> + </tr> + <tr> + <td><strong>Email ID :</strong></td> + <td> {{rejected.email}}</td> + </tr> + <tr> + <td><strong>Roll Number :</strong></td> + <td> {{rejected.profile.roll_number}}</td> + </tr> + <tr> + <td><strong>Institute :</strong></td> + <td> {{rejected.profile.institute}}</td> + </tr> + <tr> + <td><strong>Department :</strong></td> + <td> {{rejected.profile.department}}</td> + </tr> + <tr> + </table> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> + </div> + </div> + </div> + </div> </div> <a class="btn btn-success" href="{{URL_ROOT}}/exam/manage/enroll/rejected/{{ course.id }}/{{ rejected.id }}/"> Enroll </a> </div> @@ -75,7 +153,46 @@ <div class="row"> <div class="col-md-4" style="padding-top:10px"> <input type="checkbox" name="check" value="{{ enrolled.id }}"> - <a href="#" data-toggle="tooltip" title=" Full Name: {{ enrolled.get_full_name }}
Institute: {{ enrolled.profile.institute }}
Department: {{ enrolled.profile.department}}
Roll Number: {{ enrolled.profile.roll_number }}"> {{ enrolled.username }}</a> + <a href="#" data-toggle="modal" data-target="#enroll_detail_{{forloop.counter}}"> + {{ enrolled.username }}</a> + <div class="modal fade" id="enroll_detail_{{forloop.counter}}" role="dialog"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal">×</button> + <h4 class="modal-title">Information for {{ enrolled.username }} </h4> + </div> + <div class="modal-body"> + <table> + <tr> + <td><strong>Full Name :</strong></td> + <td> {{enrolled.get_full_name}}</td> + </tr> + <tr> + <td><strong>Email ID :</strong></td> + <td> {{enrolled.email}}</td> + </tr> + <tr> + <td><strong>Roll Number :</strong></td> + <td> {{enrolled.profile.roll_number}}</td> + </tr> + <tr> + <td><strong>Institute :</strong></td> + <td> {{enrolled.profile.institute}}</td> + </tr> + <tr> + <td><strong>Department :</strong></td> + <td> {{enrolled.profile.department}}</td> + </tr> + <tr> + </table> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> + </div> + </div> + </div> + </div> </div> <a class="btn btn-danger" href="{{URL_ROOT}}/exam/manage/enrolled/reject/{{ course.id }}/{{ enrolled.id }}/"> Reject </a> </div> diff --git a/yaksh/templates/yaksh/courses.html b/yaksh/templates/yaksh/courses.html index b7cc2e1..970d488 100644 --- a/yaksh/templates/yaksh/courses.html +++ b/yaksh/templates/yaksh/courses.html @@ -146,6 +146,7 @@ </div> <br/> <button class="btn btn-primary pull-right"type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/addquiz/{{course.id}}/");'>Add New Quiz</button> + <p><a href="{{URL_ROOT}}/exam/manage/courses/download_course_csv/{{course.id}}">Download CSV</a></p> </div> </div> <br><br> diff --git a/yaksh/templates/yaksh/moderator_dashboard.html b/yaksh/templates/yaksh/moderator_dashboard.html index 3f3c123..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> @@ -30,40 +34,42 @@ <center> <h5>Click on the button given below to add a new course.</h5> <button class="btn" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/add_course");'>Add New Course</button> - <h5>Click on the button to Create a Demo course. - <a href="" onclick="$('#help').show(); return false;">Help </a></h5> + <h5>Click on the button to Create a Demo course.</h5> <button class="btn" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/create_demo_course");'>Create Demo Course</button> - <div style="display: none;" id="help"> - <ol> + <a data-toggle="collapse" data-target="#help"> + <span class="glyphicon glyphicon-info-sign">Help</span></a> + <div id="help" class="collapse"> <ul> <li>A Demo Course and Demo Quiz will be created (Click Courses link on nav bar to view courses).</li> <li>Some Demo Questions are also created for you (Click Questions link on nav bar to view questions).</li> <li>In Courses you can view Demo Quiz.</li> - <li>Click on the Demo Quiz and Click on User Mode or God Mode to take the quiz. - </li> - <li>You can also edit the Demo quiz. - </li> + <li>Click on the Demo Quiz and Click on User Mode or God Mode to take the quiz.</li> + <li>You can also edit the Demo quiz.</li> </ul> </p> - <a href="" onclick="$('#help').hide(); return false"> Close </a> </div> {% if msg %} <h4>{{ msg }}</h4> {% endif %} </center> {% if trial_paper %} - <h5/> You have trial papers. + <br/> + <p><center><strong> You have trial papers </strong><br/></center></p> + <input type="checkbox" class="selectall"/> 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 %} diff --git a/yaksh/views.py b/yaksh/views.py index c4e8b61..605d3f2 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -639,7 +639,7 @@ def enroll(request, course_id, user_id=None, was_rejected=False): if request.method == 'POST': enroll_ids = request.POST.getlist('check') else: - enroll_ids = user_id + enroll_ids = [user_id] if not enroll_ids: return my_render_to_response('yaksh/course_detail.html', {'course': course}, context_instance=ci) @@ -662,7 +662,7 @@ def reject(request, course_id, user_id=None, was_enrolled=False): if request.method == 'POST': reject_ids = request.POST.getlist('check') else: - reject_ids = user_id + reject_ids = [user_id] if not reject_ids: return my_render_to_response('yaksh/course_detail.html', {'course': course}, context_instance=ci) |