oppia-android icon indicating copy to clipboard operation
oppia-android copied to clipboard

Fix part of #5732: Flashback open navigation logic

Open subhajitxyz opened this issue 6 months ago • 3 comments

Explanation

Fixes part of #5732

  • Add a new field to the EphemeralState message in exploration proto.
  • Integrate confirmation dialog into the learner navigation flow.
  • Implement functions for navigation logic in ExplorationProgressController.
  • Add test in ExplorationProgressControllerTest.

(Note: I have introduced bool flashback_state in EphemeralState not as a oneof stateType. because ephemeralState for flashback screen will be a type of completed state and our newly introduced bool will help to indicate UI to show a different type of screen for flashback.

Why have I introduce this bool flashback_state outside of oneof stateType? -> In flashback screen will contain content, solution explaination, user submitted answer and return button. For showing this user submitted answer, we will need UserAnswer, which we normally stored in CompletedState. So, if we introduce bool flashback_state as oneof stateType, we can not get the UserAnswer)

This PR introduces the navigation logic to the Flashback screen when the user clicks on the "See example" button. It also introduces a confirmation dialog that appears when the user clicks the "See example" button.

After clicking the "Continue" button on the confirmation dialog, the Flashback screen will be shown. This screen will be implemented in the next PR (1.5).

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

Screen record on Phone

https://github.com/user-attachments/assets/9ffa6118-bdd5-4efa-8d9b-71b385b5ff83

Screen record on Tablet

tab_rec_PR_1.4.webm

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

subhajitxyz avatar Jun 17 '25 07:06 subhajitxyz

Coverage Report

Results

Number of files assessed: 10 Overall Coverage: 0.00% Coverage Analysis: FAIL :x:

Failure Cases

File Failure Reason Status
FlashbackConfirmationDialogFragment.ktapp/src/main/java/org/oppia/android/app/flashback/FlashbackConfirmationDialogFragment.kt
No appropriate test file found for app/src/main/java/org/oppia/android/app/flashback/FlashbackConfirmationDialogFragment.kt. :x:
FlashbackConfirmationDialogFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/flashback/FlashbackConfirmationDialogFragmentPresenter.kt
No appropriate test file found for app/src/main/java/org/oppia/android/app/flashback/FlashbackConfirmationDialogFragmentPresenter.kt. :x:
FlashbackButtonListener.ktapp/src/main/java/org/oppia/android/app/player/state/listener/FlashbackButtonListener.kt
No appropriate test file found for app/src/main/java/org/oppia/android/app/player/state/listener/FlashbackButtonListener.kt. :x:

Exempted coverage

Files exempted from coverage
File Exemption Reason
FragmentComponentImpl.ktapp/src/main/java/org/oppia/android/app/fragment/FragmentComponentImpl.kt
This file is exempted from having a test file; skipping coverage check.
FlashbackButtonViewModel.ktapp/src/main/java/org/oppia/android/app/player/state/itemviewmodel/FlashbackButtonViewModel.kt
This file is exempted from having a test file; skipping coverage check.
StateFragment.ktapp/src/main/java/org/oppia/android/app/player/state/StateFragment.kt
This file is incompatible with code coverage tooling; skipping coverage check.
StateFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/player/state/StateFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.
StatePlayerRecyclerViewAssembler.ktapp/src/main/java/org/oppia/android/app/player/state/StatePlayerRecyclerViewAssembler.kt
This file is exempted from having a test file; 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

github-actions[bot] avatar Jun 17 '25 09:06 github-actions[bot]

Coverage Report

Results

Number of files assessed: 10 Overall Coverage: 0.00% Coverage Analysis: PASS :white_check_mark:

Exempted coverage

Files exempted from coverage
File Exemption Reason
FlashbackConfirmationDialogFragment.ktapp/src/main/java/org/oppia/android/app/flashback/FlashbackConfirmationDialogFragment.kt
This file is exempted from having a test file; skipping coverage check.
FlashbackConfirmationDialogFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/flashback/FlashbackConfirmationDialogFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.
FragmentComponentImpl.ktapp/src/main/java/org/oppia/android/app/fragment/FragmentComponentImpl.kt
This file is exempted from having a test file; skipping coverage check.
FlashbackButtonViewModel.ktapp/src/main/java/org/oppia/android/app/player/state/itemviewmodel/FlashbackButtonViewModel.kt
This file is exempted from having a test file; skipping coverage check.
StateFragment.ktapp/src/main/java/org/oppia/android/app/player/state/StateFragment.kt
This file is incompatible with code coverage tooling; skipping coverage check.
FlashbackButtonListener.ktapp/src/main/java/org/oppia/android/app/player/state/listener/FlashbackButtonListener.kt
This file is exempted from having a test file; skipping coverage check.
StateFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/player/state/StateFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.
StatePlayerRecyclerViewAssembler.ktapp/src/main/java/org/oppia/android/app/player/state/StatePlayerRecyclerViewAssembler.kt
This file is exempted from having a test file; 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

github-actions[bot] avatar Jun 17 '25 14:06 github-actions[bot]

PTAL @adhiamboperes .

subhajitxyz avatar Jun 17 '25 17:06 subhajitxyz

Hi Adhiambo, PTAL. I have updated tests

subhajitxyz avatar Jun 23 '25 07:06 subhajitxyz

Coverage Report

Results

Number of files assessed: 10 Overall Coverage: 0.00% Coverage Analysis: PASS :white_check_mark:

Exempted coverage

Files exempted from coverage
File Exemption Reason
FragmentComponentImpl.ktapp/src/main/java/org/oppia/android/app/fragment/FragmentComponentImpl.kt
This file is exempted from having a test file; skipping coverage check.
StatePlayerRecyclerViewAssembler.ktapp/src/main/java/org/oppia/android/app/player/state/StatePlayerRecyclerViewAssembler.kt
This file is exempted from having a test file; skipping coverage check.
StateFragment.ktapp/src/main/java/org/oppia/android/app/player/state/StateFragment.kt
This file is incompatible with code coverage tooling; skipping coverage check.
FlashbackButtonViewModel.ktapp/src/main/java/org/oppia/android/app/player/state/itemviewmodel/FlashbackButtonViewModel.kt
This file is exempted from having a test file; skipping coverage check.
StateFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/player/state/StateFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.
FlashbackButtonListener.ktapp/src/main/java/org/oppia/android/app/player/state/listener/FlashbackButtonListener.kt
This file is exempted from having a test file; skipping coverage check.
FlashbackConfirmationDialogFragment.ktapp/src/main/java/org/oppia/android/app/flashback/FlashbackConfirmationDialogFragment.kt
This file is exempted from having a test file; skipping coverage check.
FlashbackConfirmationDialogFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/flashback/FlashbackConfirmationDialogFragmentPresenter.kt
This file is exempted from having a test file; 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

github-actions[bot] avatar Jun 27 '25 04:06 github-actions[bot]