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');
+ });
+ // }
});
});