Moodle Bulk Enrollment Tools (Multi-Course Import)

A client-side web tool for generating Moodle-compatible CSV files to bulk-enroll users across multiple courses. Built with Vue.js, it processes lists of emails and names, applies formatting rules, and generates downloadable enrollment CSVs for LMS administrators.
Use it here: Moodle Tools
Overview
The Moodle Bulk Upload and Enroll tool is a Vue.js application designed to simplify the process of enrolling multiple users into multiple Moodle courses simultaneously. It eliminates the need for manual CSV creation by automating formatting, validation, and role assignment.
Key Features
- Batch User Creation: Input multiple emails and names, separated by line breaks, to generate user records.
- Flexible Name Parsing: Supports “First Last” or “Last, First” formats with automatic detection.
- Multi-Course Enrollment: Enroll all users into multiple courses with a single CSV export.
- Case & Capitalization Control: Options to convert names to lowercase and capitalize first letters.
- CSV Export: Generates Moodle-compatible CSV files with username, password, name fields, and course/role columns.
- Real-Time Preview: Displays the generated CSV in real-time as users input data.
Example Code Snippets
Parsing User Names (with comma or space separation):
userList: function () {
let splitusers = [];
let userlist = this.names.toLowerCase().split("\n");
userlist.forEach(function (item) {
if (item.includes(",")) {
let user = item.trim().split(/,/);
let firstname = user[1].trim();
let lastname = user[0].trim();
splitusers.push({ first_name: firstname, last_name: lastname });
} else {
let user = item.trim().split(/ +/);
let firstname = user.length > 2 ? user.slice(0, -1).join(" ") : user[0];
let lastname = user.length > 1 ? user[user.length - 1] : "";
splitusers.push({ first_name: firstname, last_name: lastname });
}
});
return splitusers;
}
Generating CSV Output:
csvOutput: function () {
let csv = [];
let csvRow = ["username", "password", "firstname", "lastname", "description", "email"];
arrCourseList.forEach((course, indexCourse) => {
csvRow.push("course" + (indexCourse + 1), "role" + (indexCourse + 1));
});
csv.push(csvRow.toString());
arrEmails.forEach((email, indexEmail) => {
csvRow = [email, this.password, firstName, lastName, this.description, email];
arrCourseList.forEach((course) => {
csvRow.push(course, this.role);
});
csv.push(csvRow.toString());
});
return csv.join('\n');
}
Downloading the CSV File:
downCSV: function () {
let text = this.csvOutput();
let filename = "moodle upload " + new Date().toDateString() + ".csv";
download(filename, text);
}
Technical Highlights
- Vue.js powers real-time reactivity and computed properties for live CSV generation.
- Bootstrap provides a clean, responsive form layout.
- Client-side processing ensures no data is sent to a server, maintaining user privacy.
- Dynamic column generation supports enrolling users into any number of courses with a single CSV.
This tool significantly reduces the time and effort required for bulk Moodle enrollments, especially for institutions managing large cohorts across multiple courses.