Skip to content

Commit

Permalink
Scheduling Assistant: Drop Last Active Class (Banner)
Browse files Browse the repository at this point in the history
- ignore canceled sections during the drop last active class check
  • Loading branch information
tomas-muller committed Jan 29, 2025
1 parent 2a22db3 commit afdd1e6
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ public List<EnrollmentFailure> enroll(OnlineSectioningServer server, OnlineSecti
if (course != null && e.getSections() != null)
for (XSection section: e.getSections()) {
dropEverything = false;
if (section.getTime().isActive(currentDateIndex)) {
if (section.getTime().isActive(currentDateIndex) && !section.isCancelled()) {
hasActiveClass = true; break e;
}
}
Expand All @@ -540,7 +540,7 @@ public List<EnrollmentFailure> enroll(OnlineSectioningServer server, OnlineSecti
if (request instanceof XCourseRequest && ((XCourseRequest)request).getEnrollment() != null) {
XEnrollment enrollment = ((XCourseRequest)request).getEnrollment();
for (XSection section: server.getOffering(enrollment.getOfferingId()).getSections(enrollment)) {
if (section.getTime().isActive(currentDateIndex)) {
if (section.getTime().isActive(currentDateIndex) && !section.isCancelled()) {
hadActiveClass = true;
break request;
}
Expand All @@ -563,7 +563,7 @@ public List<EnrollmentFailure> enroll(OnlineSectioningServer server, OnlineSecti
" StudentClassEnrollment e inner join e.student st inner join st.session s, " +
" Session z " +
"where " +
" st.externalUniqueId = :studentId and " +
" st.externalUniqueId = :studentId and e.clazz.cancelled = false and " +
" z.uniqueId = :sessionId and s != z and s.academicTerm = z.academicTerm and s.academicYear = z.academicYear ",
Long.class)
.setParameter("sessionId", server.getAcademicSession().getUniqueId())
Expand All @@ -580,7 +580,7 @@ public List<EnrollmentFailure> enroll(OnlineSectioningServer server, OnlineSecti
"where " +
" (c.datePattern = dp or (c.datePattern is null and ss.datePattern = dp) or (c.datePattern is null and ss.datePattern is null and dp = s.defaultDatePattern)) and " +
" adddate(dp.session.sessionBeginDateTime, -dp.offset + length(dp.pattern) - 1) >= :today and " +
" st.externalUniqueId = :studentId and " +
" st.externalUniqueId = :studentId and c.cancelled = false and " +
" z.uniqueId = :sessionId and s != z and s.academicTerm = z.academicTerm and s.academicYear = z.academicYear ",
Long.class)
.setParameter("sessionId", server.getAcademicSession().getUniqueId())
Expand Down

0 comments on commit afdd1e6

Please sign in to comment.