Emulating calculation of last_activity_at in enrollment_dim with Requests... (for weekly engagement reporting)

jago_brown
Community Member

Hello,

We want to retrospectively calculate the last activity for each week of the 2017 academic year (within defined canvas terms) - so starting back in October 2017.

I'm thinking this might be possible to calculate with the requests data, if we knew the queries that are run to generate the enrollment_dim table? 

UPDATE:

(being a bit slow waking up today)

So presumably "enrollment_dim" is close to a dump or the Enrollments API (Enrollments - Canvas LMS REST API Documentation ) and how "last_activity_at" is calculated can be seen in the Canvas ruby source code.

So my question is really does anyone have a script to emulate calculating "last_activity_at" from CanvasData i.e drawling through requests?

Kind reagards

Jago