Time Tracking at the Course Level in Aspects

I’m beginning to work with Aspects and was wondering what the best method is for tracking time spent in a course? I understand this is not an easy metric to obtain given idle time and all the other possible ways a user could interact with the page that would make a metric less accurate. I’m just looking for a simple way to track a user’s session on a course, which would start when they enter the course and end when they leave it (this includes closing the tab).

I know there’s a way to track events using xapi but this doesn’t seem very robust. Is there a way to enable heartbeats?

Any help with this is much appreciated.

Hi Ryan! Thanks so much for posting, and welcome to the Open edX community!

The short answer to your question is, we do not currently have any methods to track time spent on a course. The only data we can provide is ‘completion’, in other words, if the user has visited a page, watched a video, or answered a question.

I’m curious as to what you are hoping to achieve with this data? As you said, it’s not an easy metric to obtain, and there are so many ways the data would be incorrect (internet connection goes down, user is on the mobile app, the tab stays open in the browser for 2 weeks with no interactions, etc). If you have a specific goal in mind, I can try to help you find more reliable metrics to use.

Hey Sara, thanks for your reply!

This data is primarily meant to be a performance metric for instructors that are hired and trained through course content. Like you said, it may not always be accurate but I’ve found that its useful to tell whether an end user is skimming through a course in 10 minutes vs spending an hour in the system. I’ve read that heartbeats or idle checks are a potential workaround to some of the issues that arise with time tracking, is that something that can be configured in Aspects?

Got it! That isn’t something that can be configured within Aspects. I think you would need to inject javascript somewhere in the LMS that fires off a heartbeat tracking event every X seconds (this would most likely be some sort of plugin) and then would have to set up the tracking events to xAPI and then to Superset where you could visualize the data. If you’d like to try that, I’d recommend looking through Creating a Tutor plugin — Tutor documentation for some info about plugins.