Skip to content

Commit

Permalink
Merge pull request #1644 from Akashsah2003/latest_staging
Browse files Browse the repository at this point in the history
feat(AC2): Removed minimum credits requirement to submit preregistration form
  • Loading branch information
dvjsharma authored Nov 4, 2024
2 parents c97c5b4 + c1c6832 commit e91aeee
Showing 1 changed file with 24 additions and 28 deletions.
52 changes: 24 additions & 28 deletions FusionIIIT/templates/academic_procedures/auto_pre_registration.html
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,6 @@

<br>
<br>
<CENTER>
<p>You need minimum {{curr_sem.curriculum.min_credit}} credits for semester {{next_sem.semester_no}}</p>
</CENTER>

{% endif %}
{% else %}
Expand Down Expand Up @@ -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');
});
// }
});
});

Expand Down

0 comments on commit e91aeee

Please sign in to comment.