From fc31a83870f37ffc1d89d16cd2829c2c3a045069 Mon Sep 17 00:00:00 2001 From: Aaron Detre Date: Wed, 22 Jul 2026 15:22:44 -0700 Subject: [PATCH 1/4] Remove available actions column --- src/main/webapp/portal/admin/run/stats.jsp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/webapp/portal/admin/run/stats.jsp b/src/main/webapp/portal/admin/run/stats.jsp index 202a7b7a5..c2b40394e 100644 --- a/src/main/webapp/portal/admin/run/stats.jsp +++ b/src/main/webapp/portal/admin/run/stats.jsp @@ -35,14 +35,15 @@ th {

${period} (${fn:length(runs)} )

- + + - + @@ -57,8 +58,6 @@ th { - From 16cf80641a8b8b067b12bbda80692ffbbd3b2900 Mon Sep 17 00:00:00 2001 From: Aaron Detre Date: Fri, 24 Jul 2026 10:49:24 -0700 Subject: [PATCH 2/4] Sort runs descending by id --- .../java/org/wise/portal/dao/run/impl/HibernateRunDao.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/wise/portal/dao/run/impl/HibernateRunDao.java b/src/main/java/org/wise/portal/dao/run/impl/HibernateRunDao.java index e546ae2a3..4462ae01d 100644 --- a/src/main/java/org/wise/portal/dao/run/impl/HibernateRunDao.java +++ b/src/main/java/org/wise/portal/dao/run/impl/HibernateRunDao.java @@ -176,7 +176,9 @@ public List getRunsRunWithinTimePeriod(String timePeriod) { Calendar c = Calendar.getInstance(); c.add(Calendar.DAY_OF_YEAR, -days); Date compareDate = c.getTime(); - cq.select(runRoot).where(cb.greaterThanOrEqualTo(runRoot.get("lastRun"), compareDate)); + cq.select(runRoot) + .where(cb.greaterThanOrEqualTo(runRoot.get("lastRun"), compareDate)) + .orderBy(cb.desc(runRoot.get("id"))); TypedQuery query = entityManager.createQuery(cq); List runResultList = query.getResultList(); return (List) (Object) runResultList; From e8541b018339c3beed7eb59767ccc44962411e4d Mon Sep 17 00:00:00 2001 From: Aaron Detre Date: Fri, 24 Jul 2026 10:54:28 -0700 Subject: [PATCH 3/4] Id links to unit preview --- src/main/webapp/portal/admin/run/stats.jsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/portal/admin/run/stats.jsp b/src/main/webapp/portal/admin/run/stats.jsp index c2b40394e..f0caef694 100644 --- a/src/main/webapp/portal/admin/run/stats.jsp +++ b/src/main/webapp/portal/admin/run/stats.jsp @@ -48,7 +48,7 @@ th { - +
()
() () ${period}
${fn:length(run.studentAttendance)} ${run.timesRun} -
${run.id} (${run.runcode})${run.id} (${run.runcode}) ${run.name} (${run.project.wiseVersion}) ${run.owner.userDetails.username}
From a5c7772388a869a9d6e58b92310eebc102ed1448 Mon Sep 17 00:00:00 2001 From: Aaron Detre Date: Fri, 24 Jul 2026 11:34:00 -0700 Subject: [PATCH 4/4] Show access count sums for all listed runs --- .../admin/RunStatisticsController.java | 21 ++++++++++++++++--- src/main/resources/i18n/i18n.properties | 4 ++++ src/main/webapp/portal/admin/run/stats.jsp | 11 ++++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/wise/portal/presentation/web/controllers/admin/RunStatisticsController.java b/src/main/java/org/wise/portal/presentation/web/controllers/admin/RunStatisticsController.java index 1a84d0611..4b4ea38a3 100644 --- a/src/main/java/org/wise/portal/presentation/web/controllers/admin/RunStatisticsController.java +++ b/src/main/java/org/wise/portal/presentation/web/controllers/admin/RunStatisticsController.java @@ -34,7 +34,6 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; import org.wise.portal.domain.attendance.StudentAttendance; import org.wise.portal.domain.run.Run; import org.wise.portal.service.attendance.StudentAttendanceService; @@ -79,13 +78,29 @@ protected String showRunStatistics( } modelMap.put("runs", runs); modelMap.put("period", period); + modelMap.put("totalAttendanceWithinLookBackPeriod", getTotalAttendanceWithinPeriod(runs)); + modelMap.put("totalAttendance", getTotalAttendance(runs)); return "admin/run/stats"; } @RequestMapping(value = "/admin/run/stats-by-activity", method = RequestMethod.GET) protected String showRunStatisticsByActivity(HttpServletRequest request, ModelMap modelMap) throws Exception { - modelMap.put("runs", runService.getRunsByActivity()); + List runs = runService.getRunsByActivity(); + modelMap.put("runs", runs); + modelMap.put("totalAttendance", getTotalAttendance(runs)); return "admin/run/stats"; } -} + + private int getTotalAttendanceWithinPeriod(List runs) { + return runs.stream() + .map(run -> run.getStudentAttendance().size()) + .reduce(0, (acc, timesRun) -> acc += timesRun); + } + + private int getTotalAttendance(List runs) { + return runs.stream() + .map(run -> run.getTimesRun()) + .reduce(0, (acc, timesRun) -> acc += timesRun); + } +} \ No newline at end of file diff --git a/src/main/resources/i18n/i18n.properties b/src/main/resources/i18n/i18n.properties index 92d0bd5d2..fa378a33d 100644 --- a/src/main/resources/i18n/i18n.properties +++ b/src/main/resources/i18n/i18n.properties @@ -628,6 +628,10 @@ admin.run.manageSharedTeachers=Manage shared teachers admin.run.manageSharedTeachers.description=Text for 'Manage shared teachers' to allow admins to manage shared teachers of a run admin.run.manageStudents=Manage students admin.run.manageStudents.description=Text for 'Manage students' to allow admins to manage students in a run +admin.run.accessCountWithinPeriodAllListed=Total access count of these runs +admin.run.accessCountWithinPeriodAllListed.description=Text for total access count of all listed runs within the given timeframe +admin.run.totalAccessCountAllListed=Total access count of these runs +admin.run.totalAccessCountAllListed.description=Text for total access count of all listed runs admin.news.newsItems=News Items admin.news.newsItems.description=Text for 'News Items' in admin portal admin.news.addNewsItem=Add News Item diff --git a/src/main/webapp/portal/admin/run/stats.jsp b/src/main/webapp/portal/admin/run/stats.jsp index f0caef694..552c5f2d6 100644 --- a/src/main/webapp/portal/admin/run/stats.jsp +++ b/src/main/webapp/portal/admin/run/stats.jsp @@ -33,6 +33,17 @@ th {

${period} (${fn:length(runs)} )

+
+ + +

+ + ${period}: ${totalAttendanceWithinLookBackPeriod} +

+
+

: ${totalAttendance}

+
+