{"id":1283,"date":"2026-09-17T08:53:56","date_gmt":"2026-09-17T05:53:56","guid":{"rendered":"https:\/\/www.juustila.com\/antti\/?p=1283"},"modified":"2026-09-17T11:51:40","modified_gmt":"2026-09-17T08:51:40","slug":"more-course-activity-analysis-tools","status":"publish","type":"post","link":"https:\/\/www.juustila.com\/antti\/2026\/09\/17\/more-course-activity-analysis-tools\/","title":{"rendered":"More course activity analysis tools"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I&#8217;ve <a href=\"https:\/\/www.juustila.com\/antti\/2025\/05\/12\/multiple-git-repository-status-awareness-grading-app-updates\/\" data-type=\"link\" data-id=\"https:\/\/www.juustila.com\/antti\/2025\/05\/12\/multiple-git-repository-status-awareness-grading-app-updates\/\">written before<\/a> about the tools I&#8217;ve built to manage the workload and gather statistics on activity of students in my Data Structures and Algorithms course. <\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">To recap, the tool is needed due to large number of students in the course (and others, going on simultaneously), while the teaching resources are quite petite, to put it mildly. Last year the total enrolment count was ~350, this Fall it is ~230. Repository count this year is (currently) ~200.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">What kind of activity statistics? Like the total number of daily commits from the start of the course, done by students:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"599\" src=\"https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Daily-commits-from-start-1024x599.png\" alt=\"\" class=\"wp-image-1284\" srcset=\"https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Daily-commits-from-start-1024x599.png 1024w, https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Daily-commits-from-start-300x176.png 300w, https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Daily-commits-from-start-768x450.png 768w, https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Daily-commits-from-start-1536x899.png 1536w, https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Daily-commits-from-start-1200x703.png 1200w, https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Daily-commits-from-start.png 1920w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption class=\"wp-element-caption\">Bar chart of count of git commits per day in a programming course with ca. 200 students.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Someone made a git commit on the first day of the course, and the most active day so far was the ninth day with 35 commits in total.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Or the repositories having a specific count of commits currently:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"586\" src=\"https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Counts-of-total-commits-1024x586.png\" alt=\"\" class=\"wp-image-1285\" srcset=\"https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Counts-of-total-commits-1024x586.png 1024w, https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Counts-of-total-commits-300x172.png 300w, https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Counts-of-total-commits-768x440.png 768w, https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Counts-of-total-commits-1536x880.png 1536w, https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Counts-of-total-commits-1200x687.png 1200w, https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Counts-of-total-commits.png 1816w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption class=\"wp-element-caption\">Bar chart displaying the count of student git remote repositories having a specific number of commits so far. Zero commits in remote repository accessible to teachers does not indicate zero work. Student may have commits in their local repository or uncommitted work not yet in git.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The graph above shows that 133 repositories have zero commits at the time this analysis was done, 17 repositories have one commit, etc. The most active student has done 27 commits already.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This data graph shows what have the students been working on during the last seven days:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"543\" src=\"https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Hot-files-this-week-1024x543.png\" alt=\"\" class=\"wp-image-1286\" srcset=\"https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Hot-files-this-week-1024x543.png 1024w, https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Hot-files-this-week-300x159.png 300w, https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Hot-files-this-week-768x407.png 768w, https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Hot-files-this-week-1536x815.png 1536w, https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Hot-files-this-week-1200x637.png 1200w, https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Hot-files-this-week.png 1900w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption class=\"wp-element-caption\">A chart displaying the most actively edited files based on commit counts and changed lines in all student repositories.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Which looks quite what is expected, since the first five Java files are supposed to be worked upon in the first three course programming tasks in the schedule this and previous course weeks.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">These are all based on my Swift\/SwiftUI app analysing the data from git and git logs, either stored in my app&#8217;s database or parsing from the output of git log command, as the analysis is executed and the graphs are generated.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But what about the activities related to the <em>lectures<\/em>? Assumption is, obviously, that the students first go through the lectures and lecture demonstrations and only then dwell into the associated programming tasks. An assumption that does not unfortunately always hold, but still&#8230;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We use Moodle as the learning environment. While Moodle has extensive and detailed tools to analyse and observe student activities, getting a quick overview from those tools can be a bit cumbersome.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, when you view the activity log of a link to a lecture video in Moodle, you can see who and when has accessed that link. But if the same student clicks the activity&#8217;s link several times, there are several rows in the activity log for the same student. Also, that log does not quickly tell me the total count of students who have accessed the lecture video at least once. I&#8217;d have to do the counting myself manually.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;ve split the lecture videos to a manageable lengths (from the viewing perspective) which means there are 25 video links currently of the actual lecture content. In addition to that, there are some demonstration videos. Clicking through the Moodle analytics on all of these and counting by hand how many students have accessed the videos is therefore not something I&#8217;d do e.g. weekly. Too much manual, tedious and error prone work. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is not a one time chore, but a thing to do many, many times during the course. Preferably weekly from September to December. Then the teachers would be on the map about the students advancing in the course, week by week. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Using the analytics data, we at least theoretically could be able to observe something relevant happening (or something <em>not<\/em> happening what was supposed to happen!) that could indicate problems somewhere in the course implementation. Maybe the data could also be used to improve the course for the next year, pinpointing places where the planned schedule and actual realities do not match and it is the course schedule that should be adjusted.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Fortunately, Moodle offers a download link for each activity log report. I can choose the format of the downloaded file, one of which is JSON. So, I implemented (no LLMs used, as usual!) a command line tool using Swift, which <\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>reads the downloaded Moodle JSON analytics files from a specified directory, <\/li>\n\n\n\n<li>reads the activity name from the JSON file contents, <\/li>\n\n\n\n<li>counts the <em>unique<\/em> student names in that file, and then <\/li>\n\n\n\n<li>updates a tab separated values (tsv) file where the statistics (no student data is stored) of each Moodle activity are stored, per analysis date, and<\/li>\n\n\n\n<li>the tsv file can be opened in a spreadsheet app and data can be visualised as a graph:<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"892\" src=\"https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Video-link-viewing-stats-1024x892.png\" alt=\"\" class=\"wp-image-1287\" srcset=\"https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Video-link-viewing-stats-1024x892.png 1024w, https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Video-link-viewing-stats-300x261.png 300w, https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Video-link-viewing-stats-768x669.png 768w, https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Video-link-viewing-stats-1536x1338.png 1536w, https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Video-link-viewing-stats-1200x1046.png 1200w, https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2026\/09\/Video-link-viewing-stats.png 1772w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption class=\"wp-element-caption\">A bar chart displaying the Moodle activity access counts of course lecture videos, gathered from Moodle activity logs. The chart tells me that many students have not yet started to watch the lecture videos but are falling a bit behind of the schedule. Not yet alarmingly so, but let&#8217;s see how it goes. It is always possible that some watch videos together, only one student accessing the activity while many are actually watching. A very good thing in itself, but may influence the statistics.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The relevant part of the JSON file handling is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>func processJSONFile(_ file: String) throws -&gt; (num: Int, act: String)? {\n  let fileContents = try String(contentsOfFile: file, encoding: .utf8)\n  if let jsonData = fileContents.data(using: .utf8) {\n    var uniqueUserNames: Set&lt;String&gt; = &#91;]\n    var target = \"\" \/\/ The Moodle activity name\n\t\t\t\n    let jsonDecoder = JSONDecoder()\n    let items = try jsonDecoder.decode(&#91;&#91;MoodleStatisticsItem]].self, from: jsonData).flatMap( { $0 } )\n\t\t\t\n    for item in items {\n      \/\/ Ignore the listed teachers who clicked the activity link.\n      if !ignoreNames.contains(item.kokoNimi) {\n        uniqueUserNames.insert(item.kokoNimi)\n      }\n      if target.isEmpty {\n          target = item.tapahtumanKonteksti.replacingOccurrences(of: \"Verkko-osoite: \", with: \"\")\n      }\n    }\n\/\/ ...<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">What is actually collected and later saved to the tsv file from this, is the <code>uniqueUserNames.count<\/code>, telling the number of individuals (excluding teachers) who have accessed the Moodle activity at the time the tool was executed, as well as the name of the Moodle activity from within the JSON file, in <code>target<\/code>. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, instead of spending tens of minutes or even hours, clicking and manually counting things from the Moodle activity logs, I&#8217;ll spend <s>maybe <strong>5 minutes<\/strong> <strong>max<\/strong> to download the JSON log files<\/s> <em>actually only like seconds, since I just changed the tool to handle just one JSON file containing <span style=\"text-decoration: underline;\">all<\/span> activities of the course<\/em>, and <strong>one second<\/strong> to execute the tool and open the resulting file in the spreadsheet app. Huge time savings!<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">All this done, by the way, when I was (still am) sick from a flu and can&#8217;t go teach in the classroom. Implementation took less than a workday. No employer&#8217;s time wasted doing this, just my sick day, but saving employer paid work time later! [Do not work when sick. I did because I like programming and didn&#8217;t consider this work, actually, but an interesting problem to solve.]<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">When I used the tool first time, the resulting graph above shows the activity stats of course lecture videos for that date, Sept 15th. I plan to launch the tool once a week, so it is then possible to see the difference to last weeks&#8217; viewing stats. The next time launched,  a new entry is added to tsv file for that date stats.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Knowing the recommended course schedule, I can then use the tool to see how the students actually advance through the course lectures. This should also give more insight into the git based programming task analytics. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If, for example, the graph above shows that students are advancing into the Stack data structure lectures a week after the planned schedule, teachers could expect that the students are actively starting the related coding tasks that week or the next one. Then we could be better prepared to handle the inevitable issues and questions about stacks at that time. Or we could anticipate that when the deadline comes, a certain number of student are behind the schedule and may need additional support to actually pass the deadline without issues. Hopefully.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The only manual thing left to do is to actually download those 25 Moodle activity JSON log files. I bet I could somehow record  a script that does that clicking and selecting type of downloads in the browser automatically too&#8230; \ud83e\udd14<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve written before about the tools I&#8217;ve built to manage the workload and gather statistics on activity of students in my Data Structures and Algorithms course. To recap, the tool is needed due to large number of students in the course (and others, going on simultaneously), while the teaching resources are quite petite, to put &hellip; <a href=\"https:\/\/www.juustila.com\/antti\/2026\/09\/17\/more-course-activity-analysis-tools\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;More course activity analysis tools&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[2,1],"tags":[208,66,70,46,12],"class_list":["post-1283","post","type-post","status-publish","format-standard","hentry","category-coding","category-yleinen","tag-course-analytics","tag-json","tag-programming","tag-swift","tag-teaching"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/posts\/1283","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/comments?post=1283"}],"version-history":[{"count":2,"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/posts\/1283\/revisions"}],"predecessor-version":[{"id":1291,"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/posts\/1283\/revisions\/1291"}],"wp:attachment":[{"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/media?parent=1283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/categories?post=1283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/tags?post=1283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}