Skip to content

K2 Mentor Integration

The K2 Mentor integration connects the Stratpoint Timesheet Application with the K2 Mentor Learning Management System, enabling seamless tracking of learning activities, skill development, and professional growth aligned with project work.

Integration Overview

K2 Mentor System Architecture

graph TB
    A[Timesheet Application] --> B[K2 Mentor Integration Layer]
    B --> C[Learning Activity Tracking]
    B --> D[Skill Development]
    B --> E[Mentorship Management]

    C --> F[Course Enrollment]
    C --> G[Progress Tracking]
    C --> H[Completion Certification]

    D --> I[Skill Assessment]
    D --> J[Learning Paths]
    D --> K[Competency Mapping]

    E --> L[Mentor Assignment]
    E --> M[Session Scheduling]
    E --> N[Progress Reviews]

    O[K2 Mentor LMS] --> B

Key Integration Features

  • Learning Time Tracking: Automatic logging of learning activities as timesheet entries
  • Skill Development Alignment: Connect project work with skill development goals
  • Mentorship Session Management: Schedule and track mentoring sessions
  • Competency Mapping: Map project requirements to learning objectives
  • Progress Analytics: Combined learning and work performance insights

Configuration and Setup

K2 Mentor Integration Configuration

{
    "k2mentor_config": {
        "api_endpoint": "https://api.k2mentor.stratpoint.com/v2",
        "authentication": {
            "type": "oauth2",
            "client_id": "timesheet_k2mentor_client",
            "client_secret": "${K2MENTOR_CLIENT_SECRET}",
            "scope": ["courses", "progress", "mentorship", "skills"]
        },
        "sync_settings": {
            "learning_activity_sync": "real_time",
            "skill_progress_sync": "daily",
            "mentorship_sync": "hourly",
            "batch_size": 100
        },
        "learning_categories": {
            "technical_training": {
                "work_category": "ADMIN-TRAIN",
                "billable": false,
                "requires_approval": false
            },
            "certification_study": {
                "work_category": "ADMIN-CERT",
                "billable": false,
                "requires_approval": true
            },
            "mentorship_session": {
                "work_category": "ADMIN-MENTOR",
                "billable": false,
                "requires_approval": false
            }
        }
    }
}

Learning Activity Mapping

// Learning Activity Categories
const learningActivityMapping = {
    course_types: {
        "technical_course": {
            name: "Technical Course",
            category: "technical_training",
            auto_log_time: true,
            skill_credits: 1.0
        },
        "certification_prep": {
            name: "Certification Preparation",
            category: "certification_study",
            auto_log_time: true,
            skill_credits: 1.5
        },
        "workshop": {
            name: "Workshop/Seminar",
            category: "technical_training",
            auto_log_time: true,
            skill_credits: 0.5
        },
        "mentorship": {
            name: "Mentorship Session",
            category: "mentorship_session",
            auto_log_time: true,
            skill_credits: 0.8
        },
        "self_study": {
            name: "Self-Directed Learning",
            category: "technical_training",
            auto_log_time: false,
            skill_credits: 0.3
        }
    },
    skill_domains: {
        "programming": ["JavaScript", "Python", "Java", "C#", "PHP"],
        "frameworks": ["React", "Angular", "Vue.js", "Laravel", "Spring"],
        "databases": ["MySQL", "PostgreSQL", "MongoDB", "Redis"],
        "cloud": ["AWS", "Azure", "Google Cloud", "Docker", "Kubernetes"],
        "methodologies": ["Agile", "Scrum", "DevOps", "CI/CD"],
        "soft_skills": ["Leadership", "Communication", "Project Management"]
    }
};

Learning Activity Synchronization

Automatic Time Logging

// Automatic Learning Activity Time Logging
function syncLearningActivityToTimesheet(activityId) {
    const activity = getK2MentorActivity(activityId);
    const employee = getEmployeeByK2MentorId(activity.learner_id);

    if (!employee) {
        throw new Error(`Employee not found for K2 Mentor ID: ${activity.learner_id}`);
    }

    const activityType = learningActivityMapping.course_types[activity.type];
    if (!activityType || !activityType.auto_log_time) {
        return; // Skip activities that don't auto-log time
    }

    const timeEntry = {
        user_id: employee.id,
        project_id: null, // Learning activities are not project-specific
        work_category: activityType.category,
        time_code: 'REG',
        date: activity.session_date || activity.completion_date,
        hours: activity.duration_hours,
        description: `${activityType.name}: ${activity.title}`,
        is_billable: false,
        source: 'k2mentor',
        external_reference: activity.id,
        metadata: {
            course_id: activity.course_id,
            instructor: activity.instructor,
            completion_status: activity.status,
            skill_credits: activityType.skill_credits
        }
    };

    // Validate and create time entry
    const validation = validateTimeEntry(timeEntry);
    if (validation.isValid) {
        const createdEntry = createTimeEntry(timeEntry);

        // Update skill progress
        updateSkillProgress(employee.id, activity);

        // Notify employee
        notifyEmployeeOfAutoLoggedTime(employee.id, createdEntry);

        return createdEntry;
    } else {
        logValidationError('K2 Mentor time entry validation failed', validation.errors);
    }
}

// Skill Progress Update
function updateSkillProgress(employeeId, activity) {
    const employee = getEmployee(employeeId);
    const skillsGained = extractSkillsFromActivity(activity);

    skillsGained.forEach(skill => {
        const currentLevel = getEmployeeSkillLevel(employeeId, skill.name);
        const creditValue = skill.credits * learningActivityMapping.course_types[activity.type].skill_credits;

        const updatedLevel = calculateNewSkillLevel(currentLevel, creditValue);

        updateEmployeeSkill(employeeId, {
            skill_name: skill.name,
            previous_level: currentLevel,
            new_level: updatedLevel,
            credits_earned: creditValue,
            source_activity: activity.id,
            updated_date: new Date()
        });
    });

    // Update K2 Mentor with timesheet-based skill usage
    syncSkillUsageToK2Mentor(employeeId);
}

Mentorship Session Management

// Mentorship Session Integration
function scheduleMentorshipSession(sessionData) {
    const mentor = getEmployeeByK2MentorId(sessionData.mentor_id);
    const mentee = getEmployeeByK2MentorId(sessionData.mentee_id);

    if (!mentor || !mentee) {
        throw new Error('Mentor or mentee not found in timesheet system');
    }

    // Create calendar entries for both participants
    const mentorCalendarEntry = {
        user_id: mentor.id,
        title: `Mentorship Session with ${mentee.full_name}`,
        start_time: sessionData.scheduled_start,
        end_time: sessionData.scheduled_end,
        type: 'mentorship',
        external_reference: sessionData.session_id
    };

    const menteeCalendarEntry = {
        user_id: mentee.id,
        title: `Mentorship Session with ${mentor.full_name}`,
        start_time: sessionData.scheduled_start,
        end_time: sessionData.scheduled_end,
        type: 'mentorship',
        external_reference: sessionData.session_id
    };

    createCalendarEntry(mentorCalendarEntry);
    createCalendarEntry(menteeCalendarEntry);

    // Send notifications
    notifyMentorshipParticipants(mentor, mentee, sessionData);

    return {
        session_id: sessionData.session_id,
        mentor_calendar_id: mentorCalendarEntry.id,
        mentee_calendar_id: menteeCalendarEntry.id,
        status: 'scheduled'
    };
}

// Mentorship Session Completion
function completeMentorshipSession(sessionId, completionData) {
    const session = getK2MentorSession(sessionId);
    const mentor = getEmployeeByK2MentorId(session.mentor_id);
    const mentee = getEmployeeByK2MentorId(session.mentee_id);

    // Auto-log time for both participants
    const mentorTimeEntry = {
        user_id: mentor.id,
        work_category: 'ADMIN-MENTOR',
        time_code: 'REG',
        date: completionData.session_date,
        hours: completionData.duration_hours,
        description: `Mentorship Session - Mentoring ${mentee.full_name}`,
        is_billable: false,
        source: 'k2mentor',
        external_reference: sessionId
    };

    const menteeTimeEntry = {
        user_id: mentee.id,
        work_category: 'ADMIN-MENTOR',
        time_code: 'REG',
        date: completionData.session_date,
        hours: completionData.duration_hours,
        description: `Mentorship Session - Learning from ${mentor.full_name}`,
        is_billable: false,
        source: 'k2mentor',
        external_reference: sessionId
    };

    createTimeEntry(mentorTimeEntry);
    createTimeEntry(menteeTimeEntry);

    // Update mentorship progress
    updateMentorshipProgress(session.mentorship_program_id, completionData);

    return {
        mentor_time_entry: mentorTimeEntry.id,
        mentee_time_entry: menteeTimeEntry.id,
        session_status: 'completed'
    };
}

Skill Development Integration

Project-Skill Alignment

// Project-Skill Alignment Analysis
function analyzeProjectSkillAlignment(employeeId, period) {
    const employee = getEmployee(employeeId);
    const projectWork = getEmployeeProjectWork(employeeId, period);
    const learningActivities = getK2MentorLearningActivities(employee.k2mentor_id, period);

    const alignment = {
        employee_id: employeeId,
        period: period,
        project_skills_used: [],
        learning_skills_gained: [],
        alignment_score: 0,
        recommendations: []
    };

    // Analyze skills used in projects
    projectWork.forEach(project => {
        const projectSkills = extractProjectSkills(project);
        alignment.project_skills_used.push(...projectSkills);
    });

    // Analyze skills gained from learning
    learningActivities.forEach(activity => {
        const learningSkills = extractSkillsFromActivity(activity);
        alignment.learning_skills_gained.push(...learningSkills);
    });

    // Calculate alignment score
    alignment.alignment_score = calculateSkillAlignmentScore(
        alignment.project_skills_used,
        alignment.learning_skills_gained
    );

    // Generate recommendations
    alignment.recommendations = generateSkillRecommendations(
        alignment.project_skills_used,
        alignment.learning_skills_gained,
        employee
    );

    return alignment;
}

// Skill Gap Analysis
function performSkillGapAnalysis(employeeId) {
    const employee = getEmployee(employeeId);
    const currentSkills = getEmployeeSkills(employeeId);
    const projectRequirements = getUpcomingProjectSkillRequirements(employeeId);
    const availableCourses = getK2MentorAvailableCourses(employee.k2mentor_id);

    const gaps = [];

    projectRequirements.forEach(requirement => {
        const currentLevel = currentSkills.find(s => s.name === requirement.skill)?.level || 0;
        const requiredLevel = requirement.required_level;

        if (currentLevel < requiredLevel) {
            const gap = {
                skill: requirement.skill,
                current_level: currentLevel,
                required_level: requiredLevel,
                gap_size: requiredLevel - currentLevel,
                project: requirement.project_name,
                deadline: requirement.project_start_date,
                recommended_courses: availableCourses.filter(course => 
                    course.skills.includes(requirement.skill) &&
                    course.target_level >= requiredLevel
                )
            };

            gaps.push(gap);
        }
    });

    return {
        employee_id: employeeId,
        skill_gaps: gaps.sort((a, b) => b.gap_size - a.gap_size),
        total_gaps: gaps.length,
        critical_gaps: gaps.filter(g => g.deadline && new Date(g.deadline) <= addDays(new Date(), 30)),
        analysis_date: new Date()
    };
}

Learning Analytics Integration

Combined Learning and Performance Analytics

