Skip to content

[CORE-7503] Add attention metrics tracking to topic component#2704

Open
trtshen wants to merge 1 commit into
prereleasefrom
2.4.y/CORE-7503/topic-read-validity
Open

[CORE-7503] Add attention metrics tracking to topic component#2704
trtshen wants to merge 1 commit into
prereleasefrom
2.4.y/CORE-7503/topic-read-validity

Conversation

@trtshen

@trtshen trtshen commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

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 TopicComponent that collects engagement signals (e.g., visible time, content exposure, media/file interactions) and emits them as part of a TopicContinueEvent when 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

  • Introduced a visible "Time spent" indicator for incomplete topics, which tracks and displays time locally using localStorage and 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

  • Added comprehensive unit tests for attention metric emission, file/media interaction tracking, timer persistence and cleanup, and correct handling of topic/task changes. [1] [2] [3]

Documentation

  • Provided extensive documentation describing the purpose, payload, signal collection, scoring, limitations, and UI/UX of the new attention metrics and time-spent indicator.

Styling

  • Added styles for the new time-spent indicator to match the app's visual language.

These changes lay the foundation for richer analytics on topic engagement while maintaining a seamless learner experience.

@trtshen trtshen self-assigned this Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant