Skip to content

Commit

Permalink
Student Sectioning Reports: Minor Improvements
Browse files Browse the repository at this point in the history
- filter: improved matching on subject area or course number where provided without an attribute (e.g., just putting in MGMT)
- reservations: when filtering by subject area or course, also match the course of the reservation
- unused reservations: better indicate a case where a student is enrolled in an alternative course instead
  • Loading branch information
tomas-muller committed Jul 17, 2024
1 parent 2301b02 commit 546df79
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
Binary file modified 3rd_party/sources/cpsolver-1.4-SNAPSHOT-sources.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3677,4 +3677,7 @@ public interface StudentSectioningMessages extends Messages {

@DefaultMessage("For an up to date schedule, please visit {0}.")
String textEmailLinkToUniTime(String baseUrl);

@DefaultMessage("Enrolled in {0} instead.")
String enrolledInAlt(String course);
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public CSVFile createTable(Assignment<Request, Enrollment> assignment, DataPrope
Set<Long> studentIds = new HashSet<Long>();
for (Course course: r.getOffering().getCourses())
for (CourseRequest cr: course.getRequests())
if (r.isApplicable(cr.getStudent()) && matches(cr))
if (r.isApplicable(cr.getStudent()) && matches(cr) && matches(offering.getCourse(cr.getStudent())))
studentIds.add(cr.getStudent().getId());
if (studentIds != null && !studentIds.isEmpty()) {
int assigned = 0, total = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,13 @@ public CSVFile createTable(Assignment<Request, Enrollment> assignment, DataPrope
} else if (reservation instanceof CourseReservation) {
studentIds = new HashSet<Long>();
for (CourseRequest cr: ((CourseReservation)reservation).getCourse().getRequests())
if (matches(cr))
if (matches(cr) && matches(offering.getCourse(cr.getStudent())))
studentIds.add(cr.getStudent().getId());
} else {
studentIds = new HashSet<Long>();
for (Course course: reservation.getOffering().getCourses())
for (CourseRequest cr: course.getRequests())
if (reservation.isApplicable(cr.getStudent()) && matches(cr))
if (reservation.isApplicable(cr.getStudent()) && matches(cr) && matches(offering.getCourse(cr.getStudent())))
studentIds.add(cr.getStudent().getId());
}
if (studentIds != null && !studentIds.isEmpty()) {
Expand Down Expand Up @@ -260,7 +260,12 @@ public int compare(Enrollment o1, Enrollment o2) {
});
Hashtable<CourseRequest, TreeSet<Section>> overlapingSections = new Hashtable<CourseRequest, TreeSet<Section>>();
List<Enrollment> av = courseRequest.getAvaiableEnrollmentsSkipSameTime(assignment);
if (av.isEmpty() || (av.size() == 1 && av.get(0).equals(courseRequest.getInitialAssignment()) && getModel().inConflict(assignment, av.get(0)))) {
if (enrollment != null) {
if (enrollment.getOffering().equals(reservation.getOffering()))
line.add(new CSVFile.CSVField(MSG.reservationNotUsed()));
else
line.add(new CSVFile.CSVField(MSG.enrolledInAlt(enrollment.getCourse().getName())));
} else if (av.isEmpty() || (av.size() == 1 && av.get(0).equals(courseRequest.getInitialAssignment()) && getModel().inConflict(assignment, av.get(0)))) {
if (courseRequest.getCourses().get(0).getLimit() >= 0)
line.add(new CSVFile.CSVField(MSG.courseIsFull()));
else if (SectioningRequest.hasInconsistentRequirements(courseRequest, null))
Expand Down Expand Up @@ -318,10 +323,7 @@ else if (!i.hasNext())
}
line.add(new CSVFile.CSVField(message));
} else {
if (courseRequest.getAssignment(assignment) == null)
line.add(new CSVFile.CSVField(MSG.courseNotAssigned()));
else
line.add(new CSVFile.CSVField(MSG.reservationNotUsed()));
line.add(new CSVFile.CSVField(MSG.courseNotAssigned()));
}
}
}
Expand Down
Binary file modified WebContent/WEB-INF/lib/cpsolver-1.4-SNAPSHOT.jar
Binary file not shown.

0 comments on commit 546df79

Please sign in to comment.