// Learning Performance Analytics
function generateLearningPerformanceAnalytics(employeeId, period) {
    const employee = getEmployee(employeeId);
    const timesheetData = getEmployeeTimesheetData(employeeId, period);
    const learningData = getK2MentorLearningData(employee.k2mentor_id, period);

    const analytics = {
        employee_id: employeeId,
        period: period,
        learning_metrics: {
            total_learning_hours: learningData.total_hours,
            courses_completed: learningData.completed_courses,
            skills_gained: learningData.skills_gained,
            certifications_earned: learningData.certifications,
            mentorship_hours: learningData.mentorship_hours
        },
        performance_metrics: {
            utilization_rate: timesheetData.utilization_rate,
            project_performance: timesheetData.avg_project_rating,
            client_satisfaction: timesheetData.client_satisfaction,
            productivity_score: timesheetData.productivity_score
        },
        correlation_analysis: {},
        development_recommendations: []
    };

    // Analyze correlation between learning and performance
    analytics.correlation_analysis = {
        learning_performance_correlation: calculateCorrelation(
            analytics.learning_metrics.total_learning_hours,
            analytics.performance_metrics.productivity_score
        ),
        skill_utilization_correlation: calculateSkillUtilizationCorrelation(
            learningData.skills_gained,
            timesheetData.skills_used
        ),
        mentorship_impact: calculateMentorshipImpact(
            analytics.learning_metrics.mentorship_hours,
            analytics.performance_metrics
        )
    };

    // Generate development recommendations
    analytics.development_recommendations = generateDevelopmentRecommendations(
        analytics.learning_metrics,
        analytics.performance_metrics,
        analytics.correlation_analysis
    );

    return analytics;
}

// Learning ROI Calculation
function calculateLearningROI(employeeId, period) {
    const employee = getEmployee(employeeId);
    const learningInvestment = calculateLearningInvestment(employeeId, period);
    const performanceGains = calculatePerformanceGains(employeeId, period);

    const roi = {
        employee_id: employeeId,
        period: period,
        investment: {
            learning_hours: learningInvestment.hours,
            learning_cost: learningInvestment.cost,
            opportunity_cost: learningInvestment.opportunity_cost,
            total_investment: learningInvestment.total
        },
        returns: {
            productivity_improvement: performanceGains.productivity_value,
            quality_improvement: performanceGains.quality_value,
            efficiency_gains: performanceGains.efficiency_value,
            total_returns: performanceGains.total
        },
        roi_percentage: ((performanceGains.total - learningInvestment.total) / learningInvestment.total) * 100,
        payback_period_months: calculatePaybackPeriod(learningInvestment.total, performanceGains.monthly_value)
    };

    return roi;
}

Integration Monitoring and Health

K2 Mentor Integration Health Check

// K2 Mentor Integration Health Monitoring
function performK2MentorHealthCheck() {
    const healthStatus = {
        overall_status: 'healthy',
        components: {},
        last_check: new Date()
    };

    // Test API connectivity
    try {
        const apiTest = testK2MentorAPIConnection();
        healthStatus.components.api = {
            status: 'healthy',
            response_time: apiTest.response_time,
            last_sync: apiTest.last_sync
        };
    } catch (error) {
        healthStatus.components.api = {
            status: 'unhealthy',
            error: error.message
        };
        healthStatus.overall_status = 'degraded';
    }

    // Check learning activity sync
    const learningSync = checkLearningActivitySync();
    healthStatus.components.learning_sync = learningSync;

    // Check skill progress sync
    const skillSync = checkSkillProgressSync();
    healthStatus.components.skill_sync = skillSync;

    // Check mentorship integration
    const mentorshipHealth = checkMentorshipIntegration();
    healthStatus.components.mentorship = mentorshipHealth;

    return healthStatus;
}

// Error Handling and Recovery
function handleK2MentorIntegrationError(error, context) {
    const errorLog = {
        timestamp: new Date(),
        error_type: error.type,
        message: error.message,
        context: context,
        severity: determineSeverity(error)
    };

    logK2MentorError(errorLog);

    switch (error.type) {
        case 'learning_activity_sync_failure':
            return retryLearningActivitySync(context);
        case 'skill_progress_error':
            return recalculateSkillProgress(context);
        case 'mentorship_scheduling_conflict':
            return resolveMentorshipConflict(context);
        default:
            return escalateToLearningTeam(errorLog);
    }
}

This comprehensive K2 Mentor integration enables seamless connection between learning activities and work performance, providing insights into skill development effectiveness and supporting data-driven learning and development decisions.