- The time a user spent on a specific attempt
- The **cumulative **time spent across all attempts associated with a specific learning item (e.g., activity, module, or training), or across the entire platform.
The API always returns the time spent value in seconds. Formatting the output should be handled on the client platform.
๐งช Attempt-Level Time Spent
Time spent for a specific attempt is available in theAttemptMetrics
object, accessible via the Attempt -> metrics
field. This applies to all learning items (e.g. trainings, modules activities).
See the example below:
attempt
field is available for both training and navigation items. Within it, youโll find the time spent (in seconds) for each attempt.
๐ Cumulative Time Spent
Cumulative time spent can be retrieved using thegetCumulativeTimeSpent
query. This query accepts several optional arguments that can be combined to filter the results.Query Arguments
Argument | Type | Required | Description |
---|---|---|---|
userContextId | ID | No | The user context ID. If omitted, the user context from the API request will be used. |
lpId | ID | No | The learning path ID. |
edgeRid | ID | No | The edge revision ID (e.g., for a specific activity or module). Requires lpId to be provided. |
startDate | Date | No | Start date in YYYY-MM-DD format. Must be used together with endDate . |
endDate | Date | No | End date in YYYY-MM-DD format. Must be used together with startDate . |
๐งพ Usage Examples
By specifying the appropriate arguments, you can retrieve cumulative time spent data for a variety of use cases:- โฑ๏ธ Cumulative time spent on a specific learning item (activity or module), optionally filtered by date range
- ๐ Cumulative time spent within a learning path, optionally filtered by date range
- ๐ Cumulative time spent by a user across the entire platform, optionally filtered by date range