Skip to main content

Overview

The Microlearning module enables healthcare organizations to deliver short, focused training courses that fit into busy healthcare schedules. With multimodal content, automated quizzes, and instant certification, it’s designed for maximum engagement and minimal time commitment.
Courses are designed to be completed in 15-30 minutes, making them ideal for shift breaks or between-patient downtime.

Key Features

Multimodal Content

Video, audio podcasts, PDFs, and infographics in a single course

Automated Quizzes

Built-in assessments with automatic scoring and instant feedback

Smart Recommendations

AI-powered course suggestions based on role and completed courses

Instant Certification

Automatic certificate generation upon successful completion

Course Structure

Course Schema

Each microcourse includes comprehensive metadata and content:
// From models/MicroCourse.js:1-48
const microCourseSchema = new mongoose.Schema({
  title: { type: String, required: true },
  description: { type: String, required: true },
  
  area: {
    type: String,
    enum: ['enfermeria', 'urgencias', 'maternidad', 'administracion', 'general'],
    required: true
  },
  
  // Multimodal content
  content: {
    videoUrl: String,      // YouTube, Vimeo, or CDN link
    audioUrl: String,      // Podcast MP3
    pdfUrl: String,        // Infographic or reading material
    duration: { type: Number, required: true } // In minutes
  },
  
  // Quiz for assessment
  quiz: [{
    question: { type: String, required: true },
    options: [String],
    correctAnswer: { type: Number, required: true }, // Index of correct option
    points: { type: Number, default: 1 }
  }],
  
  // Certification settings
  certificationType: {
    type: String,
    enum: ['participacion', 'aprobacion'],
    default: 'aprobacion'
  },
  passingScore: { type: Number, default: 70 }
});

Content Types

  • Primary teaching medium
  • Supports YouTube, Vimeo, or self-hosted
  • Recommended: 10-20 minutes
  • Mobile-optimized streaming
  • Alternative to video for auditory learners
  • Ideal for commute or exercise
  • MP3 format for universal compatibility
  • Background listening enabled
  • Quick reference materials
  • Downloadable for offline access
  • Visual learning aids
  • Printable protocols and checklists

Enrollment System

Enroll Employee in Course

1

Check Existing Enrollment

Prevent duplicate enrollments:
// From microLearningService.js:11-35
async enrollEmployee(employeeId, courseId) {
  // Verify not already enrolled
  const existingEnrollment = await CourseEnrollment.findOne({
    employeeId,
    courseId
  });
  
  if (existingEnrollment) {
    throw new AppError('Ya está inscrito en este curso', 400);
  }
  
  const enrollment = new CourseEnrollment({
    employeeId,
    courseId
  });
  
  await enrollment.save();
  return enrollment;
}
2

Create Enrollment Record

Track progress with detailed enrollment data:
const courseEnrollmentSchema = new mongoose.Schema({
  employeeId: { type: ObjectId, ref: 'Employee', required: true },
  courseId: { type: ObjectId, ref: 'MicroCourse', required: true },
  
  progress: {
    status: {
      type: String,
      enum: ['inscrito', 'en_progreso', 'completado', 'reprobado'],
      default: 'inscrito'
    },
    currentWeek: { type: Number, default: 1 },
    week1QuizScore: Number,
    finalQuizScore: Number,
    totalScore: Number,
    completedAt: Date,
    certified: { type: Boolean, default: false },
    certificateIssuedAt: Date
  },
  
  enrolledAt: { type: Date, default: Date.now }
});

API Usage

POST /api/microlearning/enroll
{
  "employeeId": "507f1f77bcf86cd799439011",
  "courseId": "507f1f77bcf86cd799439022"
}

Response:
{
  "status": "success",
  "message": "Inscripción exitosa",
  "data": {
    "enrollment": {
      "_id": "507f1f77bcf86cd799439033",
      "employeeId": "507f1f77bcf86cd799439011",
      "courseId": "507f1f77bcf86cd799439022",
      "progress": {
        "status": "inscrito",
        "currentWeek": 1
      },
      "enrolledAt": "2024-01-15T10:00:00Z"
    }
  }
}

Quiz System

Quiz Structure

