-
Notifications
You must be signed in to change notification settings - Fork 26
feat: count XBlocks with optional_completion
#279
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: master
Are you sure you want to change the base?
Conversation
eef91da to
53473df
Compare
80c26d7 to
e1a6a84
Compare
optional_completionoptional_completion
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 adds support for tracking optional completion of XBlocks in the completion-aggregator service. The feature enables separate tracking and reporting of optional vs. required blocks in Open edX courses, with optional blocks identified by the optional_completion XBlock field.
Changes:
- Added three new fields to the Aggregator model:
optional_earned,optional_possible, andoptional_percentwith corresponding database migration - Extended the aggregation logic to separately track completion of optional blocks
- Added
include_optionalAPI parameter to optionally expose optional completion data in API responses - Updated serializers to conditionally include optional completion data
- Added comprehensive test coverage for the new functionality
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| completion_aggregator/models.py | Added three new fields for tracking optional completions and updated SQL query to include them |
| completion_aggregator/migrations/0007_aggregator_optional_completion.py | Migration to add optional completion fields to Aggregator model |
| completion_aggregator/core.py | Updated aggregation logic to separately track optional blocks and calculate their completion stats |
| completion_aggregator/compat.py | Added is_block_optional() function to check if a block is optional |
| completion_aggregator/transformers.py | Updated to request optional_completion XBlock field |
| completion_aggregator/serializers.py | Added optional completion serializer and updated existing serializers to conditionally include optional data |
| completion_aggregator/api/common.py | Added get_include_optional() method to parse the include_optional parameter |
| completion_aggregator/api/v0/views.py | Updated views to pass include_optional parameter and documented the new parameter |
| completion_aggregator/api/v1/views.py | Updated views to pass include_optional parameter and documented the new parameter |
| test_utils/compat.py | Added test implementation of is_block_optional() |
| tests/test_models.py | Added tests for optional completion field defaults, validation, and get_values behavior |
| tests/test_core.py | Added tests for optional block aggregation with full and partial completion |
| tests/test_serializers.py | Added tests for optional completion serialization in various scenarios |
| tests/test_views.py | Added tests for include_optional parameter in list and detail views |
| completion_aggregator/init.py | Version bumped to 4.4.0rc |
| CHANGELOG.rst | Added changelog entry for version 4.4.0 |
| codecov.yml | Reduced patch coverage target from 100% to 75% |
| .coveragerc | Updated coverage omit patterns |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
completion_aggregator/migrations/0007_aggregator_optional_completion.py
Outdated
Show resolved
Hide resolved
e1a6a84 to
e265b71
Compare
e265b71 to
d0fed71
Compare
Description: This adds support for optional completion implemented in open-craft/openedx-platform#823.
Dependencies:
Merge deadline: None
Installation instructions: For now, this requires a Redwood instance, as the optional completion is implemented only in this release. Therefore, it may be easier to test this one on a sandbox instance.
Testing instructions:
ENABLE_COURSE_ACTIVITY_SIGNALS = Trueto your instance configs.Reviewers:
Merge checklist:
Post merge:
finished.
Private-ref: BB-9331