-
Notifications
You must be signed in to change notification settings - Fork 3
chore: cherry-pick API update for calculating grade summary #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release-ulmo
Are you sure you want to change the base?
Conversation
…ade (openedx#37399) This commit migrates the data calculation logic for the GradeSummary table, which was previously in the frontend-app-learning. This commit also introduces a new visibility option for assignment scores: “Never show individual assessment results, but show overall assessment results after the due date.” With this option, learners cannot see question-level correctness or scores at any time. However, once the due date has passed, they can view their overall score in the total grades section on the Progress page. These two changes are coupled with each other because it compromises the integrity of this data to do the score hiding logic on the front end. The corresponding frontend PR is: openedx/frontend-app-learning#1797
There was a problem hiding this 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 PR cherry-picks changes from the main edx-platform repository to add a new grade visibility option called "never_but_include_grade". This option allows course teams to hide individual problem correctness from learners while still including those grades in the final grade calculation after the due date.
Key Changes:
- Adds a new
NEVER_BUT_INCLUDE_GRADEconstant to theShowCorrectnessclass for managing grade visibility - Implements API endpoints to aggregate and summarize assignment-type grades with proper visibility filtering
- Updates the progress page template to correctly distinguish between grade display and grade calculation logic
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
xmodule/graders.py |
Adds the NEVER_BUT_INCLUDE_GRADE constant and updates correctness_available() to treat it like NEVER for display purposes |
xmodule/tests/test_graders.py |
Adds test coverage for the new NEVER_BUT_INCLUDE_GRADE option |
lms/djangoapps/grades/subsection_grade.py |
Updates show_grades() method to handle grade inclusion logic for NEVER_BUT_INCLUDE_GRADE based on due dates |
lms/templates/courseware/progress.html |
Updates template to use ShowCorrectness.correctness_available() instead of show_grades() for display logic |
lms/djangoapps/courseware/tests/test_views.py |
Adds comprehensive test coverage for NEVER_BUT_INCLUDE_GRADE in progress page scenarios |
lms/djangoapps/course_home_api/progress/views.py |
Adds new API response fields for assignment type grade summaries and filters out NEVER_BUT_INCLUDE_GRADE subsections from section scores |
lms/djangoapps/course_home_api/progress/tests/test_views.py |
Updates test expectations to account for the new NEVER_BUT_INCLUDE_GRADE option in grade calculations |
lms/djangoapps/course_home_api/progress/api.py |
Implements new grade aggregation logic with _AssignmentBucket and _AssignmentTypeGradeAggregator classes |
lms/djangoapps/course_home_api/progress/tests/test_api.py |
Adds comprehensive test scenarios for the new aggregation functionality |
lms/djangoapps/course_home_api/progress/serializers.py |
Adds serializers for assignment type grade summaries and updates subsection serializer to include due dates |
cms/templates/js/show-correctness-editor.underscore |
Adds UI option for course teams to select the "never_but_include_grade" visibility setting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <input class="input input-radio" name="show-correctness" type="radio" value="never_but_include_grade" aria-describedby="never_show_correctness_but_include_grade_description" /> | ||
| <%- gettext('Never show individual assessment results, but show overall assessment results after due date') %> | ||
| </label> | ||
| <p class='field-message' id='never_show_correctness_description'> |
Copilot
AI
Dec 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The id attribute in the paragraph element does not match the aria-describedby attribute in the input element. The input element references 'never_show_correctness_but_include_grade_description' but the paragraph has id='never_show_correctness_description', which is already used by the "Never show assessment results" option above. This will cause an accessibility issue as screen readers will announce the wrong description.
| <p class='field-message' id='never_show_correctness_description'> | |
| <p class='field-message' id='never_show_correctness_but_include_grade_description'> |
| (True, 0.7), # midterm and final are visible to staff | ||
| (False, 0.3), # just the midterm is visible to learners | ||
| (True, 0.72), # lab, midterm and final are visible to staff | ||
| (False, 0.32), # Only lab and midterm is visible to learners |
Copilot
AI
Dec 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment uses "visible" to mean "included in the grade calculation", which could be confusing since "visible" typically refers to display visibility. Consider rewording to "Only lab and midterm are included in the grade calculation for learners" for clarity.
| (False, 0.32), # Only lab and midterm is visible to learners | |
| (False, 0.32), # Only lab and midterm are included in the grade calculation for learners |
Description
This change is needed for some work we're doing on Learning MFE (https://github.com/edx/frontend-plugins/pull/111). Cherry picking it for compatibility.
Useful information to include:
Supporting information
Jira: https://2u-internal.atlassian.net/browse/AU-2763
Deadline
Early 2026.