Skip to content

Commit d694e64

Browse files
committed
Solver Reports: Course Request Alternatives Statistics
- added Course Request Alternatives Statistics report, an experimental report comparing course requests and advisor recommendations with and without alternatives - only available to user roles with Student Sectioning Solver Admin Reports role
1 parent 92e031e commit d694e64

7 files changed

Lines changed: 574 additions & 3 deletions

File tree

JavaSource/org/unitime/timetable/gwt/resources/StudentSectioningMessages.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3812,4 +3812,7 @@ public interface StudentSectioningMessages extends Messages {
38123812

38133813
@DefaultMessage("Not-Assigned Associated Course Issues")
38143814
String reportDependentCourseIssues();
3815+
3816+
@DefaultMessage("Course Request Alternatives Statistics")
3817+
String reportCourseRequestAltStats();
38153818
}

JavaSource/org/unitime/timetable/onlinesectioning/advisors/AdvisorGetCourseRequests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ else if (reservation instanceof LearningCommunityReservation)
353353
return request;
354354
}
355355

356-
protected static void fillCourseRequests(CourseRequestInterface request, List<AdvisorCourseRequest> acrs) {
356+
public static void fillCourseRequests(CourseRequestInterface request, List<AdvisorCourseRequest> acrs) {
357357
int last = -1;
358358
CourseRequestInterface.Request r = null;
359359
Set<Integer> skip = new HashSet<Integer>();

JavaSource/org/unitime/timetable/security/permissions/StudentSchedulingPermissions.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ public boolean check(UserContext user, Session source) {
7777
@PermissionForRight(Right.StudentSectioningSolverReports)
7878
public static class StudentSectioningSolverReports extends StudentSectioningSolverDashboard {}
7979

80+
@PermissionForRight(Right.StudentSectioningSolverAdminReports)
81+
public static class StudentSectioningSolverAdminReports extends StudentSectioningSolverReports {}
82+
8083
@PermissionForRight(Right.StudentSectioningSolverSave)
8184
public static class StudentSectioningSolverSave extends StudentScheduling {}
8285

JavaSource/org/unitime/timetable/security/rights/Right.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ public enum Right {
337337
StudentSectioningSolverLog(Session.class),
338338
StudentSectioningSolverDashboard(Session.class),
339339
StudentSectioningSolverReports(Session.class),
340+
StudentSectioningSolverAdminReports(Session.class),
340341
StudentSectioningSolutionExportXml(Session.class),
341342
StudentSectioningSolverPublish(Session.class),
342343

JavaSource/org/unitime/timetable/server/sectioning/CourseRequestAltStats.java

Lines changed: 548 additions & 0 deletions
Large diffs are not rendered by default.

JavaSource/org/unitime/timetable/server/sectioning/SectioningReportTypesBackend.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import org.unitime.timetable.reports.studentsct.UnasignedCourseRequests;
4848
import org.unitime.timetable.reports.studentsct.UnusedReservations;
4949
import org.unitime.timetable.security.SessionContext;
50+
import org.unitime.timetable.security.rights.Right;
5051
import org.unitime.timetable.solver.service.SolverService;
5152
import org.unitime.timetable.solver.studentsct.StudentSolverProxy;
5253

@@ -102,17 +103,23 @@ public static enum ReportType {
102103
SECTIONING_ISSUES_ALL(SCT_MSG.reportSectioningIssuesAllCourses(), SectioningIssuesReport.class.getName(), "all", "true"),
103104
RESERVATIONS(SCT_MSG.reportReservations(), Reservations.class.getName()),
104105
DEPENDENT_OFFERINGS_ISSUES(SCT_MSG.reportDependentCourseIssues(), DependentCourseIssues.class.getName()),
106+
CRS_ALTS(true, SCT_MSG.reportCourseRequestAltStats(), CourseRequestAltStats.class.getName()),
105107
;
106108

107109
String iName, iImplementation;
108110
String[] iParameters;
111+
boolean iAdmin;
112+
ReportType(boolean admin, String name, String implementation, String... params) {
113+
iAdmin = admin; iName = name; iImplementation = implementation; iParameters = params;
114+
}
109115
ReportType(String name, String implementation, String... params) {
110-
iName = name; iImplementation = implementation; iParameters = params;
116+
this(false, name, implementation, params);
111117
}
112118

113119
public String getName() { return iName; }
114120
public String getImplementation() { return iImplementation; }
115121
public String[] getParameters() { return iParameters; }
122+
public boolean isAdmin() { return iAdmin; }
116123
public ReportTypeInterface toReportTypeInterface() {
117124
return new ReportTypeInterface(name(), iName, iImplementation, true, iParameters);
118125
}
@@ -121,8 +128,10 @@ public ReportTypeInterface toReportTypeInterface() {
121128
@Override
122129
public GwtRpcResponseList<ReportTypeInterface> execute(SectioningReportTypesRpcRequest request, SessionContext context) {
123130
GwtRpcResponseList<ReportTypeInterface> ret = new GwtRpcResponseList<ReportTypeInterface>();
131+
boolean includeAdmins = context.hasPermission(Right.StudentSectioningSolverAdminReports);
124132
for (ReportType type: ReportType.values())
125-
ret.add(type.toReportTypeInterface());
133+
if (!type.isAdmin() || includeAdmins)
134+
ret.add(type.toReportTypeInterface());
126135

127136
if (!request.isOnline()) {
128137
StudentSolverProxy solver = studentSectioningSolverService.getSolver();

WebContent/help/Release-Notes.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@
4545
<line>Skip revalidation for a course that was made not offered (avoid null exception).</line>
4646
</description>
4747
</item>
48+
<item>
49+
<name>Solver Reports: Course Request Alternatives Statistics</name>
50+
<description>
51+
<line>Added Course Request Alternatives Statistics report, an experimental report comparing course requests and advisor recommendations with and without alternatives.</line>
52+
<line>Only available to user roles with Student Sectioning Solver Admin Reports role.</line>
53+
</description>
54+
</item>
4855
</category>
4956
<category>
5057
<title>Event Management</title>

0 commit comments

Comments
 (0)