Uploading historical course completion data can be particularly helpful when certification and/or recertification is being used in Moodle Workplace. In the example we will outline here, a training session happened previously and now course completion needs to be updated to satisfy the requirements for a program that contains that course. This process assumes you have a pre-existing course in place that has course completion set.
To upload attendance/completion data for training sessions involves two overarching steps: 1) Generating the completion spreadsheet to upload and 2) Uploading the spreadsheet to Moodle.
Generating the spreadsheet
Step 1: Create your training record spreadsheet.
Create four columns with headings exactly as follows:
Complete the four columns as follows:
Username: Leave this column blank for now.
Email: Enter the email address of the user as listed in their Moodle profile.
Coursecompleted1: In this column, enter the shortname of the completed Moodle course exactly as it appears in the Moodle course settings.
Coursecompleteddate1: For this column, enter the completion date to be recorded in Moodle in the format YYYY-MM-DD.
Step 2: Create a master list of users for username lookup.
Log into your site.
Go to Site administration > Users > Bulk user actions.
Scroll down the page and click on ADD ALL to select all users on the site.
Select Download from the dropdown menu at the bottom of the page and click GO.
Confirm the file export type is set to Comma separated values (.csv) and click Download.
Create a new sheet in your training record spreadsheet.
Import or copy the data from the file downloaded from Moodle into the new sheet.
Step 3: Prepare the master user list spreadsheet for username lookup.
Rename the sheet with the user data exported from Moodle: Master user list.
Delete the first column, labeled id, from the sheet with the user data exported from Moodle.
Insert a column to the right of the column labeled email.
Copy (or cut) the data from the username column and paste it into the column to the right of the email column.
Delete the original username column from the sheet. The resulting sheet should appear as in the example below.
Step 4: Add the formula to the training record spreadsheet to lookup usernames.
Before moving back to the training record spreadsheet, scroll to the bottom of the Master user list spreadsheet and make note of the number of the last row.
Now, return to the training record sheet in your spreadsheet (the one with the coursecompleted columns).
In the first cell of the column labeled username enter the following formula: =vlookup(B2, ‘Master user list’!$A$2:$B$XXXXX, 2, false) where XXXXX is the number of the last row on the master user list spreadsheet.*
Now, copy the formula from the first cell down to the bottom of the username column. The usernames should appear soon after.
Download the completed spreadsheet as a .csv.
If interested, this formula works as follows:
B2 refers to the cell we’re trying to match. In this case, we are looking for the email address of the user in the master list in order to find the username.
‘Master user list’ refers to the name of the sheet to be used to look up the information.
$A$2:$B$XXXXX refers to the range on the master list to be searched. We use dollar signs in front of the row and column numbers so that those numbers don’t change as we copy the formula into other cells.
The 2 tells the spreadsheet which column, counting left to right, on the master use list to refer to when returning information. If we wanted to lookup, or return, the manager’s email address then we would enter 12 instead.
False refers to the fact that the data in the master list is not sorted in ascending order.
Uploading the spreadsheet to Moodle
To upload the spreadsheet to Moodle, complete the following:
Go to Site Administration > Users > Upload users.
Upload the spreadsheet in the designated area either by dragging the file into the space or clicking Choose a file > Upload a file. Click Continue.
On the preview page, configure the options as follow (if not mentioned, leave at default):
Upload type: Update existing users only
Allow suspending and activating accounts: No
Standardize usernames: No
Click Upload users at the bottom of the page. Depending on the number of users in the spreadsheet, this process may take awhile.
Note that sometimes usernames can cause Moodle to generate errors during this process (especially if certain characters are used), but this should not impact the results.
If there are any unique errors, make note or take a screenshot and Moodle Support can work to help you resolve them.
Confirm the process was successful by spot-checking completion data for a few users either directly through the course completion report within a course or through the Moodle Workplace report builder reports.