The Instructure Community will enter a read-only state on November 22, 2025 as we prepare to migrate to our new Community platform in early December. Read our blog post for more info about this change.
Found this content helpful? Log in or sign up to leave a like!
I'm seeing a lot of students that do not have a value within the Enrollments table in their "last_activity_at" attribute. I resync'd my data this morning into Postgres and found a case where a student showed no activity, but had completed several assignments in a course.
I had been hoping to use the "last_activity_at" value to determine how recently students are logging in, without having to dig into the web_logs activity.
Is there an issue with the value in the enrollments table, or am I experience an odd latency issue that is beyond 36-48 hours?
Just anecdotally, I've had issues with the date I expected in the last_activity_at field when using the API, to the point I stopped using it. However it's been a couple of years, so that may have been resolved.
However, to diagnose your problem, I would first check to see if the api results match your cd2 results. If you've used the api before, use your favorite method. For anyone reading this that is in a situation where they have admin rights and access to cd2 data, but hasn't used the API, I'll offer one way that doesn't require messing with API keys.
let courseId = ENV.COURSE_ID; // if ENV doesn't have it, manually enter
let userId = ENV.USER_ID; // if ENV doesn't have it, manually enter
let enr = await $.get(`/api/v1/courses/${courseId}/enrollments?user_id=${userId}&state[]=active&state[]=invited&state[]=deleted&state[]=completed&state[]=inactive`);
console.log(enr);
spot check if the field last_activity_at matches what you see in cd2.
Community helpTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign inTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign in