Skip to content

Read courses per-row Average Grade from HPPS - #8208

Draft
donnapep wants to merge 2 commits into
hpps-reports-courses-aggregatesfrom
hpps-reports-courses-avg-grade
Draft

Read courses per-row Average Grade from HPPS#8208
donnapep wants to merge 2 commits into
hpps-reports-courses-aggregatesfrom
hpps-reports-courses-avg-grade

Conversation

@donnapep

@donnapep donnapep commented Aug 25, 2026

Copy link
Copy Markdown
Member

SEN-83: HPPS: Reports Overview aggregates → table-aware

Part of the Reports → Overview HPPS effort. Stacked on hpps-reports-courses-aggregates.

Proposed Changes

  • Courses tab, per-row Average Grade column: primed from the grading stats service instead of per-row queries.

Testing Instructions

Setup (HPPS enabled):

  • Create Course A with a graded quiz lesson; enrol a student and grade the quiz at 80%.
  • Create Course B with no quizzes/grades.

Verify at Reports → Overview → Courses:

  • Course A's Average Grade row shows 80%.
  • Course B's Average Grade row shows N/A.
  • Export the CSV; the same values appear.
  • Turn HPPS off, reload, and confirm the values are identical.

Deprecated Code

This per-row filter no longer runs. No replacement:

  • sensei_analysis_course_percentage

@donnapep donnapep added this to the 4.26.4 milestone Aug 25, 2026
@donnapep donnapep added the Deprecation This change introduces a deprecation. label Aug 25, 2026
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

WordPress Playground Preview

The changes in this pull request can previewed and tested using a WordPress Playground instance.

Open WordPress Playground Preview

donnapep and others added 2 commits August 25, 2026 11:24
Course-scoped counterpart to get_grade_totals_by_user, needed so the
reports overview courses table can prime its per-row average grade
in one query per page instead of one query per course row.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replaces the per-row sensei_check_for_activity() + get_course_users_grades_sum()
calls with a single get_grade_totals_by_course() call primed once per page,
matching the pattern already used for the students table. Deprecates the
now-unused sensei_analysis_course_percentage filter.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@donnapep
donnapep force-pushed the hpps-reports-courses-aggregates branch from 07ac04a to 933b63d Compare August 25, 2026 15:26
@donnapep
donnapep force-pushed the hpps-reports-courses-avg-grade branch from 0558d49 to 39962d5 Compare August 25, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Deprecation This change introduces a deprecation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant