Extending D2L Reports Using Python

So before I get going on this long post, a little bit about me. I fancy myself a programmer. In fact, the first “real” job I had out of college (the second time I went through college, the first job the first time through college was a video store clerk) was programming a PHP/MySQL driven website in 2003-ish (on a scavenged Windows 2000 server running on an HP box). So I have some chops. Of course, as educational technology has moved away from being a multiple skillset job where a little programming, a little graphic design, a little instructional design was all part of what one did, now it’s been parsed out into teams. Anyways, I haven’t had much of an opportunity to write any code for a long time. The last thing I did seriously was some CSS work on my website about four months ago, which is not really doing anything.

With that all said, the LMS administration I do requires little programming skill, as being an admin, while having it’s perks, isn’t exactly a technical job. I do recognize that some admins deal with enrollments and SIS integrations that require a whole skillset that I could do, but I don’t.

As part of my admin jobs, I run monthly reports on how many items are created in D2L’s ePortfolio – these reports include date and time, username and item type. We use this as a gauge of how active students are and cross-referenced with other information it’s incredibly useful in letting us know things like 22,383 items were created by 2650 unique users in ePortfolio in November 2014 (actual numbers).

Using Excel, I can see if users in a month have ever used ePortfolio before, so I can also track how many users are new to the tool per month. However the one thing I can’t easily look at is how frequently a user might interact with ePortfolio. With a total record number of over 125,000, it’s not something I want to do by hand. So I wrote a script. In Python. A language I don’t know well.

If you want to avoid my lengthy diatribe about what I’m doing and skip right to the code it’s on GitHub here: https://github.com/jonkruithof/python-csv-manipulation-d2l-reports. If you don’t want to click a link, here’s the embedded code here:

Basically the code does this:

Look at the username, see if it exists in memory already. If it does, find the difference since the last login write that information to a CSV, and then overwrite the existing entry with this entry. If it does not exist, then write it to memory. Loop through and at the end, you’ll have a large ass CSV that you’d have to manipulate further to get some sense of whether users are frequently using the ePortfolio tool (which might indicate they see value in the reflection process). I do that in CSVed, a handy little Windows program that handles extremely large CSVs quite well. A quick sort by username (an improvement in the Python code coming sometime soonish) and we have something parseable by machine. I’m thinking of taking the difference in creation times, and creating some sort of chart that shows the distribution of differences… I’m not sure what it’ll look like.