Skip to content

Conversation

@nsprenkle
Copy link
Member

@nsprenkle nsprenkle commented Nov 19, 2025

Description

Where enabled, previews the presence of verified content to audit learners.

To-do list

  • Feature flagged
  • Course Home
    • Shows non-audit content to audit where enabled
  • Unit Testing
  • Regression testing
    • Still hides content gated for other reasons (e.g. Staff-only, gated content)
    • Exams details (update to toggles removes this)
    • Schedule details (update to toggles removes this)

Deferred

  • Left Side Nav
  • Limited to Verified content only

Supporting information

Enable the feature by setting the Course Waffle flag course_home.audit_learner_verified_preview to Enabled.

Once enabled, this checks for the checks that both the user is Audit and the course has a Verified track. Where this is the case it will no longer remove Verified content from the outline, instead marking blocks that are Verified-only with the is_preview field as true

Trimmed API as example:

GET https://{lms}/api/course_home/outline/{course-id} HTTP/1.1

{
  "course_blocks": {
        "blocks": {
            "block-v1:{course-id}+type@sequential+block@{block-id}": {
                "display_name": "Sequence limited to Verified Track",
                 "children": [  ],
                "type": "sequential",
                "is_preview": true
            },
            "block-v1:{course-id}+type@sequential+block@{block-id}": {
                "display_name": "Sequence available to Audit",
                 "children": [ ],
                "type": "sequential",
                "is_preview": false
            }
        }
    }
}

Testing instructions

  1. Create a course with
    a. Verified and enrollment tracks
    b. Sequences that are restricted to certain enrollment groups.
    c. course_home.audit_learner_verified_preview waffle flag enabled.
  2. Log in as an audit learner.
  3. Go to the Course Overview page.
  4. Verified-only sequences and sections with verified-only content should still show up for audit learners.
  5. Disable the feature and confirm that verified-only content no longer show up in course outline.

…preview of verified content

This is, specifically, when all 3 of the critera are met:
1. The feature flag is enabled for the course.
2. The requesting user is enrolled as audit.
3. The course has a verified track.
…it content as previewable

Adds new previewable_sequences to UserCourseOutlineData
@nsprenkle nsprenkle force-pushed the nsprenkle/verified-preview-outline branch from b41d93f to e2c95be Compare November 19, 2025 20:22
@nsprenkle nsprenkle force-pushed the nsprenkle/verified-preview-outline branch from 6fbef02 to ca0f6c1 Compare November 24, 2025 23:18
The linters don't like core openedx code talking to LMS/CMS code.
This keeps the toggle in LMS but passes the toggle value via
kwargs to the functions that use them.
@nsprenkle nsprenkle force-pushed the nsprenkle/verified-preview-outline branch from 6a9c6cb to efc774a Compare November 25, 2025 01:47
@nsprenkle nsprenkle changed the title feat: audit preview of verified content feat: audit preview of verified content in course outline Nov 25, 2025
@nsprenkle nsprenkle marked this pull request as ready for review November 25, 2025 02:15
Copilot AI review requested due to automatic review settings November 25, 2025 02:15
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 PR introduces a feature that allows audit learners to preview the structure of verified-only content in course outlines, controlled by the course_home.audit_learner_verified_preview waffle flag. When enabled, audit learners can see that verified content exists (marked with is_preview: true) without being able to access it.

Key changes:

  • Added feature flag logic to determine when audit learners can preview verified content
  • Modified the learning sequences API to collect and mark previewable content instead of removing it
  • Updated the course home outline view to set is_preview markers on applicable blocks

Reviewed changes

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

Show a summary per file
File Description
lms/djangoapps/course_home_api/toggles.py Added waffle flag and helper functions to check if audit learners can preview verified content
lms/djangoapps/course_home_api/tests/test_toggles.py Added comprehensive unit tests for the preview eligibility logic
openedx/core/djangoapps/content/learning_sequences/data.py Added previewable_sequences field to UserCourseOutlineData
openedx/core/djangoapps/content/learning_sequences/api/outlines.py Modified outline processing to collect previewable content when feature is enabled
openedx/core/djangoapps/content/learning_sequences/services.py Added preview_verified_content parameter to service interface
openedx/core/djangoapps/content/learning_sequences/api/tests/test_outlines.py Added tests for preview functionality with verified and audit users
lms/djangoapps/course_home_api/outline/views.py Added logic to mark previewable blocks with is_preview flag in API response
lms/djangoapps/course_home_api/outline/tests/test_view.py Added integration tests for the preview feature in the outline view
lms/djangoapps/course_home_api/outline/serializers.py Added is_preview field to block serialization with False default
openedx/features/course_experience/utils.py Updated comments to correctly describe function behavior

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

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Copilot AI review requested due to automatic review settings November 25, 2025 16:35
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

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


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

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Copy link
Member

@jansenk jansenk left a comment

Choose a reason for hiding this comment

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

lgtm

Copilot AI review requested due to automatic review settings December 1, 2025 17:14
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

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.


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

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@nsprenkle nsprenkle merged commit 47ab960 into release-ulmo Dec 1, 2025
70 checks passed
@nsprenkle nsprenkle deleted the nsprenkle/verified-preview-outline branch December 1, 2025 19:16
@nsprenkle
Copy link
Member Author

Replaces openedx#37616, which I have now closed

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