Fix #5037: Pause hint timer while hints and solution dialog is open - #6425
Draft
Kishan8548 wants to merge 2 commits into
Draft
Fix #5037: Pause hint timer while hints and solution dialog is open#6425Kishan8548 wants to merge 2 commits into
Kishan8548 wants to merge 2 commits into
Conversation
- HintHandler: Add pause and resume capabilities to the HintHandler interface and its implementations (HintHandlerProdImpl and HintHandlerDebugImpl). Track elapsed time using OppiaClock to ensure the remaining hint delay is preserved and resumed accurately when the dialog is dismissed. - ExplorationProgressController & QuestionAssessmentProgressController: Add pause and resume methods that delegate events to HintHandler through actor message channels, connected to HintsAndSolutionDialogFragment lifecycle via ExplorationActivity and QuestionPlayerActivity. - Tests: Add comprehensive unit test coverage across HintHandlerProdImplTest, HintHandlerDebugImplTest, ExplorationProgressControllerTest, and QuestionAssessmentProgressControllerTest, and update Dagger test modules with FakeOppiaClockModule.
Contributor
Coverage ReportResultsNumber of files assessed: 22 Exempted coverageFiles exempted from coverage
|
Collaborator
Author
|
@adhiamboperes PTAL I've opened this draft PR with the implementation for pausing and resuming the hint timer when the hints/solution dialog is open, along with unit tests for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
Fixes #5037
Pause hint timer while hints and solution dialog is open
Context & Root Cause
Previously,
HintHandlerProdImplscheduled hints and solution availability on an uninterrupted countdown delay. If a learner opened theHintsAndSolutionDialogFragmentto read an earlier hint or inspect a solution, the countdown timer for subsequent hints or solutions continued ticking in the background. As a result:Technical Implementation
Domain Timer State (
HintHandlerProdImpl&HintHandlerDebugImpl):pause()andresume()to theHintHandlerinterface.HintHandlerProdImpl, integratedOppiaClockto track the exact elapsed time prior to pausing. When resumed, the remaining duration (targetDelay - elapsedTime) is scheduled rather than restarting the full delay.HintHandlerDebugImplwith matching no-op / state-tracking methods.Controller & Concurrency Layer:
pauseHintsAndSolutionTimer()andresumeHintsAndSolutionTimer()to bothExplorationProgressControllerandQuestionAssessmentProgressController.Lifecycle & UI Wiring:
HintsAndSolutionListenerwithonHintsAndSolutionDialogShown()andonHintsAndSolutionDialogDismissed().HintsAndSolutionDialogFragment'sonStart()andonDismiss()lifecycle methods to notify the listener.ExplorationActivityandQuestionPlayerActivitythrough their respective fragments down toExplorationProgressControllerandQuestionAssessmentProgressController.Testing & Verification:
HintHandlerProdImplTest,HintHandlerDebugImplTest,ExplorationProgressControllerTest, andQuestionAssessmentProgressControllerTestcovering pause before first hint, pause between hints, multiple pause/resume cycles, and solution timers.HintsAndSolutionProdModuleTestandHintsAndSolutionDebugModuleTestwithFakeOppiaClockModuleto verify Dagger dependency graph integrity.StateFragmentTest,ExplorationActivityTest,QuestionPlayerActivityTest) as well as all static checks (ktlint,checkstyle,buildifier), all of which passed.Essential Checklist
Disclosure of LLM Usage
YesorNo.Yes