[CORE-7503] Add attention metrics tracking to topic component#2704
Open
trtshen wants to merge 1 commit into
Open
[CORE-7503] Add attention metrics tracking to topic component#2704trtshen wants to merge 1 commit into
trtshen wants to merge 1 commit into
Conversation
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.
Ticket: CORE-7503
This pull request introduces a new attention tracking and local time-spent indicator system for the
TopicComponent, aimed at measuring learner engagement with topic content. The implementation includes both backend-facing attention metrics and a learner-facing timer, with no impact on the completion flow or user experience. The changes are thoroughly documented, tested, and integrated into the component lifecycle.Key changes include:
Attention Metrics and Tracking
Added a new attention tracking system to
TopicComponentthat collects engagement signals (e.g., visible time, content exposure, media/file interactions) and emits them as part of aTopicContinueEventwhen a topic is marked complete. This metric is sent to the backend as an optional payload and is non-blocking for the learner. [1] [2] [3] [4] [5] [6] [7] [8] [9]Implemented attention metric calculation and event emission in the continue flow, including confidence scoring and handling for quick-complete cases.
Added lifecycle handling to start, stop, and reset attention tracking when the topic or task changes, and ensured cleanup on component destruction or navigation. [1] [2] [3]
Local Time-Spent Indicator
localStorageand persists across visits. The timer is managed independently from backend attention metrics and is cleared when a topic is marked complete. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Testing
Documentation
Styling
These changes lay the foundation for richer analytics on topic engagement while maintaining a seamless learner experience.