Each course can have multiple quizzes:
quiz: [
  {
    question: "¿Cuál es el primer paso en la reanimación cardiopulmonar?",
    options: [
      "Verificar respuesta del paciente",
      "Iniciar compresiones torácicas",
      "Llamar por ayuda",
      "Verificar pulso"
    ],
    correctAnswer: 0, // Index of correct option
    points: 1
  },
  {
    question: "¿Cuántas compresiones por minuto se recomiendan?",
    options: ["60-80", "80-100", "100-120", "120-140"],
    correctAnswer: 2,
    points: 2 // Worth more points
  }
]

Process Quiz Results

1

Submit Answers

Employee submits quiz answers:
POST /api/microlearning/quiz/submit
{
  "employeeId": "507f1f77bcf86cd799439011",
  "courseId": "507f1f77bcf86cd799439022",
  "answers": [0, 2, 1, 3], // Indices of selected options
  "quizType": "final" // or "week1"
}
2

Calculate Score

Automatic scoring based on correct answers:
// From microLearningService.js:90-102
calculateQuizScore(questions, answers) {
  let totalPoints = 0;
  let earnedPoints = 0;
  
  questions.forEach((question, index) => {
    totalPoints += question.points || 1;
    if (answers[index] === question.correctAnswer) {
      earnedPoints += question.points || 1;
    }
  });
  
  return Math.round((earnedPoints / totalPoints) * 100);
}
3

Update Progress

Update enrollment with quiz results:
// From microLearningService.js:40-88
async processQuizResult(employeeId, courseId, answers, quizType = 'final') {
  const course = await MicroCourse.findById(courseId);
  const enrollment = await CourseEnrollment.findOne({ employeeId, courseId });
  
  const score = this.calculateQuizScore(course.quiz, answers);
  
  const updateData = {};
  
  if (quizType === 'week1') {
    updateData['progress.week1QuizScore'] = score;
    updateData['progress.currentWeek'] = 2;
  } else {
    updateData['progress.finalQuizScore'] = score;
    updateData['progress.totalScore'] = (enrollment.progress.week1QuizScore + score) / 2;
    
    // Check if passed
    if (score >= course.passingScore) {
      updateData['progress.status'] = 'completado';
      updateData['progress.completedAt'] = new Date();
      
      // Generate certificate
      if (course.certificationType === 'aprobacion') {
        updateData['progress.certified'] = true;
        updateData['progress.certificateIssuedAt'] = new Date();
      }
    }
  }
  
  await CourseEnrollment.findByIdAndUpdate(enrollment._id, updateData);
  
  return {
    score,
    passed: score >= course.passingScore,
    passingScore: course.passingScore
  };
}
4

Generate Certificate

Automatic certificate generation for passing scores:
if (score >= course.passingScore && course.certificationType === 'aprobacion') {
  updateData['progress.certified'] = true;
  updateData['progress.certificateIssuedAt'] = new Date();
  // Certificate URL generation logic here
}

Quiz Response

{
  "status": "success",
  "data": {
    "result": {
      "score": 85,
      "passed": true,
      "passingScore": 70
    }
  }
}

Recommendation Engine

Personalized Course Recommendations

The system recommends courses based on employee profile and history:
// From microLearningService.js:104-132
async recommendCourses(employeeId) {
  const employee = await Employee.findById(employeeId);
  
  // Get completed courses
  const completedCourses = await CourseEnrollment.find({
    employeeId,
    'progress.status': 'completado'
  }).populate('courseId');
  
  // Get available courses for employee's position
  const availableCourses = await MicroCourse.find({
    isActive: true,
    area: { $in: [employee.jobInfo.position, 'general'] }
  });
  
  // Filter out completed courses
  const completedCourseIds = completedCourses.map(c => c.courseId._id.toString());
  const recommendedCourses = availableCourses.filter(
    course => !completedCourseIds.includes(course._id.toString())
  );
  
  return recommendedCourses.slice(0, 3); // Top 3 recommendations
}

Recommendation Logic

1

Role-Based Filtering

Courses are filtered by employee position:
area: { $in: [employee.jobInfo.position, 'general'] }
Available areas:
  • enfermeria - Nursing-specific content
  • urgencias - Emergency department
  • maternidad - Maternity ward
  • administracion - Administrative staff
  • general - All employees
2

Completion History

Exclude already completed courses:
const completedCourseIds = completedCourses.map(c => c.courseId._id.toString());
const recommendedCourses = availableCourses.filter(
  course => !completedCourseIds.includes(course._id.toString())
);
3

Limit Results

Return top 3 recommendations to avoid overwhelming users:
return recommendedCourses.slice(0, 3);

API Usage

GET /api/microlearning/recommendations/:employeeId

Response:
{
  "status": "success",
  "data": {
    "recommendations": [
      {
        "_id": "507f1f77bcf86cd799439044",
        "title": "Manejo de Crisis en Urgencias",
        "description": "Técnicas para manejar situaciones de alta presión",
        "area": "urgencias",
        "content": {
          "duration": 25,
          "videoUrl": "https://..."
        },
        "passingScore": 70
      },
      {
        "_id": "507f1f77bcf86cd799439055",
        "title": "Comunicación Efectiva con Pacientes",
        "description": "Mejora tus habilidades de comunicación",
        "area": "general",
        "content": {
          "duration": 20,
          "audioUrl": "https://...",
          "pdfUrl": "https://..."
        },
        "passingScore": 70
      }
    ]
  }
}

Certification System

Certification Types

Participation Certificate

Awarded for course completion, regardless of quiz score
certificationType: 'participacion'

Approval Certificate

Awarded only when passing score is achieved
certificationType: 'aprobacion'
passingScore: 70

Certificate Generation

if (score >= course.passingScore) {
  updateData['progress.status'] = 'completado';
  updateData['progress.completedAt'] = new Date();
  
  if (course.certificationType === 'aprobacion') {
    updateData['progress.certified'] = true;
    updateData['progress.certificateIssuedAt'] = new Date();
    // Generate certificate URL
    // updateData['progress.certificateUrl'] = generateCertificateUrl(...);
  }
}
Certificate URL generation logic should be implemented based on your certificate generation service (e.g., PDF generation library, third-party service).

Progress Tracking

Progress States

status: {
  type: String,
  enum: ['inscrito', 'en_progreso', 'completado', 'reprobado'],
  default: 'inscrito'
}
1

inscrito

Initial state when employee enrolls in a course
2

en_progreso

Employee has started watching content or taken Week 1 quiz
3

completado

Employee passed final quiz with score >= passingScore
4

reprobado

Employee failed final quiz (can retake based on course settings)

Track Content Consumption

// Get employee's enrollments with progress
GET /api/microlearning/my-courses/:employeeId

Response:
{
  "enrollments": [
    {
      "course": {
        "title": "RCP Básico",
        "duration": 30
      },
      "progress": {
        "status": "en_progreso",
        "currentWeek": 2,
        "week1QuizScore": 85,
        "certified": false
      },
      "enrolledAt": "2024-01-10T08:00:00Z"
    }
  ]
}

Training Hours Analytics

Track total training hours for HR metrics:
// From correlationService.js:255-265
async calculateTrainingHours(hospitalId, startDate, endDate) {
  const completedCourses = await CourseEnrollment.find({
    'progress.completedAt': { $gte: startDate, $lte: endDate },
    'progress.status': 'completado'
  }).populate('courseId');
  
  return completedCourses.reduce((total, enrollment) => {
    return total + (enrollment.courseId.content.duration || 1);
  }, 0);
}
Training hours are automatically included in monthly hospital performance metrics and correlation analysis.

API Reference

Endpoints

// Enroll employee in course
{
  "employeeId": "507f1f77bcf86cd799439011",
  "courseId": "507f1f77bcf86cd799439022"
}

Best Practices

Short Duration

Keep courses under 30 minutes for maximum completion rates

Multimodal Content

Provide video, audio, and PDF for different learning styles

Mobile-First

Optimize all content for mobile viewing during breaks

Immediate Feedback

Show quiz results instantly to reinforce learning

Next Steps

Recognition Module

Learn about gamification and employee recognition

Course Creation

Guide to creating effective microlearning courses

Correlation Analytics

See how training correlates with performance metrics

API Reference

Complete API documentation for the Microlearning module

Build docs developers (and LLMs) love