Monday, April 29, 2019

How to calculate the total number of forum posts from the course logs in Moodle

The course logs in Moodle contains a treasure trove of data for learning analytics. One of the numerous data points in the logs pertains to the forums in the course. If you'd like to calculate the total number of posts learners have made on the forums, how many posts were made in each forum, or who has posted how many posts, look no further than the course logs.

1. Go to Reports -> Logs from the Course Administration menu.

2. The default settings that you see on the Logs page gives you "everything but the kitchen sink" kind of data. For a course with 1000 learners, the Logs could have more than 300,000 events! At least that's my experience. You might not want to generate a spreadsheet with so much data. I prefer to use the "All changes" option instead of the default "All actions" option to zoom in a little closer to the events of interest, in this case, forum posts. This gives me a substantially smaller number of events to work with, for example, 50,000 instead of 300,000. This is of course still a daunting number but it yields a manageable number of categories for the next stage of spreadsheet processing.

3. Click "Get these logs".

4. Scroll to the bottom of the page and download the table data as a CSV or Excel spreadsheet. I'd suggest CSV for faster data generation and downloading. You can change the file format if you'd like when you open the sheet with Excel.

5. Once the sheet gets downloaded, open it with Excel (or LibreOffice/OpenOffice). Generate a pivot table with all of the data as the base.

6. In the new tab with the pivot table, put the following in the field list: "Component" in the Filters section, "Event name" in the Rows section, and "Time" (as count) in the Values section. Leave the Columns section empty. You can use some other field instead of Time for the values - this is simply to count the events.

You'll then see something like this (the numbers below are actual figures from a course with around 800 learners):


7. With this table, you can calculate the total number of posts made in all the forums in the course. Use either of the below formulas to get this data:

Discussion created + Post created - Post deleted
OR
Some content has been posted - Post updated - Post deleted

To find out the total number of posts made in each forum in the course, put "Event context" in the Columns section of the pivot table's field list. And to look at the posts made by each learner, put "User full name" in the Rows section - when you do this, you might want to choose either "Event name" or "Event context" for the Columns section, as using both together might make the data intractable to work with.