Skip to content

refactor: shift grade summary calculation to backend#42

Merged
nsprenkle merged 2 commits intorelease-teakfrom
nsprenkle/assignment-grade-summary-backend
Jan 7, 2026
Merged

refactor: shift grade summary calculation to backend#42
nsprenkle merged 2 commits intorelease-teakfrom
nsprenkle/assignment-grade-summary-backend

Conversation

@nsprenkle
Copy link
Member

Cherry-picks the following change from (openedx#1797). This is required for changes to the exams page plugins ( https://github.com/edx/frontend-plugins/pull/111) to work.

refactor: shift grade summary calculation to backend and display "hidden grades" label in the grade table (openedx#1797)

Refactors the grade summary logic to delegate all calculation responsibilities to the backend. Previously, the frontend was performing grade summary computations using data fetched from the API. Now, the API itself provides the fully computed grade summary, simplifying the frontend and ensuring consistent results across clients.

Additionally, a "Hidden Grades" label has been added in the grade summary table to clearly indicate sections where grades are not visible to learners.

Finally, for visibility settings that depend on the due date, this PR adds a banner on the Progress page indicating that grades are not yet released, along with the relevant due date information.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request refactors grade summary calculation by moving the computational logic from the frontend to the backend. The backend now provides fully computed grade summaries, simplifying the frontend implementation and ensuring consistency. Additionally, the PR introduces visual indicators for hidden grades, including a "Hidden Scores" label and lock icons in the grade summary table, along with a banner on the Progress page that displays the due date for pending grade releases.

  • Removed frontend grade calculation logic from api.js and replaced it with backend-provided assignmentTypeGradeSummary and finalGrades data
  • Added UI elements to display hidden grades: lock icons for fully hidden assignment types and "% + Hidden Scores" labels for partially hidden types
  • Implemented a due date notice banner that appears when grades are pending release

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/course-home/progress-tab/utils.ts Added getLatestDueDateInFuture utility function to find the latest future grade publish date
src/course-home/progress-tab/grades/messages.ts Added new internationalization messages for hidden scores labels and due date notice
src/course-home/progress-tab/grades/grade-summary/GradeSummaryTableFooter.jsx Replaced frontend grade calculation with backend-provided finalGrades data
src/course-home/progress-tab/grades/grade-summary/GradeSummaryTable.jsx Added legend and logic to display lock icons and "Hidden Scores" labels based on hasHiddenContribution property
src/course-home/progress-tab/grades/grade-summary/GradeSummary.jsx Updated to use assignmentTypeGradeSummary instead of assignmentPolicies
src/course-home/progress-tab/grades/course-grade/CurrentGradeTooltip.jsx Added "+ Hidden Scores" indicator to the grade tooltip when applicable
src/course-home/progress-tab/grades/course-grade/CourseGradeFooter.jsx Refactored into smaller components and added due date notice banner for pending grades
src/course-home/progress-tab/ProgressTab.test.jsx Updated tests to validate hidden grades display and due date notice functionality
src/course-home/data/api.js Removed frontend grade calculation functions (calculateAssignmentTypeGrades and normalizeAssignmentPolicies)
src/course-home/data/__factories__/progressTabData.factory.js Added final_grades and assignment_type_grade_summary to test factory data

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Anas12091101 and others added 2 commits January 5, 2026 15:59
Refactors the grade summary logic to delegate all calculation responsibilities to the backend.
Previously, the frontend was performing grade summary computations using data fetched from the API. Now, the API itself provides the fully computed grade summary, simplifying the frontend and ensuring consistent results across clients.

Additionally, a "Hidden Grades" label has been added in the grade summary table to clearly indicate sections where grades are not visible to learners.

Finally, for visibility settings that depend on the due date, this PR adds a banner on the Progress page indicating that grades are not yet released, along with the relevant due date information.
@nsprenkle nsprenkle force-pushed the nsprenkle/assignment-grade-summary-backend branch from fd728de to 51844a6 Compare January 5, 2026 20:59
@nsprenkle
Copy link
Member Author

NOTE that I'm ignoring all the Copilot suggestions as they are on the original commit which I'm just cherry-picking as-is.

@nsprenkle nsprenkle merged commit a0f01cb into release-teak Jan 7, 2026
4 checks passed
@nsprenkle nsprenkle deleted the nsprenkle/assignment-grade-summary-backend branch January 7, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants