From c1c68320dce3fb2d6a79eb24a09b6cbc7cd6de50 Mon Sep 17 00:00:00 2001 From: Akash Kumar Sah Date: Tue, 5 Nov 2024 01:00:48 +0530 Subject: [PATCH] feat(AC2): Removed minimum credits requirement to submit preregistration form --- .../auto_pre_registration.html | 52 +++++++++---------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/FusionIIIT/templates/academic_procedures/auto_pre_registration.html b/FusionIIIT/templates/academic_procedures/auto_pre_registration.html index 7c0e885be..760b26367 100644 --- a/FusionIIIT/templates/academic_procedures/auto_pre_registration.html +++ b/FusionIIIT/templates/academic_procedures/auto_pre_registration.html @@ -254,9 +254,6 @@

-
-

You need minimum {{curr_sem.curriculum.min_credit}} credits for semester {{next_sem.semester_no}}

-
{% endif %} {% else %} @@ -302,42 +299,41 @@ let course_priority = document.getElementsByName("course_priority-" + course_slot_id); let unique_choices = new Set(); for (let j = 0; j < course_priority.length; j++) { - // // console.log("course_priority-" + course_slot_id , course_priority[j].value ) - if ((!(course_slot_type.startsWith("Open") && course_slot_type != "Open Elective") && !course_slot_type.startsWith("Swayam") )&& course_priority[j].value == "NULL") { + if ((!(course_slot_type.startsWith("Optional")) && !course_slot_type.startsWith("Swayam") )&& course_priority[j].value == "NULL") { alert("Please select all choices for " + parseInt(i + 1) + " " + course_slot_type + " slot"); document.getElementById('register-button').style = "text-allign:center;"; return false; } let selected_course = course_priority[j].value.split("-"); unique_choices.add(selected_course[1]); - if (course_priority[0].value != "NULL" && course_priority[j].value.split("-")[0] == '1' ) { + if ((i==0 || course_slots[i].value != course_slots[i-1].value) && j==0 && course_priority[0].value != "NULL" && course_priority[j].value.split("-")[0] == '1' ) { count = count + parseInt(credits[i].innerHTML); + console.log(count) } } - } - // alert("Total Credits for Registered Courses :" + count); - - var minimum_credits = parseInt(document.getElementById("mincr").value); - if (count < minimum_credits) { - alert("You Can't Register as Minimum Credits: " + minimum_credits); - return false; - } else { - event.preventDefault(); - var friendForm = $(this); - console.log(friendForm.serialize()); - var posting = $.post(friendForm.attr('action'), friendForm.serialize()); - // if success - posting.done(function (data) { - alert('You have successfully registered'); - window.location = "/academic-procedures/stu"; - }); - //if failure - posting.fail(function (data) { - alert('Registration Failed'); - }); - } + alert("Total Credits for Registered Courses :" + count); + + // var minimum_credits = parseInt(document.getElementById("mincr").value); + // if (count < minimum_credits) { + // alert("You Can't Register as Minimum Credits: " + minimum_credits); + // return false; + // } else { + event.preventDefault(); + var friendForm = $(this); + console.log(friendForm.serialize()); + var posting = $.post(friendForm.attr('action'), friendForm.serialize()); + // if success + posting.done(function (data) { + alert('You have successfully registered'); + window.location = "/academic-procedures/stu"; + }); + //if failure + posting.fail(function (data) { + alert('Registration Failed'); + }); + // } }); });