diff --git a/FusionIIIT/applications/online_cms/urls.py b/FusionIIIT/applications/online_cms/urls.py index f5d3996be..21068b974 100644 --- a/FusionIIIT/applications/online_cms/urls.py +++ b/FusionIIIT/applications/online_cms/urls.py @@ -7,75 +7,75 @@ urlpatterns = [ url(r'^$', views.viewcourses, name='viewcourses'), - url(r'^(?P[A-Z0-9]+)/(?P[\d.]+)/$', views.course, name='course'), - # url(r'^(?P[A-Z0-9]+)/edit_marks$', views.edit_marks, name='edit_marks'), - url(r'^(?P[A-Z0-9]+)/(?P[\d.]+)/get_exam_data$', views.get_exam_data, name='get_exam_data'), - url(r'^(?P[A-Z0-9]+)/(?P[\d.]+)/forum$', views.forum, + url(r'^(?P[A-Za-z0-9]+)/(?P[\d.]+)/$', views.course, name='course'), + # url(r'^(?P[A-Za-z0-9]+)/edit_marks$', views.edit_marks, name='edit_marks'), + url(r'^(?P[A-Za-z0-9]+)/(?P[\d.]+)/get_exam_data$', views.get_exam_data, name='get_exam_data'), + url(r'^(?P[A-Za-z0-9]+)/(?P[\d.]+)/forum$', views.forum, name='forum'), - url(r'^(?P[A-Z0-9]+)/(?P[\d.]+)/ajax_reply$', views.ajax_reply, + url(r'^(?P[A-Za-z0-9]+)/(?P[\d.]+)/ajax_reply$', views.ajax_reply, name='ajax_reply'), - url(r'^(?P[A-Z0-9]+)/(?P[\d.]+)/ajax_new$', views.ajax_new, + url(r'^(?P[A-Za-z0-9]+)/(?P[\d.]+)/ajax_new$', views.ajax_new, name='ajax_new'), - url(r'^(?P[A-Z0-9]+)/(?P[\d.]+)/ajax_remove$', views.ajax_remove, + url(r'^(?P[A-Za-z0-9]+)/(?P[\d.]+)/ajax_remove$', views.ajax_remove, name='ajax_remove'), - url(r'^(?P[A-Z0-9]+)/(?P[\d.]+)/upload_assignment$', views.upload_assignment, + url(r'^(?P[A-Za-z0-9]+)/(?P[\d.]+)/upload_assignment$', views.upload_assignment, name='upload_assignment'), - url(r'^(?P[A-Z0-9]+)/(?P[\d.]+)/add_modules$', views.add_modules, + url(r'^(?P[A-Za-z0-9]+)/(?P[\d.]+)/add_modules$', views.add_modules, name='add_modules'), - url(r'^(?P[A-Z0-9]+)/(?P[\d.]+)/add_documents$', views.add_document, + url(r'^(?P[A-Za-z0-9]+)/(?P[\d.]+)/add_documents$', views.add_document, name='add_document'), - url(r'^(?P[A-Z0-9]+)/(?P[\d.]+)/add_assignment$', + url(r'^(?P[A-Za-z0-9]+)/(?P[\d.]+)/add_assignment$', views.add_assignment, name='add_assignment'), - # url(r'^(?P[A-Z0-9]+)/add_video$', views.add_videos, + # url(r'^(?P[A-Za-z0-9]+)/add_video$', views.add_videos, # name='add_videos'), - url(r'^(?P[A-Z0-9]+)/(?P[\d.]+)/delete/$', views.delete, + url(r'^(?P[A-Za-z0-9]+)/(?P[\d.]+)/delete/$', views.delete, name='delete'), - url(r'^(?P[A-Z0-9]+)/(?P[\d.]+)/ajax_assess$', views.ajax_assess, + url(r'^(?P[A-Za-z0-9]+)/(?P[\d.]+)/ajax_assess$', views.ajax_assess, name='ajax_assess'), - url(r'^(?P[A-Z0-9]+)/(?P[\d.]+)/ajax_feedback$', views.ajax_feedback, + url(r'^(?P[A-Za-z0-9]+)/(?P[\d.]+)/ajax_feedback$', views.ajax_feedback, name='ajax_feedback'), url(r'^quiz/(?P[0-9]+)/$', views.quiz, name='quiz'), - url(r'^(?P[A-Z0-9]+)/create_quiz/$', views.create_quiz, name='create_quiz'), - url(r'^(?P[A-Z0-9]+)/edit_quiz/(?P[0-9]+)/$', + url(r'^(?P[A-Za-z0-9]+)/create_quiz/$', views.create_quiz, name='create_quiz'), + url(r'^(?P[A-Za-z0-9]+)/edit_quiz/(?P[0-9]+)/$', views.edit_quiz, name='edit_quiz'), - url(r'^(?P[A-Z0-9]+)/edit_quiz/(?P[0-9]+)/(?P[0-9]+)$', + url(r'^(?P[A-Za-z0-9]+)/edit_quiz/(?P[0-9]+)/(?P[0-9]+)$', views.edit_quiz_topic, name='edit_quiz_topic'), - url(r'^(?P[A-Z0-9]+)/(?P[0-9]+)/add_question_topic$', + url(r'^(?P[A-Za-z0-9]+)/(?P[0-9]+)/add_question_topic$', views.add_question_topicwise, name='add_question_topicwise'), url(r'^(?P[0-9]+?)/(?P[0-9]+)/add_questions_to_quiz$', views.add_questions_to_quiz, name='add_questions_to_quiz'), url( - r'^(?P[A-Z0-9]+)/(?P[0-9]+)/(?P[0-9]+)/remove_quiz_question$', + r'^(?P[A-Za-z0-9]+)/(?P[0-9]+)/(?P[0-9]+)/remove_quiz_question$', views.remove_quiz_question, name='remove_quiz_question'), - url(r'^(?P[A-Z0-9]+)/preview_quiz/(?P[0-9]+)/$', views.preview_quiz, + url(r'^(?P[A-Za-z0-9]+)/preview_quiz/(?P[0-9]+)/$', views.preview_quiz, name='preview_quiz'), - url(r'^(?P[A-Z0-9]+)/edit_quiz_details/(?P[0-9]+)/$', + url(r'^(?P[A-Za-z0-9]+)/edit_quiz_details/(?P[0-9]+)/$', views.edit_quiz_details, name='edit_quiz_details'), url(r'^(?P[0-9]+)/ajax$', views.ajax_q, name='ajax_q'), url(r'^(?P[0-9]+)/submit$', views.submit, name='submit'), - url(r'^(?P[A-Z0-9]+)/remove_quiz$', views.remove_quiz, + url(r'^(?P[A-Za-z0-9]+)/remove_quiz$', views.remove_quiz, name='remove_quiz'), - url(r'^(?P[A-Z0-9]+)/remove_bank$', views.remove_bank, + url(r'^(?P[A-Za-z0-9]+)/remove_bank$', views.remove_bank, name='remove_bank'), - url(r'^(?P[A-Z0-9]+)/remove_topic$', views.remove_topic, + url(r'^(?P[A-Za-z0-9]+)/remove_topic$', views.remove_topic, name='remove_topic'), - url(r'^(?P[A-Z0-9]+)/create_bank$', views.create_bank, + url(r'^(?P[A-Za-z0-9]+)/create_bank$', views.create_bank, name='create_bank'), - url(r'^(?P[A-Z0-9]+)/create_topic$', views.create_topic, + url(r'^(?P[A-Za-z0-9]+)/create_topic$', views.create_topic, name='create_topic'), - url(r'^(?P[A-Z0-9]+)/(?P[0-9]+)/(?P[0-9]+)$', + url(r'^(?P[A-Za-z0-9]+)/(?P[0-9]+)/(?P[0-9]+)$', views.edit_qb_topics, name='edit_qb_topics'), url(r'^(?P[0-9]+?)/(?P[0-9]+)/(?P[0-9]+)/add_question$', views.add_question, name='add_question'), - url(r'^(?P[A-Z0-9]+)/(?P[0-9]+)/(?P[0-9]+)/remove_question$', + url(r'^(?P[A-Za-z0-9]+)/(?P[0-9]+)/(?P[0-9]+)/remove_question$', views.remove_question, name='remove_question'), - url(r'^(?P[A-Z0-9]+)/edit_bank/(?P[0-9]+)$', + url(r'^(?P[A-Za-z0-9]+)/edit_bank/(?P[0-9]+)$', views.edit_bank, name='edit_bank'), - url(r'^(?P[A-Z0-9]+)/(?P[\d.]+)/attendance$', views.submit_attendance, + url(r'^(?P[A-Za-z0-9]+)/(?P[\d.]+)/attendance$', views.submit_attendance, name='submit_attendance'), - url(r'^(?P[A-Z0-9]+)/(?P[\d.]+)/add_attendance$', views.add_attendance, + url(r'^(?P[A-Za-z0-9]+)/(?P[\d.]+)/add_attendance$', views.add_attendance, name='add_attendance'), - url(r'^(?P[A-Z0-9]+)/(?P[\d.]+)/create_grading_scheme$', + url(r'^(?P[A-Za-z0-9]+)/(?P[\d.]+)/create_grading_scheme$', views.create_grading_scheme, name='Create_grading_scheme'), url(r'^admin/add_academic_calendar', views.add_academic_calendar, name='Add Calendar'), url(r'^admin/update_calendar', views.update_calendar, name='Add Calendar'), diff --git a/FusionIIIT/applications/online_cms/views.py b/FusionIIIT/applications/online_cms/views.py index 339abd537..e5983505f 100644 --- a/FusionIIIT/applications/online_cms/views.py +++ b/FusionIIIT/applications/online_cms/views.py @@ -401,7 +401,7 @@ def course(request, course_code, version): gradingscheme_grades = {} try: - student_grades = Student_grades.objects.select_related().filter(course_id=course) + student_grades = Student_grades.objects.select_related().filter(course_id=course).order_by('roll_no') except Student_grades.DoesNotExist: student_grades = {} diff --git a/FusionIIIT/templates/academic_procedures/academicfac.html b/FusionIIIT/templates/academic_procedures/academicfac.html index 53095463c..9a99d7def 100644 --- a/FusionIIIT/templates/academic_procedures/academicfac.html +++ b/FusionIIIT/templates/academic_procedures/academicfac.html @@ -146,7 +146,7 @@ - + {%if items.0.type != "Swayam" %} @@ -156,7 +156,7 @@ - + {%endif %} {% endfor %} diff --git a/FusionIIIT/templates/coursemanagement/manageEval.html b/FusionIIIT/templates/coursemanagement/manageEval.html index cddde7918..b7ca246ff 100644 --- a/FusionIIIT/templates/coursemanagement/manageEval.html +++ b/FusionIIIT/templates/coursemanagement/manageEval.html @@ -6,7 +6,7 @@ {% block manageEval %}

Manage Evaluations

- +

(Please Click on Generate button before uploading)

{% csrf_token %} @@ -17,7 +17,6 @@

Manage Evaluations

- - @@ -45,12 +43,11 @@

Manage Evaluations

{% else%} {% for stu in registered_students %} -
S.No. Roll No Total Marks (%) @@ -30,7 +29,6 @@

Manage Evaluations

{% if student_grades %} {% for row in student_grades %}
{{forloop.counter}}
{{forloop.counter}} - + @@ -60,7 +57,14 @@

Manage Evaluations

{% endif %}
- +
+ +
+ +
+
@@ -143,25 +147,28 @@

Manage Evaluations

}); } - - function searchByUsername() { - var input, filter, table, tr, td, i, txtValue; - input = document.getElementById("usernameSearchInput"); - filter = input.value.toUpperCase(); - table = document.getElementById("grading_table"); - tr = table.getElementsByTagName("tr"); - for (i = 0; i < tr.length; i++) { - td = tr[i].getElementsByTagName("td")[1]; - if (td) { - txtValue = td.getElementsByTagName("input")[0].value; - if (txtValue.toUpperCase().indexOf(filter) > -1) { - tr[i].style.display = ""; - } else { - tr[i].style.display = "none"; - } + + $(document).ready(function(){ + $('#grading_table th').click(function(){ + if ($(this).index() == 0) { + var table = $(this).parents('table').eq(0); + var rows = table.find('tr:gt(0)').toArray().sort(comparer($(this).index())); + this.asc = !this.asc; + if (!this.asc){rows = rows.reverse()} + for (var i = 0; i < rows.length; i++){table.append(rows[i])} } + }); + function comparer(index) { + return function(a, b) { + var valA = getCellValue(a, index), valB = getCellValue(b, index); + return $.isNumeric(valA) && $.isNumeric(valB) ? valA - valB : valA.toString().localeCompare(valB); + }; } - } + function getCellValue(row, index){ + // Get input value of the specified column + return $(row).find('input').eq(index).val(); + } + }); // Function to handle form submission function submitForm() { @@ -170,15 +177,19 @@

Manage Evaluations

var xhr = new XMLHttpRequest(); xhr.open(form.method, form.action, true); + $('#load_submit_grades').show(); xhr.onload = function () { if (xhr.status >= 200 && xhr.status < 300) { successAlert('Success: ' + xhr.responseText); // Display success message + $('#load_submit_grades').hide(); } else { alert('Error: ' + xhr.statusText); // Display error message + $('#load_submit_grades').hide(); } }; xhr.onerror = function () { alert('Request failed'); // Display request failure message + $('#load_submit_grades').hide(); }; xhr.send(formData); }