Fix part of #5732: Implement domain logic to show flashback button
Explanation
Fixes part of #5732
- Add a new field to the AnswerAndResponse message in exploration.proto.
- Add a logic to detect flashbacks in ExplorationProgressController and add functions in StateDeck.
- Add relevant tests in ExplorationProgressControllerTest.
- Logic gated behind feature flag.
This PR will introduce domain logic for showing new "See example" button (Flashback button).
Essential Checklist
- [x] The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
- [x] Any changes to scripts/assets files have their rationale included in the PR explanation.
- [x] The PR follows the style guide.
- [x] The PR does not contain any unnecessary code changes from Android Studio (reference).
- [x] The PR is made from a branch that's not called "develop" and is up-to-date with "develop".
- [x] The PR is assigned to the appropriate reviewers (reference).
For UI-specific PRs only
If your PR includes UI-related changes, then:
- Add screenshots for portrait/landscape for both a tablet & phone of the before & after UI changes
- For the screenshots above, include both English and pseudo-localized (RTL) screenshots (see RTL guide)
- Add a video showing the full UX flow with a screen reader enabled (see accessibility guide)
- For PRs introducing new UI elements or color changes, both light and dark mode screenshots must be included
- Add a screenshot demonstrating that you ran affected Espresso tests locally & that they're passing
Coverage Report
Results
Number of files assessed: 2 Overall Coverage: 0.00% Coverage Analysis: PASS :white_check_mark:
Exempted coverage
Files exempted from coverage
| File | Exemption Reason |
|---|---|
StateDeck.ktdomain/src/main/java/org/oppia/android/domain/state/StateDeck.kt |
This file is exempted from having a test file; skipping coverage check. |
ExplorationProgressController.ktdomain/src/main/java/org/oppia/android/domain/exploration/ExplorationProgressController.kt |
This file is incompatible with code coverage tooling; skipping coverage check. |
Refer test_file_exemptions.textproto for the comprehensive list of file exemptions and their required coverage percentages.
To learn more, visit the Oppia Android Code Coverage wiki page
PTAL @adhiamboperes .
Unassigning @adhiamboperes since the review is done.
Hi @subhajitxyz, it looks like some changes were requested on this pull request by @adhiamboperes. PTAL. Thanks!
Thanks @subhajitxyz!
Please add tests for the feature flag behavior, i.e, expected behaviour when FF is enabled and disabled.
IIn the ExplorationProgressControllerTest class, all the feature flags are currently enabled inside the setUp() function using the @Before annotation. To properly test the behavior when feature flag is disabled, we would need to write separate functions for each flag . This would involve setting the desired flag state before each test individually, rather than using the common setUp() method.
A similar approach has already been implemented in StateFragmentTest.
Coverage Report
Results
Number of files assessed: 3 Overall Coverage: 0.00% Coverage Analysis: PASS :white_check_mark:
Exempted coverage
Files exempted from coverage
| File | Exemption Reason |
|---|---|
StateFragment.ktapp/src/main/java/org/oppia/android/app/player/state/StateFragment.kt |
This file is incompatible with code coverage tooling; skipping coverage check. |
StateDeck.ktdomain/src/main/java/org/oppia/android/domain/state/StateDeck.kt |
This file is exempted from having a test file; skipping coverage check. |
ExplorationProgressController.ktdomain/src/main/java/org/oppia/android/domain/exploration/ExplorationProgressController.kt |
This file is incompatible with code coverage tooling; skipping coverage check. |
Refer test_file_exemptions.textproto for the comprehensive list of file exemptions and their required coverage percentages.
To learn more, visit the Oppia Android Code Coverage wiki page
Hi @adhiamboperes PTAL, I have added new condition for enable flashback button as discussed. Updated test exploration for testing properly. Update previous tests, and add new one test in StateFragmentTest.