Skip to content

Fix part of #6501: Introduce ADMIN_UNLOCK_CHAPTERS feature flag prototype for Alpha - #6523

Open
Kishan8548 wants to merge 4 commits into
oppia:developfrom
Kishan8548:fix-6501-admin-profile-unlock-chapters
Open

Kishan8548 wants to merge 4 commits into
oppia:developfrom
Kishan8548:fix-6501-admin-profile-unlock-chapters

Conversation

@Kishan8548

@Kishan8548 Kishan8548 commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Explanation

Fixes part of #6501

This is a Draft PR prototyping Ben's feature flag approach to bypass chapter prerequisite locking for testing on Alpha builds with production assets.

Changes

  1. Model / Platform Parameter: Added PACE_ADMIN_UNLOCK_CHAPTERS enum value to FeatureFlagId in platform_parameter.proto.
  2. Feature Flag Definition:
    • Added PACE_ADMIN_UNLOCK_CHAPTERS in feature_flags.textproto (disabled by default).
    • Enabled by default for Alpha in featureoverrides/alpha/feature_flags_overrides.textproto.
  3. Dagger Modules & Constants:
    • Added @EnablePaceAdminUnlockChapters, PACE_ADMIN_UNLOCK_CHAPTERS, and ENABLE_PACE_ADMIN_UNLOCK_CHAPTERS_DEFAULT_VALUE in FeatureFlagConstants.kt.
    • Bound in FeatureFlagBindingModule.kt and FeatureFlagsMapBindingModule.kt.
  4. TopicController:
    • Injected @EnablePaceAdminUnlockChapters private val paceAdminUnlockChapters: PlatformParameterValue<Boolean>.
    • When enabled, allows chapters with incomplete prerequisites to be treated as NOT_STARTED (playable) instead of NOT_PLAYABLE_MISSING_PREREQUISITES.
    • Does not alter learner progress data.
  5. Testing:
    • Added forceEnablePaceAdminUnlockChapters helper in TestPlatformParameterModule.kt.
    • Updated flag counts and iterations in FeatureFlagsFragmentTest.kt and FeatureFlagsLoggerTest.kt.

Prototype Test Observations (Alpha Build)

Tested this feature flag prototype directly on an Alpha build:

  • Chapter access: With the flag enabled, subsequent chapters unlock and can be accessed directly without completing prerequisite chapters.
  • Lesson playback: Directly opening and playing a later chapter runs smoothly without crashes or state issues.
  • Progress integrity: Starting a later chapter does not alter or falsely mark previous chapters as completed — learner progress remains intact.
image

(Screenshot showing Chapter 2 in progress while Chapter 1 remains untouched)

Essential Checklist

  • The PR title starts with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The explanation section above starts with "Fixes #bugnum: " (If this PR fixes part of an issue, use instead: "Fixes part of #bugnum: ...".)
  • Any changes to scripts/assets files have their rationale included in the PR explanation.
  • The PR follows the style guide.
  • The PR does not contain any unnecessary code changes from Android Studio (reference).
  • The PR is made from a branch that's not called "develop" and is up-to-date with "develop".
  • The PR is assigned to the appropriate reviewers (reference).

Disclosure of LLM Usage

  • Did you use AI/LLMs when working on this PR? Yes
  • If yes, describe the extent AI was used: Drafting feature flag wiring, diagnosing unit test shards, and prototype verification.

…prototype for Alpha

Adds an ADMIN_UNLOCK_CHAPTERS feature flag that bypasses chapter prerequisite locking on Alpha builds, allowing direct access to any lesson without completing prior ones.

Does not modify actual learner progress data. Enabled by default for Alpha only as a prototype for team testing.
@oppiabot

oppiabot Bot commented Nov 1, 2026

Copy link
Copy Markdown

Hi @Kishan8548, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 3 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you! If you're unsure how to reassign this PR to a reviewer, please make sure to review the wiki page that details the Guidance on submitting PRs.

@oppiabot oppiabot Bot added the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Nov 1, 2026
@Kishan8548 Kishan8548 removed the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Nov 3, 2026
@adhiamboperes

Copy link
Copy Markdown
Contributor

Hi Kishan,
Apologies for the delay in testing this. I tested the PR with prod assets and everything seems to work correctly as expected. It is okay to proceed with this solution.

Screen_recording_20261109_124958.webm

@adhiamboperes adhiamboperes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @Kishan8548! The feature flag setup looks good.

Please ensure that tests are added for TopicController and TopicFragment for the change. I am pretty sure some of the existing fragment tests are failing.

remote_server_name: "android_enable_worked_examples"
default_is_enabled: false
}
feature_flag_definition {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you can remove the pace identifier from the flag name, just make it generic.

Comment on lines +172 to +175

// Corresponds to a feature that allows an admin profile to unlock chapters on Alpha for PACE
// pilot testing, without modifying actual learner progress. This is a prototype flag following
// Ben's suggestion to disable the chapter lock and observe what breaks.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also make the comment generic. Assume this is permanent.

annotation class EnableWorkedExamples

/**
* Qualifier for the feature flag that allows an admin profile to unlock all chapters on Alpha

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ditto here too

@Kishan8548
Kishan8548 marked this pull request as ready for review November 9, 2026 17:47
@Kishan8548
Kishan8548 requested review from a team as code owners November 9, 2026 17:47
@Kishan8548
Kishan8548 requested review from adhiamboperes and a balanced review from Copilot November 9, 2026 17:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@adhiamboperes

adhiamboperes commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

I found a bug -- if you enable the spotlights feature flag from developer options, you will notice that the chapter spotlight shows for every single unlocked chapter. It should only show once per profile.

Screenshot_1794351054

This branch has not been deployed

No deployments
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