📊CSV Import Templates
Course Enrollment
Student course enrollment CSV for learning management systems.
Explanation
Format for bulk enrolling students in courses with dates and access levels.
Examples
Enrollment CSV
Output
studentEmail,courseId,courseName,enrollmentDate,accessLevel,status,expiryDate john@example.com,COURSE-101,Introduction to Python,2024-12-01,full,active,2025-06-01 jane@example.com,COURSE-101,Introduction to Python,2024-12-05,full,active,2025-06-01 bob@example.com,COURSE-201,Advanced JavaScript,2024-12-10,trial,pending,2024-12-20
Code Examples
JavaScript
// Bulk enroll students
async function enrollStudents(csvData) {
const enrollments = parseCSV(csvData);
const results = { success: 0, errors: [] };
for (const enrollment of enrollments) {
try {
// Validate student exists
const student = await getStudent(enrollment.studentEmail);
if (!student) {
throw new Error('Student not found');
}
// Validate course exists
const course = await getCourse(enrollment.courseId);
if (!course) {
throw new Error('Course not found');
}
// Create enrollment
await createEnrollment({
studentId: student.id,
courseId: enrollment.courseId,
enrollmentDate: new Date(enrollment.enrollmentDate),
accessLevel: enrollment.accessLevel,
status: enrollment.status,
expiryDate: enrollment.expiryDate ? new Date(enrollment.expiryDate) : null
});
results.success++;
} catch (error) {
results.errors.push({
email: enrollment.studentEmail,
courseId: enrollment.courseId,
error: error.message
});
}
}
return results;
}Try it Now
💡 Tips
- Validate student and course exist before enrollment
- Include expiry date for trial/limited access
- Status: active, pending, completed, expired
- Access levels: full, trial, audit
- Send enrollment confirmation emails
- Consider separate CSV for course creation
⚠️ Common Pitfalls
- Duplicate enrollments should be handled
- Invalid course IDs fail silently
- Past expiry dates require immediate expiration
- Missing student records need creation first
- Capacity limits may prevent enrollment