-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 24, 2026 at 05:14 PM
-- Server version: 10.4.32-MariaDB
-- PHP Version: 8.2.12

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `yujbjplf_lms`
--

DELIMITER $$
--
-- Procedures
--
CREATE PROCEDURE `capture_student_exam_submission` (IN `p_exam_id` INT, IN `p_student_id` INT, IN `p_attempt_id` INT)  DETERMINISTIC READS SQL DATA BEGIN
        DECLARE v_question_id INT;
        DECLARE v_answer_text LONGTEXT;
        DECLARE v_is_correct BOOLEAN;
        DECLARE v_score DECIMAL(10,2);
        DECLARE v_status VARCHAR(50);
        DECLARE v_question_type VARCHAR(50);
        DECLARE v_points DECIMAL(10, 2);
        DECLARE v_inserted_count INT DEFAULT 0;
        DECLARE done BOOLEAN DEFAULT FALSE;

        DECLARE exam_questions_cursor CURSOR FOR
            SELECT eq.question_id, q.question_type, COALESCE(eq.points, 0)
            FROM exam_questions eq
            JOIN questions q ON eq.question_id = q.id
            WHERE eq.exam_id = p_exam_id
            ORDER BY eq.sort_order, eq.question_id;

        DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;

        START TRANSACTION;

        OPEN exam_questions_cursor;

        question_loop: LOOP
            FETCH exam_questions_cursor INTO v_question_id, v_question_type, v_points;
            IF done THEN LEAVE question_loop; END IF;

            -- Get answer from student_answers
            SELECT
                COALESCE(sa.answer_content, ''),
                COALESCE(sa.is_correct, NULL),
                COALESCE(sa.score, 0)
            INTO v_answer_text, v_is_correct, v_score
            FROM student_answers sa
            WHERE sa.exam_id = p_exam_id
              AND sa.student_id = p_student_id
              AND sa.attempt_id = p_attempt_id
              AND sa.question_id = v_question_id
            LIMIT 1;

            -- Determine status based on question type
            IF v_question_type IN ('essay', 'short_answer', 'code') THEN
                SET v_status = 'pending_manual_review';
            ELSE
                SET v_status = 'submitted';
            END IF;

            -- Update or insert into student_answer
            INSERT INTO student_answer (
                student_id, exam_id, question_id, answer_text, is_correct, score,
                status, submitted_at, attempt_number, created_at, updated_at
            ) VALUES (
                p_student_id, p_exam_id, v_question_id, v_answer_text, v_is_correct, v_score,
                v_status, NOW(), 1, NOW(), NOW()
            )
            ON DUPLICATE KEY UPDATE
                answer_text = VALUES(answer_text),
                is_correct = VALUES(is_correct),
                score = VALUES(score),
                status = VALUES(status),
                submitted_at = VALUES(submitted_at),
                updated_at = NOW();

            SET v_inserted_count = v_inserted_count + 1;

        END LOOP;

        CLOSE exam_questions_cursor;
        COMMIT;

        SELECT 
            TRUE AS success,
            v_inserted_count AS answers_captured,
            CONCAT('Captured ', v_inserted_count, ' answers') AS message;
    END$$

CREATE PROCEDURE `sp_bulk_grade_answers` (IN `p_attempt_id` INT, IN `p_graded_by` INT, IN `p_grading_method` VARCHAR(20))   BEGIN
                DECLARE v_graded_count INT DEFAULT 0;
                DECLARE v_total_count INT DEFAULT 0;
                
                -- Count total answers for this attempt
                SELECT COUNT(*) INTO v_total_count
                FROM student_answers
                WHERE attempt_id = p_attempt_id AND is_graded = FALSE;
                
                -- Mark all ungraded answers as graded (placeholder score of 0 for manual review)
                UPDATE student_answers
                SET is_graded = TRUE,
                    graded_by = p_graded_by,
                    graded_at = NOW(),
                    grading_method = p_grading_method,
                    grading_completed_at = NOW(),
                    status = 'graded',
                    updated_at = NOW()
                WHERE attempt_id = p_attempt_id 
                    AND is_graded = FALSE
                    AND answer_content IS NOT NULL
                    AND answer_content != '';
                
                SET v_graded_count = ROW_COUNT();
                
                SELECT v_graded_count AS graded_count, 
                       v_total_count AS total_count,
                       'completed' AS result;
            END$$

CREATE PROCEDURE `sp_grade_student_answer` (IN `p_answer_id` INT, IN `p_score` DECIMAL(10,2), IN `p_feedback` TEXT, IN `p_graded_by` INT, IN `p_grading_method` VARCHAR(20), IN `p_is_correct` BOOLEAN, IN `p_partial_credit` DECIMAL(10,2))   BEGIN
                DECLARE v_existing_graded_by INT;
                DECLARE v_already_graded BOOLEAN DEFAULT FALSE;
                
                -- Check if already graded
                SELECT graded_by INTO v_existing_graded_by
                FROM student_answers
                WHERE id = p_answer_id;
                
                IF v_existing_graded_by IS NOT NULL THEN
                    SET v_already_graded = TRUE;
                END IF;
                
                -- Update the answer with grading information
                UPDATE student_answers
                SET score = p_score,
                    feedback = p_feedback,
                    is_correct = p_is_correct,
                    is_graded = TRUE,
                    graded_by = p_graded_by,
                    graded_at = NOW(),
                    grading_method = COALESCE(p_grading_method, grading_method),
                    partial_credit = p_partial_credit,
                    grading_completed_at = NOW(),
                    status = 'graded',
                    updated_at = NOW()
                WHERE id = p_answer_id;
                
                -- If already graded, log the update
                IF v_already_graded THEN
                    INSERT INTO student_answer_sync_log (answer_id, action, old_values, new_values, sync_status, synced_at)
                    SELECT p_answer_id, 'update', 
                        JSON_OBJECT('score', score, 'feedback', feedback, 'graded_by', graded_by),
                        JSON_OBJECT('score', p_score, 'feedback', p_feedback, 'graded_by', p_graded_by),
                        'completed', NOW()
                    FROM student_answers
                    WHERE id = p_answer_id;
                END IF;
                
                SELECT p_answer_id AS answer_id, 
                       v_already_graded AS was_already_graded,
                       'graded' AS result;
            END$$

CREATE PROCEDURE `sp_upsert_student_answer` (IN `p_exam_id` INT, IN `p_attempt_id` INT, IN `p_student_id` INT, IN `p_question_id` INT, IN `p_answer_content` LONGTEXT, IN `p_answer_type` VARCHAR(20), IN `p_is_draft` BOOLEAN, IN `p_time_spent` INT, IN `p_ip_address` VARCHAR(45), IN `p_browser_info` TEXT, IN `p_session_id` VARCHAR(100), IN `p_source` VARCHAR(20))   BEGIN
                DECLARE v_existing_id INT DEFAULT NULL;
                DECLARE v_version_number INT DEFAULT 1;
                DECLARE v_answer_hash VARCHAR(64);
                DECLARE v_answer_length INT;
                DECLARE v_word_count INT;
                DECLARE v_char_count INT;
                
                -- Calculate content metrics
                SET v_answer_hash = MD5(p_answer_content);
                SET v_answer_length = CHAR_LENGTH(p_answer_content);
                SET v_char_count = v_answer_length;
                SET v_word_count = LENGTH(p_answer_content) - LENGTH(REPLACE(p_answer_content, ' ', '')) + 1;
                
                -- Check if answer exists
                SELECT id INTO v_existing_id
                FROM student_answers
                WHERE exam_id = p_exam_id 
                    AND (attempt_id = p_attempt_id OR (attempt_id IS NULL AND p_attempt_id IS NULL))
                    AND student_id = p_student_id 
                    AND question_id = p_question_id
                LIMIT 1;
                
                IF v_existing_id IS NOT NULL THEN
                    -- Update existing answer
                    UPDATE student_answers 
                    SET answer_content = p_answer_content,
                        answer_type = COALESCE(p_answer_type, answer_type),
                        answer_hash = v_answer_hash,
                        answer_length = v_answer_length,
                        word_count = v_word_count,
                        char_count = v_char_count,
                        time_spent_seconds = COALESCE(p_time_spent, time_spent_seconds),
                        ip_address = COALESCE(p_ip_address, ip_address),
                        browser_info = p_browser_info,
                        session_id = COALESCE(p_session_id, session_id),
                        source = COALESCE(p_source, source),
                        is_draft = p_is_draft,
                        is_final = NOT p_is_draft,
                        save_count = save_count + 1,
                        last_save_at = NOW(),
                        version_number = version_number + 1,
                        updated_at = NOW()
                    WHERE id = v_existing_id;
                    
                    SELECT v_existing_id AS answer_id, 'updated' AS action;
                ELSE
                    -- Insert new answer
                    INSERT INTO student_answers (
                        exam_id, attempt_id, student_id, question_id,
                        answer_content, answer_type, answer_hash,
                        answer_length, word_count, char_count,
                        time_spent_seconds, ip_address, browser_info,
                        session_id, source, is_draft, is_final,
                        first_save_at, last_save_at, save_count,
                        status, started_at, submitted_at
                    ) VALUES (
                        p_exam_id, p_attempt_id, p_student_id, p_question_id,
                        p_answer_content, p_answer_type, v_answer_hash,
                        v_answer_length, v_word_count, v_char_count,
                        p_time_spent, p_ip_address, p_browser_info,
                        p_session_id, p_source, p_is_draft, NOT p_is_draft,
                        NOW(), NOW(), 1,
                        CASE WHEN p_is_draft THEN 'saved' ELSE 'submitted' END,
                        NOW(), CASE WHEN p_is_draft THEN NULL ELSE NOW() END
                    );
                    
                    SELECT LAST_INSERT_ID() AS answer_id, 'created' AS action;
                END IF;
            END$$

CREATE PROCEDURE `test_debug_procedure` (IN `p_exam_id` INT, IN `p_student_id` INT, IN `p_attempt_id` INT)   BEGIN
    DECLARE v_question_id INT;
    DECLARE v_answer_text TEXT;
    DECLARE v_status VARCHAR(50) DEFAULT 'submitted';
    DECLARE done BOOLEAN DEFAULT FALSE;
    
    DECLARE exam_questions_cursor CURSOR FOR
        SELECT eq.question_id
        FROM exam_questions eq
        WHERE eq.exam_id = p_exam_id
        LIMIT 1;
    
    DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
    
    START TRANSACTION;
    
    OPEN exam_questions_cursor;
    
    question_loop: LOOP
        FETCH exam_questions_cursor INTO v_question_id;
        
        IF done THEN
            LEAVE question_loop;
        END IF;
        
        -- Initialize status
        SET v_status = 'submitted';
        
        -- Try to get answer
        SELECT COALESCE(sa.status, 'no_row_found')
        INTO v_status
        FROM student_answers sa
        WHERE sa.exam_id = p_exam_id
          AND sa.student_id = p_student_id
          AND sa.attempt_id = p_attempt_id
          AND sa.question_id = v_question_id
        LIMIT 1;
        
        -- Insert for debugging
        INSERT INTO student_answer (
            student_id, exam_id, question_id, answer_text, status, attempt_number, created_at
        )
        VALUES (
            p_student_id, p_exam_id, v_question_id,
            CONCAT('Status from proc: ', v_status),
            v_status,
            1,
            NOW()
        )
        ON DUPLICATE KEY UPDATE
            answer_text = CONCAT('Status from proc: ', v_status),
            status = v_status;
            
    END LOOP;
    
    CLOSE exam_questions_cursor;
    COMMIT;
    
    SELECT 'Debug procedure complete' AS result;
END$$

DELIMITER ;

-- --------------------------------------------------------

--
-- Table structure for table `announcements`
--

CREATE TABLE `announcements` (
  `id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `content` text NOT NULL,
  `type` enum('info','warning','success','error') DEFAULT 'info',
  `status` enum('active','inactive') DEFAULT 'inactive',
  `show_on_home` tinyint(1) DEFAULT 1,
  `created_by` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `assignment_submissions`
--

CREATE TABLE `assignment_submissions` (
  `id` int(11) NOT NULL,
  `enrollment_id` int(11) NOT NULL,
  `lesson_id` int(11) NOT NULL,
  `submission_text` longtext DEFAULT NULL,
  `attachment_path` varchar(500) DEFAULT NULL,
  `submitted_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `graded_at` timestamp NULL DEFAULT NULL,
  `grade` decimal(5,2) DEFAULT NULL,
  `feedback` text DEFAULT NULL,
  `status` enum('submitted','graded','returned') DEFAULT 'submitted'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `assignment_submissions`
--

INSERT INTO `assignment_submissions` (`id`, `enrollment_id`, `lesson_id`, `submission_text`, `attachment_path`, `submitted_at`, `graded_at`, `grade`, `feedback`, `status`) VALUES
(1, 2, 8, 'Find my assignment submission. ', '../uploads/assignments/694611e804e8f_AUDIT PREPARATIONS DECEMBER 2025.docx', '2025-12-20 03:03:04', '2025-12-20 03:07:01', 80.00, 'weldone, you answered very well.', 'graded');

-- --------------------------------------------------------

--
-- Table structure for table `calendar_events`
--

CREATE TABLE `calendar_events` (
  `id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `event_date` date NOT NULL,
  `event_time` time DEFAULT '09:00:00',
  `creator_id` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `calendar_events`
--

INSERT INTO `calendar_events` (`id`, `title`, `description`, `event_date`, `event_time`, `creator_id`, `created_at`, `updated_at`) VALUES
(1, 'Student meeting', 'We want to meet and discuss about changes in management', '2025-12-06', '09:00:00', 1, '2025-12-05 23:20:48', '2025-12-05 23:20:48'),
(2, 'Meeting', 'meeting', '2026-01-10', '09:00:00', 1, '2026-01-07 05:21:09', '2026-01-07 05:21:09');

-- --------------------------------------------------------

--
-- Table structure for table `cart_items`
--

CREATE TABLE `cart_items` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `item_type` enum('course','exam') NOT NULL DEFAULT 'course',
  `item_id` int(11) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `cart_items`
--

INSERT INTO `cart_items` (`id`, `user_id`, `item_type`, `item_id`, `created_at`, `updated_at`) VALUES
(3, 1, 'course', 5, '2025-11-27 07:58:07', '2025-11-27 07:58:07'),
(24, 5, 'exam', 4, '2025-12-02 01:53:58', '2025-12-02 01:53:58'),
(57, 7, 'exam', 2, '2026-02-16 01:22:02', '2026-02-26 22:33:54'),
(58, 1, 'exam', 2, '2026-03-17 05:12:01', '2026-03-17 05:12:01'),
(59, 1, 'exam', 11, '2026-03-17 05:12:01', '2026-03-17 05:12:01');

-- --------------------------------------------------------

--
-- Table structure for table `categories`
--

CREATE TABLE `categories` (
  `id` int(11) NOT NULL,
  `name` varchar(50) NOT NULL,
  `slug` varchar(50) NOT NULL,
  `description` text DEFAULT NULL,
  `thumbnail` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `categories`
--

INSERT INTO `categories` (`id`, `name`, `slug`, `description`, `thumbnail`, `created_at`) VALUES
(1, 'News', 'news', 'Latest news and updates', NULL, '2025-09-10 03:45:35'),
(2, 'Articles', 'articles', 'In-depth articles and analysis', NULL, '2025-09-10 03:45:35'),
(4, 'CIPS L5', 'cips-l5', 'This revision CIPS exam structured questions and answers is a supplement to reinforce your study and self-assessment. Do not anticipate it to appear in your official CIPS exams. Always refer to the CIPS syllabus.', NULL, '2025-09-10 04:26:09'),
(6, 'A Stores Management Training', 'a-stores-management-training', 'Explore warehousing and inventory management training content to transform your knowledge and skills', 'assets/images/category_1764228626_6927fe1249fa9.png', '2025-11-05 16:22:19'),
(8, 'CIPS L4M1', 'cips-l4m1', 'This revision CIPS exam structured questions and answers is a supplement to reinforce your study and self-assessment. Do not anticipate it to appear in your official CIPS exams. Always refer to the CIPS syllabus.', NULL, '2025-11-07 04:43:33'),
(9, 'Big Data', 'big-data', 'Questions and answers related to big data in procurement and supply chain. This enables CIPS student attempting L6M4 Module to score better marks.', NULL, '2025-11-09 17:46:56'),
(10, 'CIPS L6M2', 'cips-l6m2', 'This revision CIPS exam structured questions and answers is a supplement to reinforce your study and self-assessment. Do not anticipate it to appear in your official CIPS exams. Always refer to the CIPS syllabus.', NULL, '2025-11-15 08:11:17');

-- --------------------------------------------------------

--
-- Table structure for table `content_analytics`
--

CREATE TABLE `content_analytics` (
  `id` int(11) NOT NULL,
  `content_type` enum('lesson','resource','module') NOT NULL,
  `content_id` int(11) NOT NULL,
  `course_id` int(11) NOT NULL,
  `date` date NOT NULL,
  `views` int(11) DEFAULT 0,
  `unique_views` int(11) DEFAULT 0,
  `time_spent` int(11) DEFAULT 0,
  `completions` int(11) DEFAULT 0,
  `downloads` int(11) DEFAULT 0,
  `shares` int(11) DEFAULT 0,
  `ratings_count` int(11) DEFAULT 0,
  `average_rating` decimal(3,2) DEFAULT 0.00,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `courses`
--

CREATE TABLE `courses` (
  `id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `description` longtext DEFAULT NULL,
  `short_description` text DEFAULT NULL,
  `instructor_id` int(11) NOT NULL,
  `category_id` int(11) DEFAULT NULL,
  `thumbnail` varchar(255) DEFAULT NULL,
  `banner_image` varchar(255) DEFAULT NULL,
  `price` decimal(10,2) DEFAULT 0.00,
  `currency` varchar(3) DEFAULT 'USD',
  `level` enum('beginner','intermediate','advanced') DEFAULT 'beginner',
  `duration_hours` int(11) DEFAULT 0,
  `credit_hours` decimal(3,1) DEFAULT 3.0 COMMENT 'Credit hours for the course (used for GPA calculation)',
  `language` varchar(50) DEFAULT 'English',
  `max_students` int(11) DEFAULT NULL,
  `enrollment_deadline` date DEFAULT NULL,
  `prerequisites` text DEFAULT NULL,
  `learning_objectives` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`learning_objectives`)),
  `tags` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`tags`)),
  `status` enum('draft','published','archived') DEFAULT 'draft',
  `is_featured` tinyint(1) DEFAULT 0,
  `is_free` tinyint(1) DEFAULT 1,
  `certificate_enabled` tinyint(1) DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `courses`
--

INSERT INTO `courses` (`id`, `title`, `slug`, `description`, `short_description`, `instructor_id`, `category_id`, `thumbnail`, `banner_image`, `price`, `currency`, `level`, `duration_hours`, `credit_hours`, `language`, `max_students`, `enrollment_deadline`, `prerequisites`, `learning_objectives`, `tags`, `status`, `is_featured`, `is_free`, `certificate_enabled`, `created_at`, `updated_at`) VALUES
(1, 'Stores Training', 'stores-training', 'The future of the supply chain management', 'Supply chain management', 5, NULL, 'uploads/course-thumbnails/1764027925_KISS_Logo-removebg-preview.png', '', 20.00, 'USD', 'beginner', 0, 1.0, '', NULL, NULL, '', '[]', '[]', 'published', 1, 0, 0, '2025-11-24 23:45:25', '2026-03-14 12:17:37'),
(3, 'CIPS Level4', 'cips-level4', 'Procurement operations', 'Procurement and Supply', 5, NULL, '', '', 10.00, 'USD', 'intermediate', 10, 1.5, 'English', NULL, NULL, 'O. level', '[]', '[]', 'draft', 0, 0, 0, '2025-11-25 11:11:46', '2026-03-14 12:17:37'),
(8, 'L5M1 Tutorial', 'l5m1-tutorial', 'Managing Teams and Individuals (L5M1)', 'Managing Teams and Individuals', 5, 8, 'uploads/course-thumbnails/1765707595_Gemini_Generated_Image_jf6mlyjf6mlyjf6m.png', 'uploads/course-banners/1765707595_Gemini_Generated_Image_3aq5b23aq5b23aq5.png', 0.00, 'USD', 'intermediate', 180, 4.0, 'English', NULL, NULL, '', '[]', '[]', 'published', 0, 1, 0, '2025-12-14 10:19:55', '2026-03-14 12:17:37'),
(9, 'L5M4 Tutorial', 'l5m4-tutorial', 'Advanced Contract and Financial Management (L5M4', 'Advanced Contract and Financial Management (L5M4', 5, 8, '', '', 0.00, 'USD', 'intermediate', 10, 1.5, 'English', NULL, NULL, '', '[]', '[]', 'published', 0, 1, 0, '2025-12-18 06:55:00', '2026-03-14 12:17:37'),
(10, 'L5M2', 'l5m2', 'supply chain', 'Supply chain risk', 5, 8, '', '', 0.00, 'USD', 'intermediate', 10, 1.5, 'English', NULL, NULL, '', '[]', '[]', 'draft', 0, 1, 0, '2026-01-09 06:39:37', '2026-03-14 12:17:37'),
(11, 'L5M3', 'l5m3', 'Managing contract', 'Contracting', 5, 8, '', '', 0.00, 'USD', 'intermediate', 10, 1.5, 'English', NULL, NULL, '', '[]', '[]', 'published', 0, 1, 0, '2026-01-09 14:25:45', '2026-03-14 12:17:37');

-- --------------------------------------------------------

--
-- Table structure for table `course_analytics`
--

CREATE TABLE `course_analytics` (
  `id` int(11) NOT NULL,
  `course_id` int(11) NOT NULL,
  `date` date NOT NULL,
  `views` int(11) DEFAULT 0,
  `enrollments` int(11) DEFAULT 0,
  `completions` int(11) DEFAULT 0,
  `average_rating` decimal(3,2) DEFAULT 0.00,
  `revenue` decimal(10,2) DEFAULT 0.00,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `course_categories`
--

CREATE TABLE `course_categories` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `slug` varchar(100) NOT NULL,
  `description` text DEFAULT NULL,
  `icon` varchar(50) DEFAULT NULL,
  `color` varchar(20) DEFAULT NULL,
  `parent_id` int(11) DEFAULT NULL,
  `sort_order` int(11) DEFAULT 0,
  `is_active` tinyint(1) DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `course_categories`
--

INSERT INTO `course_categories` (`id`, `name`, `slug`, `description`, `icon`, `color`, `parent_id`, `sort_order`, `is_active`, `created_at`, `updated_at`) VALUES
(1, 'Technology', 'technology', 'Courses about programming, software development, and tech skills', 'fas fa-code', '#007bff', NULL, 0, 1, '2025-11-25 11:53:00', '2025-11-25 11:53:00'),
(2, 'Research', 'research', 'Business management, entrepreneurship, and professional development', 'fas fa-briefcase', '#28a745', NULL, 0, 1, '2025-11-25 11:53:00', '2025-11-28 13:04:32'),
(3, 'Design', 'design', 'Graphic design, UI/UX, and creative skills', 'fas fa-palette', '#e83e8c', NULL, 0, 1, '2025-11-25 11:53:00', '2025-11-25 11:53:00'),
(4, 'Marketing', 'marketing', 'Digital marketing, SEO, and advertising strategies', 'fas fa-bullhorn', '#fd7e14', NULL, 0, 1, '2025-11-25 11:53:00', '2025-11-25 11:53:00'),
(5, 'Data Science', 'data-science', 'Data analysis, machine learning, and statistics', 'fas fa-chart-line', '#6f42c1', NULL, 0, 1, '2025-11-25 11:53:00', '2025-11-25 11:53:00'),
(6, 'Languages', 'languages', 'Learn new languages and communication skills', 'fas fa-language', '#20c997', NULL, 0, 1, '2025-11-25 11:53:00', '2025-11-25 11:53:00'),
(7, 'CIPS', 'cips', 'Procurement and Supply', '', '#0400ff', NULL, 0, 0, '2025-11-26 16:18:21', '2025-11-28 13:05:35'),
(8, 'CIPS L5', 'cips-l5', 'Procurement and Supply', '', '#007bff', NULL, 0, 1, '2025-11-28 13:05:23', '2025-11-28 13:05:23'),
(9, 'Business', 'business', 'Business management, entrepreneurship, and professional development', 'fas fa-briefcase', '#28a745', NULL, 2, 1, '2026-01-10 09:55:03', '2026-01-10 09:55:03');

-- --------------------------------------------------------

--
-- Table structure for table `course_enrollments`
--

CREATE TABLE `course_enrollments` (
  `id` int(11) NOT NULL,
  `course_id` int(11) NOT NULL,
  `student_id` int(11) NOT NULL,
  `enrollment_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `completion_date` timestamp NULL DEFAULT NULL,
  `progress_percentage` decimal(5,2) DEFAULT 0.00,
  `status` enum('enrolled','in_progress','completed','dropped') DEFAULT 'enrolled',
  `payment_status` enum('pending','paid','refunded') DEFAULT 'paid',
  `payment_amount` decimal(10,2) DEFAULT 0.00,
  `certificate_issued` tinyint(1) DEFAULT 0,
  `certificate_url` varchar(255) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `course_enrollments`
--

INSERT INTO `course_enrollments` (`id`, `course_id`, `student_id`, `enrollment_date`, `completion_date`, `progress_percentage`, `status`, `payment_status`, `payment_amount`, `certificate_issued`, `certificate_url`, `notes`, `created_at`, `updated_at`) VALUES
(1, 1, 6, '2025-11-25 13:58:27', NULL, 0.00, 'in_progress', 'paid', 0.00, 0, NULL, NULL, '2025-11-25 13:58:27', '2026-01-14 01:35:54'),
(2, 1, 4, '2025-11-25 14:02:36', NULL, 0.00, 'in_progress', 'paid', 0.00, 0, NULL, NULL, '2025-11-25 14:02:36', '2026-03-15 00:14:48'),
(11, 8, 4, '2025-12-14 18:36:56', NULL, 0.00, 'in_progress', 'paid', 0.00, 0, NULL, NULL, '2025-12-14 18:36:56', '2026-03-15 00:14:38'),
(12, 9, 4, '2025-12-18 08:44:47', NULL, 0.00, 'in_progress', 'paid', 0.00, 0, NULL, NULL, '2025-12-18 08:44:47', '2026-03-15 00:15:28'),
(13, 11, 4, '2026-01-11 02:43:01', NULL, 14.00, 'in_progress', 'paid', 0.00, 0, NULL, NULL, '2026-01-11 02:43:01', '2026-03-16 06:14:06'),
(14, 11, 8, '2026-01-31 07:13:10', NULL, 0.00, 'in_progress', 'paid', 0.00, 0, NULL, NULL, '2026-01-31 07:13:10', '2026-02-02 02:08:03'),
(15, 11, 7, '2026-01-31 08:55:04', NULL, 0.00, 'in_progress', 'paid', 0.00, 0, NULL, NULL, '2026-01-31 08:55:04', '2026-02-08 04:45:34'),
(16, 1, 7, '2026-02-02 00:27:52', NULL, 0.00, 'in_progress', 'paid', 20.00, 0, NULL, NULL, '2026-02-02 00:27:52', '2026-02-22 05:52:01'),
(17, 1, 8, '2026-02-02 01:58:17', NULL, 0.00, 'in_progress', 'paid', 20.00, 0, NULL, NULL, '2026-02-02 01:58:17', '2026-02-02 01:58:46');

-- --------------------------------------------------------

--
-- Table structure for table `course_lessons`
--

CREATE TABLE `course_lessons` (
  `id` int(11) NOT NULL,
  `course_id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `lesson_type` enum('video','text','quiz','assignment','resource') DEFAULT 'text',
  `content` longtext DEFAULT NULL,
  `video_url` varchar(500) DEFAULT NULL,
  `video_duration` int(11) DEFAULT 0,
  `attachment_url` varchar(255) DEFAULT NULL,
  `attachment_name` varchar(255) DEFAULT NULL,
  `sort_order` int(11) DEFAULT 0,
  `is_preview` tinyint(1) DEFAULT 0,
  `is_required` tinyint(1) DEFAULT 1,
  `estimated_time` int(11) DEFAULT 0,
  `prerequisites` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`prerequisites`)),
  `learning_objectives` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`learning_objectives`)),
  `module_id` int(11) DEFAULT NULL,
  `topic_id` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `course_lessons`
--

INSERT INTO `course_lessons` (`id`, `course_id`, `title`, `slug`, `description`, `lesson_type`, `content`, `video_url`, `video_duration`, `attachment_url`, `attachment_name`, `sort_order`, `is_preview`, `is_required`, `estimated_time`, `prerequisites`, `learning_objectives`, `module_id`, `topic_id`, `created_at`, `updated_at`) VALUES
(1, 1, 'Opportunities for Technology Implementation:', 'opportunities-for-technology-implementation', '', 'text', '<ul style=\"margin-top:0cm\" type=\"disc\">\r\n <li class=\"MsoNormal\"><b>IoT</b>:\r\n     Enhances storage monitoring and improves forecasting for supply chain\r\n     coordination. For example, IoT-enabled cold chain logistics could reduce\r\n     spoilage in perishable goods.<o:p></o:p></li>\r\n <li class=\"MsoNormal\"><b>Blockchain</b>:\r\n     Enables traceability and prevents fraud while building consumer trust. In\r\n     the Nigerian context, pilot programs have demonstrated its effectiveness\r\n     in deterring counterfeit goods&nbsp;2.<o:p></o:p></li>\r\n <li class=\"MsoNormal\"><b>Mobile\r\n     Apps</b>: Empower transactions directly between farmers and buyers,\r\n     minimizing dependence on intermediaries while fostering smallholder market\r\n     access.<o:p></o:p></li>\r\n <li class=\"MsoNormal\">Infrastructure\r\n     Deficits: Inadequate transportation, unreliable energy, and limited\r\n     digital connectivity hinder efficient supply chain operations and\r\n     technology adoption 2517.<o:p></o:p></li>\r\n <li class=\"MsoNormal\">Digital\r\n     Divide and Literacy: Low digital literacy and limited access to affordable\r\n     digital tools restrict the benefits of digitalization for smallholder\r\n     farmers 514.<o:p></o:p></li>\r\n <li class=\"MsoNormal\">Policy\r\n     and Institutional Barriers: Weak regulatory frameworks and inconsistent\r\n     policies impede the scaling of technological innovations 21916.<o:p></o:p></li>\r\n <li class=\"MsoNormal\">Socioeconomic\r\n     and Gender Disparities: Gender gaps and social inequalities further limit\r\n     equitable access to technology and its benefits 59.<o:p></o:p></li>\r\n</ul>', '', 0, '', '', 1, 1, 1, 30, '[]', '[\"Technology\",\"supply chain\"]', 1, NULL, '2025-11-25 01:04:01', '2025-11-25 01:04:01'),
(2, 1, 'Opportunities for Technology Implementation:', 'opportunities-for-technology-implementation-1', '', 'video', '<ul style=\"margin-top:0cm\" type=\"disc\">\r\n <li class=\"MsoNormal\"><b>IoT</b>:\r\n     Enhances storage monitoring and improves forecasting for supply chain\r\n     coordination. For example, IoT-enabled cold chain logistics could reduce\r\n     spoilage in perishable goods.<o:p></o:p></li>\r\n <li class=\"MsoNormal\"><b>Blockchain</b>:\r\n     Enables traceability and prevents fraud while building consumer trust. In\r\n     the Nigerian context, pilot programs have demonstrated its effectiveness\r\n     in deterring counterfeit goods&nbsp;2.<o:p></o:p></li>\r\n <li class=\"MsoNormal\"><b>Mobile\r\n     Apps</b>: Empower transactions directly between farmers and buyers,\r\n     minimizing dependence on intermediaries while fostering smallholder market\r\n     access.<o:p></o:p></li>\r\n <li class=\"MsoNormal\">Infrastructure\r\n     Deficits: Inadequate transportation, unreliable energy, and limited\r\n     digital connectivity hinder efficient supply chain operations and\r\n     technology adoption 2517.<o:p></o:p></li>\r\n <li class=\"MsoNormal\">Digital\r\n     Divide and Literacy: Low digital literacy and limited access to affordable\r\n     digital tools restrict the benefits of digitalization for smallholder\r\n     farmers 514.<o:p></o:p></li>\r\n <li class=\"MsoNormal\">Policy\r\n     and Institutional Barriers: Weak regulatory frameworks and inconsistent\r\n     policies impede the scaling of technological innovations 21916.<o:p></o:p></li>\r\n <li class=\"MsoNormal\">Socioeconomic\r\n     and Gender Disparities: Gender gaps and social inequalities further limit\r\n     equitable access to technology and its benefits 59.<o:p></o:p></li>\r\n</ul>', 'https://www.youtube.com/watch?v=lRvpngIcof0', 0, '', '', 1, 1, 1, 30, '[]', '[\"Technology\",\"supply chain\"]', 1, NULL, '2025-11-25 01:10:46', '2025-11-25 01:10:46'),
(3, 1, 'Opportunities for Technology Implementation:', 'opportunities-for-technology-implementation-2', '', 'video', '', NULL, 0, NULL, NULL, 1, 1, 1, 30, '[]', '[\"Technology\",\"supply chain\"]', 1, NULL, '2025-11-25 01:14:21', '2026-01-11 13:32:26'),
(4, 3, 'Business intelligent', 'business-intelligent', 'make business the heart of every moment', 'text', '<p class=\"MsoNormal\">Introduction<o:p></o:p></p>\r\n\r\n<p class=\"MsoNormal\">As the food industry plays an important role in providing\r\nthe basics and necessities for supporting human activities and behaviors (Zhong\r\net al., 2017), food safety remains a concern of almost every consumer, and\r\ngovernment (Beske et al, 2014). &nbsp;Studying the Food Supply Chain is\r\nimportant, specifically in Africa where food insufficiency has been recognized\r\nas prevalent and where the population, according to the UN, is expected to\r\nreach 3 billion in 2050. The challenge to feed this population is daunting.&nbsp;<o:p></o:p></p>\r\n\r\n<p class=\"MsoNormal\">Governments and firms operating in Africa face several\r\nobstacles in meeting this challenge. These include poor and underdeveloped\r\ntransportation infrastructure and erratic energy supply in spite of large\r\navailability of resources and poor economies.<o:p></o:p></p>\r\n\r\n<p class=\"MsoNormal\">According to the World Bank, Africa has nearly 600 million\r\nhectares of uncultivated arable land – approximately 60% of the world’s total.\r\nHowever, this potential remains largely underutilized due to the local\r\npopulations\' limited access to daily food needs. African firms and governments\r\ncan leap frog in innovations and technologies implementation. This situation\r\nhighlights the need for academic discourse and empirical research on how\r\neffective supply chain management, supported by appropriate technologies, can\r\nhelp alleviate food insufficiency.<o:p></o:p></p>\r\n\r\n<p class=\"MsoNormal\">Food supply chains in Africa are characterized by the\r\npresence of many vulnerable participants, such as smallholder farmers and\r\npurchasing clerks (Bai et al., 2022) who generally rely on collaborative\r\npractices and transparency to respond to economic pressures and to achieve\r\ngreater coordination in the chains (Matopoulos et al., 2007).<o:p></o:p></p>\r\n\r\n<p class=\"MsoNormal\">However, the use of Western-centric supply chain models,\r\nlike logistics planning models, common in developed countries may be\r\nineffective in Africa due to its unique contextual characteristics. The\r\noriginality of this Special Issue lies in its focus on examining a food supply\r\nchain management model tailored to Africa. It therefore aims to identify and\r\ntheorize on supply chain best practices in the food sector within a context\r\nthat is characterized by high social pressure and economic disruption.<o:p></o:p></p>\r\n\r\n<p class=\"MsoNormal\">This Special Issue explores the dynamics of technologies and\r\nhow such technologies can match the supply chain processes with local needs and\r\nenabling African economies to move toward food self-sufficiency. Furthermore,\r\nunderstanding how the different nodes are interconnected within the African\r\nsupply chains would not only help in identifying improvement points but also\r\nstrengthen local collaborations to face the challenges of globalization.<o:p></o:p></p>\r\n\r\n<p class=\"MsoNormal\">This Special Issue aims to address the following key\r\nquestions:&nbsp;<o:p></o:p></p>', '', 0, '', '', 1, 1, 1, 30, '[]', '[]', 2, NULL, '2025-11-25 11:18:04', '2025-11-25 11:18:04'),
(5, 3, 'Business intelligent', 'business-intelligent-1', 'make business the heart of every moment', 'video', '<p class=\"MsoNormal\">Introduction<o:p></o:p></p>\r\n\r\n<p class=\"MsoNormal\">As the food industry plays an important role in providing\r\nthe basics and necessities for supporting human activities and behaviors (Zhong\r\net al., 2017), food safety remains a concern of almost every consumer, and\r\ngovernment (Beske et al, 2014). &nbsp;Studying the Food Supply Chain is\r\nimportant, specifically in Africa where food insufficiency has been recognized\r\nas prevalent and where the population, according to the UN, is expected to\r\nreach 3 billion in 2050. The challenge to feed this population is daunting.&nbsp;<o:p></o:p></p>\r\n\r\n<p class=\"MsoNormal\">Governments and firms operating in Africa face several\r\nobstacles in meeting this challenge. These include poor and underdeveloped\r\ntransportation infrastructure and erratic energy supply in spite of large\r\navailability of resources and poor economies.<o:p></o:p></p>\r\n\r\n<p class=\"MsoNormal\">According to the World Bank, Africa has nearly 600 million\r\nhectares of uncultivated arable land – approximately 60% of the world’s total.\r\nHowever, this potential remains largely underutilized due to the local\r\npopulations\' limited access to daily food needs. African firms and governments\r\ncan leap frog in innovations and technologies implementation. This situation\r\nhighlights the need for academic discourse and empirical research on how\r\neffective supply chain management, supported by appropriate technologies, can\r\nhelp alleviate food insufficiency.<o:p></o:p></p>\r\n\r\n<p class=\"MsoNormal\">Food supply chains in Africa are characterized by the\r\npresence of many vulnerable participants, such as smallholder farmers and\r\npurchasing clerks (Bai et al., 2022) who generally rely on collaborative\r\npractices and transparency to respond to economic pressures and to achieve\r\ngreater coordination in the chains (Matopoulos et al., 2007).<o:p></o:p></p>\r\n\r\n<p class=\"MsoNormal\">However, the use of Western-centric supply chain models,\r\nlike logistics planning models, common in developed countries may be\r\nineffective in Africa due to its unique contextual characteristics. The\r\noriginality of this Special Issue lies in its focus on examining a food supply\r\nchain management model tailored to Africa. It therefore aims to identify and\r\ntheorize on supply chain best practices in the food sector within a context\r\nthat is characterized by high social pressure and economic disruption.<o:p></o:p></p>\r\n\r\n<p class=\"MsoNormal\">This Special Issue explores the dynamics of technologies and\r\nhow such technologies can match the supply chain processes with local needs and\r\nenabling African economies to move toward food self-sufficiency. Furthermore,\r\nunderstanding how the different nodes are interconnected within the African\r\nsupply chains would not only help in identifying improvement points but also\r\nstrengthen local collaborations to face the challenges of globalization.<o:p></o:p></p>\r\n\r\n<p class=\"MsoNormal\">This Special Issue aims to address the following key\r\nquestions:&nbsp;<o:p></o:p></p>', 'https://www.youtube.com/watch?v=lRvpngIcof0', 0, '', '', 1, 1, 1, 30, '[]', '[]', 2, NULL, '2025-11-25 11:18:42', '2025-11-25 11:18:42'),
(6, 1, 'Getting Started with PHP', 'getting-started-with-php', 'Introduction to PHP basics and environment setup', 'video', '<h2>PHP Basics</h2><p>PHP is a server-side scripting language...</p>', 'https://youtu.be/JxA0UgTox4g', 0, '', '', 1, 0, 1, 30, '[]', '[]', NULL, NULL, '2025-11-25 11:53:00', '2025-11-26 03:05:11'),
(7, 1, 'Variables and Data Types', 'variables-and-data-types', 'Understanding PHP variables and data types', 'video', '<h2>Variables in PHP</h2><p>Variables are containers for storing data values...</p>', 'http://localhost:8080/lms/videos/L5M1 Chapter One Learning Outcome 1.1.0.mp4', 0, '', '', 2, 0, 1, 45, '[]', '[]', NULL, NULL, '2025-11-25 11:53:00', '2025-11-26 03:07:08'),
(8, 1, 'Control Structures', 'control-structures', 'Learn about if statements, loops, and control flow', 'assignment', '<h2>Control Structures</h2><p>Control structures allow you to control the flow of execution...</p>', '', 0, '', '', 3, 0, 1, 60, '[]', '[\"Create the logical sequency of ideas\"]', NULL, NULL, '2025-11-25 11:53:00', '2025-11-29 17:09:41'),
(9, 8, 'Analyse aspects of organisational behaviour', 'analyse-aspects-of-organisational-behaviour', '1.1.1 Behaviour of individuals\r\n1.1.2 Organisational structure and the impact on team\r\nbehaviour\r\n1.1.3 Impact of organisational structures on the process\r\nof management\r\n1.1.4 Organisational metaphors\r\n1.1.5 Impact of the psychological contract in managing\r\nindividuals\r\n1.1.6 STEEPLED factors influencing organisational\r\nbehaviour', 'text', '1.1.1 Behaviour of individuals\r\n1.1.2 Organisational structure and the impact on team\r\nbehaviour\r\n1.1.3 Impact of organisational structures on the process\r\nof management\r\n1.1.4 Organisational metaphors\r\n1.1.5 Impact of the psychological contract in managing\r\nindividuals\r\n1.1.6 STEEPLED factors influencing organisational\r\nbehaviour', '', 0, '', '', 1, 1, 1, 30, '[]', '[\"Behaviour of individuals\"]', NULL, NULL, '2025-12-14 10:29:35', '2025-12-14 10:29:35'),
(10, 8, 'Analyse the traditional approaches of management and organisational behaviour', 'analyse-the-traditional-approaches-of-management-and-organisational-behaviour', 'Administrative approach\r\n1.2.2 Scientific management approach\r\n1.2.3 Bureaucratic approach', 'text', 'Administrative approach\r\n1.2.2 Scientific management approach\r\n1.2.3 Bureaucratic approach', '', 0, '', '', 1, 0, 1, 30, '[]', '[\"Administrative approach 1.2.2 Scientific management approach 1.2.3 Bureaucratic approach\"]', NULL, NULL, '2025-12-14 10:55:24', '2025-12-14 10:55:24'),
(11, 8, 'Assess the alignment of procurement and supply knowledge, skills, and behaviours to the organisational strategy', 'assess-the-alignment-of-procurement-and-supply-knowledge-skills-and-behaviours-to-the-organisational-strategy', 'All', 'text', 'All good&nbsp;', '', 0, '', '', 1, 1, 1, 30, '[]', '[\"4.1.1 The scope of the procurement and supply operation\",\"4.1.2 Methods for identifying the relevant knowledge, skills, and behaviours required\",\"4.1.3 The business case for developing teams\"]', NULL, NULL, '2025-12-14 19:43:50', '2025-12-14 19:43:50'),
(25, 9, '1.3.1 Context and scope for supplier contract  development', '1-3-1-context-and-scope-for-supplier-contract-development', '', 'text', '', NULL, 0, NULL, NULL, 1, 0, 1, 5, NULL, NULL, 13, 9, '2025-12-18 07:02:17', '2025-12-18 07:02:17'),
(26, 9, '1.3.2 Supplier capability assessments', '1-3-2-supplier-capability-assessments', '', 'video', '', NULL, 0, NULL, NULL, 2, 0, 1, 5, NULL, NULL, 13, 9, '2025-12-18 07:02:55', '2025-12-18 07:02:55'),
(27, 9, '1.3.3 Learning, knowledge, and technology transfer  between and across organisations', '1-3-3-learning-knowledge-and-technology-transfer-between-and-across-organisations', '', 'video', '', NULL, 0, NULL, NULL, 3, 0, 1, 5, NULL, NULL, 13, 9, '2025-12-18 07:03:24', '2025-12-18 07:03:24'),
(28, 9, '1.3.4 Collaborative product/service development: cross  functional working, early supplier involvement,  supplier networks, supplier co-ordination and  supplier forums', '1-3-4-collaborative-product-service-development-cross-functional-working-early-supplier-involvement-supplier-networks-supplier-co-ordination-and-supplier-forums', '', 'text', '', NULL, 0, NULL, NULL, 4, 0, 1, 5, NULL, NULL, 13, 9, '2025-12-18 07:03:44', '2025-12-18 07:03:44'),
(29, 9, '1.3.5 Continuous improvement strategies, action plans,  and reviews', '1-3-5-continuous-improvement-strategies-action-plans-and-reviews', '', 'text', '', NULL, 0, NULL, NULL, 5, 0, 1, 5, NULL, NULL, 13, 9, '2025-12-18 07:04:18', '2025-12-18 07:04:18'),
(30, 9, '1.3.5 Continuous improvement strategies, action plans,  and reviews', '1-3-5-continuous-improvement-strategies-action-plans-and-reviews-1', '', 'text', '', NULL, 0, NULL, NULL, 5, 0, 1, 5, NULL, NULL, 13, 9, '2025-12-18 07:26:48', '2025-12-18 07:26:48'),
(71, 11, 'welcome statement', 'welcome-statement', '', 'video', '', 'https://youtu.be/JxA0UgTox4g', 0, NULL, NULL, 1, 0, 1, 30, '[]', '[]', 41, 21, '2026-01-11 13:14:34', '2026-01-11 13:14:34'),
(72, 11, 'intro 2', 'intro-2', '', 'video', '', NULL, 0, NULL, NULL, 2, 0, 1, 30, '[]', '[]', 41, NULL, '2026-01-11 13:28:50', '2026-01-12 00:04:57'),
(73, 11, 'intro 2', 'intro-2-1', '', 'video', '', 'https://www.youtube.com/watch?v=lRvpngIcof0', 0, NULL, NULL, 2, 0, 1, 30, '[]', '[]', 41, NULL, '2026-01-11 13:30:29', '2026-01-11 13:35:58'),
(74, 11, 'Clite statmemt', 'clite-statmemt', '', 'video', '', NULL, 0, NULL, NULL, 2, 0, 1, 30, '[]', '[]', 41, NULL, '2026-01-12 00:07:17', '2026-01-12 00:10:12'),
(75, 11, 'how', 'intro-statement', 'Welcome discount for new students', 'video', 'We provide lessons good for education', 'http://localhost:8080/lms/videos/LM5MLO1.1.1.mp4', 0, '', '', 2, 0, 1, 30, '[]', '[]', 41, 21, '2026-01-12 00:27:59', '2026-01-13 00:55:23'),
(77, 11, 'chipo', 'chipo-1', '', 'video', '<h3 style=\"margin-left:36.0pt\"><b><u><span style=\"font-size:10.0pt;line-height:107%;\r\nfont-family:Poppins\">INVENTORY RECEIVING SKILLS<br></span></u></b><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\nPoppins\">Based on the Standard Operating Procedure (SOP) for General Receiving\r\nGoods at PAB, the skills required to perform these tasks can be categorized\r\ninto technical, administrative, and safety-related competencies. The following\r\nlist identifies the skills available and required for the various roles\r\nmentioned (Receiving Clerk, Storeman, Security, etc.) to achieve the objectives\r\nof the procedure.</span><span style=\"font-size:10.0pt;line-height:107%;font-family:Poppins\"><hr size=\"2\" width=\"100%\" align=\"center\"></span><ol style=\"margin-top:0cm\" start=\"1\" type=\"1\"><li class=\"MsoNormal\"><b><span style=\"font-size: 10pt; line-height: 107%;\">Technical Receiving &amp;\r\n     Inspection Skills</span></b></li></ol><span style=\"font-size:10.0pt;\r\nline-height:107%;font-family:Poppins\">These skills are essential for the\r\nphysical verification and quality control of incoming inventory:</span><ol style=\"margin-top:0cm\" start=\"1\" type=\"a\"><li class=\"MsoNormal\"><b><span style=\"font-size:10.0pt;line-height:107%;font-family:Poppins\">Inventory\r\n      Inspection:</span></b><span style=\"font-size:10.0pt;line-height:107%;\r\n      font-family:Poppins\"> Ability to inspect goods for damages, conformance\r\n      to specifications, and compliance with quality thresholds<b><o:p></o:p></b></span></li></ol><ol style=\"margin-top:0cm\" start=\"1\" type=\"a\"><li class=\"MsoNormal\"><b><span style=\"font-size:10.0pt;line-height:107%;font-family:Poppins\">Technical\r\n      Specification Review:</span></b><span style=\"font-size:10.0pt;line-height:\r\n      107%;font-family:Poppins\"> Capability to review technically specified\r\n      goods (like critical spares) against user requirements<b><o:p></o:p></b></span></li></ol><ol style=\"margin-top:0cm\" start=\"1\" type=\"a\"><li class=\"MsoNormal\"><b><span style=\"font-size:10.0pt;line-height:107%;font-family:Poppins\">Product-Specific\r\n      Handling:</span></b><span style=\"font-size:10.0pt;line-height:107%;\r\n      font-family:Poppins\"> Specialized knowledge for handling and inspecting\r\n      bulk stock (coal, feed) and hazardous materials (chemicals)<b><o:p></o:p></b></span></li></ol><ol style=\"margin-top:0cm\" start=\"1\" type=\"a\"><li class=\"MsoNormal\"><b><span style=\"font-size:10.0pt;line-height:107%;font-family:Poppins\">Temperature\r\n      Monitoring:</span></b><span style=\"font-size:10.0pt;line-height:107%;\r\n      font-family:Poppins\"> Skill in checking vehicle temperature history logs\r\n      and current product temperatures for temperature-controlled goods<b><o:p></o:p></b></span></li></ol><ol style=\"margin-top:0cm\" start=\"1\" type=\"a\"><li class=\"MsoNormal\"><b><span style=\"font-size:10.0pt;line-height:107%;font-family:Poppins\">Sampling\r\n      &amp; Testing:</span></b><span style=\"font-size:10.0pt;line-height:107%;\r\n      font-family:Poppins\"> Ability to collect samples as directed by Quality\r\n      Assurance (QA) and weigh samples for bulk deliveries<b><o:p></o:p></b></span></li></ol></h3>\r\n\r\n\r\n\r\n<div class=\"MsoNormal\" align=\"center\" style=\"text-align:center\"><span style=\"font-size:10.0pt;line-height:107%;font-family:Poppins\">\r\n\r\n\r\n\r\n</span></div>\r\n\r\n<span style=\"font-size:10.0pt;line-height:107%;font-family:Poppins;mso-fareast-font-family:\r\nCalibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:\r\nEN-US;mso-bidi-language:AR-SA\">\r\n\r\n\r\n\r\n</span>', 'https://www.youtube.com/watch?v=UzLoTA74bnA', 0, '', '', 1, 0, 1, 30, '[]', '[]', 41, 21, '2026-01-12 00:53:29', '2026-01-13 01:54:20'),
(78, 11, 'great', 'great', '', 'video', 'work on the production&nbsp;', 'http://localhost/lms/videos/L5M1 Chapter One Learning Outcome 1.1.0.mp4', 0, '', '', 1, 0, 1, 30, '[]', '[]', 41, 21, '2026-01-12 01:13:30', '2026-03-05 04:24:36'),
(79, 11, 'cliteintro lesson', '', '', 'video', '\r\n                    <p>Write your lesson content here...</p>                ', 'http://localhost:8080/lms/videos/LM5M LO1.1.1.mp4', 0, NULL, NULL, 0, 0, 1, 0, NULL, NULL, 41, NULL, '2026-01-12 14:42:28', '2026-01-12 14:42:28'),
(81, 11, 'The fundamentals', '11-the-fundamentals', 'Good news', 'text', '\r\n                    \r\n                    \r\n                    \r\n                    \r\n                    \r\n                    \r\n                    <p><b><u><span>INVENTORY RECEIVING SKILLS</span></u></b></p>\r\n\r\n<p class=\"MsoNormal\"><span>Based on the Standard Operating Procedure (SOP) for General Receiving\r\nGoods at PAB, the skills required to perform these tasks can be categorized\r\ninto technical, administrative, and safety-related competencies. The following\r\nlist identifies the skills available and required for the various roles\r\nmentioned (Receiving Clerk, Storeman, Security, etc.) to achieve the objectives\r\nof the procedure.</span></p>\r\n\r\n<div class=\"MsoNormal\" align=\"center\"><span>\r\n\r\n<hr size=\"2\" width=\"100%\" align=\"center\">\r\n\r\n</span></div>\r\n\r\n<span>\r\n\r\n<ol start=\"1\" type=\"1\">\r\n <li class=\"MsoNormal\"><b><span>Technical Receiving &amp;\r\n     Inspection Skills</span></b></li>\r\n</ol>\r\n\r\n</span>\r\n\r\n<p class=\"MsoNormal\"><span>These skills are essential for the\r\nphysical verification and quality control of incoming inventory:</span></p>\r\n\r\n<ol start=\"1\" type=\"1\">\r\n <ol start=\"1\" type=\"a\">\r\n  <li class=\"MsoNormal\"><b><span>Inventory\r\n      Inspection:</span></b><span> Ability to inspect goods for damages, conformance\r\n      to specifications, and compliance with quality thresholds<b></b></span></li>\r\n  <li class=\"MsoNormal\"><b><span>Technical\r\n      Specification Review:</span></b><span> Capability to review technically specified\r\n      goods (like critical spares) against user requirements<b></b></span></li>\r\n  <li class=\"MsoNormal\"><b><span>Product-Specific\r\n      Handling:</span></b><span> Specialized knowledge for handling and inspecting\r\n      bulk stock (coal, feed) and hazardous materials (chemicals)<b></b></span></li>\r\n  <li class=\"MsoNormal\"><b><span>Temperature\r\n      Monitoring:</span></b><span> Skill in checking vehicle temperature history logs\r\n      and current product temperatures for temperature-controlled goods<b></b></span></li>\r\n  <li class=\"MsoNormal\"><b><span>Sampling\r\n      &amp; Testing:</span></b><span> Ability to collect samples as directed by Quality\r\n      Assurance (QA) and weigh samples for bulk deliveries b<b></b></span></li>\r\n </ol>\r\n</ol><p><br></p>                                                                                                                ', '', 0, NULL, NULL, 1, 0, 1, 0, NULL, NULL, NULL, NULL, '2026-01-12 23:35:48', '2026-01-13 00:15:11'),
(82, 11, 'Great news', 'great-news', '', 'video', 'clite mutale', 'http://localhost:8080/lms/videos/LM5M LO1.1.1.mp4', 0, '', '', 1, 0, 1, 30, '[]', '[]', NULL, NULL, '2026-01-13 00:39:29', '2026-01-13 00:39:29'),
(83, 11, 'Mastering Goods Receiving', 'mastering-goods-receiving', '', 'video', '<p class=\"MsoNormal\"><b><u><span style=\"font-size:10.0pt;line-height:107%;\r\nfont-family:Poppins\">INVENTORY RECEIVING SKILLS<o:p></o:p></span></u></b></p>\r\n\r\n<div class=\"MsoNormal\" align=\"center\" style=\"text-align:center\"><span style=\"font-size:10.0pt;line-height:107%;font-family:Poppins\">\r\n\r\n<hr size=\"2\" width=\"100%\" align=\"center\">\r\n\r\n</span></div>\r\n\r\n<p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\nPoppins\">Based on the Standard Operating Procedure (SOP) for General Receiving\r\nGoods at PAB, the skills required to perform these tasks is categorized into\r\ntechnical, administrative, and safety-related competencies. The following list\r\nidentifies the skills available and required for the various roles mentioned\r\n(Receiving Clerk, Storeman, Security, etc.) to achieve the objectives of the\r\nprocedure.<o:p></o:p></span></p>\r\n\r\n<div class=\"MsoNormal\" align=\"center\" style=\"text-align:center\"><span style=\"font-size:10.0pt;line-height:107%;font-family:Poppins\">\r\n\r\n<hr size=\"2\" width=\"100%\" align=\"center\">\r\n\r\n</span></div>\r\n\r\n<span style=\"font-size:10.0pt;line-height:107%;font-family:Poppins;mso-fareast-font-family:\r\nCalibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:\r\nEN-US;mso-bidi-language:AR-SA\">\r\n\r\n<ol style=\"margin-top:0cm\" start=\"1\" type=\"1\">\r\n <li class=\"MsoNormal\"><b><span style=\"font-size: 10pt; line-height: 107%;\">Technical Receiving &amp;\r\n     Inspection Skills<o:p></o:p></span></b></li>\r\n</ol>\r\n\r\n</span>\r\n\r\n<p class=\"MsoNormal\" style=\"margin-left:36.0pt\"><span style=\"font-size:10.0pt;\r\nline-height:107%;font-family:Poppins\">These skills are essential for the\r\nphysical verification and quality control of incoming inventory:<o:p></o:p></span></p>\r\n\r\n<ol style=\"margin-top:0cm\" start=\"1\" type=\"1\">\r\n <ol style=\"margin-top:0cm\" start=\"1\" type=\"a\">\r\n  <li class=\"MsoNormal\"><b><span style=\"font-size:10.0pt;line-height:107%;font-family:Poppins\">Inventory\r\n      Inspection:</span></b><span style=\"font-size:10.0pt;line-height:107%;\r\n      font-family:Poppins\"> Ability to inspect goods for damages, conformance\r\n      to specifications, and compliance with quality thresholds<b><o:p></o:p></b></span></li>\r\n  <li class=\"MsoNormal\"><b><span style=\"font-size:10.0pt;line-height:107%;font-family:Poppins\">Technical\r\n      Specification Review:</span></b><span style=\"font-size:10.0pt;line-height:\r\n      107%;font-family:Poppins\"> Capability to review technically specified\r\n      goods (like critical spares) against user requirements<b><o:p></o:p></b></span></li>\r\n  <li class=\"MsoNormal\"><b><span style=\"font-size:10.0pt;line-height:107%;font-family:Poppins\">Product-Specific\r\n      Handling:</span></b><span style=\"font-size:10.0pt;line-height:107%;\r\n      font-family:Poppins\"> Specialized knowledge for handling and inspecting\r\n      bulk stock (coal, feed) and hazardous materials (chemicals)<b><o:p></o:p></b></span></li>\r\n  <li class=\"MsoNormal\"><b><span style=\"font-size:10.0pt;line-height:107%;font-family:Poppins\">Temperature\r\n      Monitoring:</span></b><span style=\"font-size:10.0pt;line-height:107%;\r\n      font-family:Poppins\"> Skill in checking vehicle temperature history logs\r\n      and current product temperatures for temperature-controlled goods<b><o:p></o:p></b></span></li>\r\n  <li class=\"MsoNormal\"><b><span style=\"font-size:10.0pt;line-height:107%;font-family:Poppins\">Sampling\r\n      &amp; Testing:</span></b><span style=\"font-size:10.0pt;line-height:107%;\r\n      font-family:Poppins\"> Ability to collect samples as directed by Quality\r\n      Assurance (QA) and weigh samples for bulk deliveries<b><o:p></o:p></b></span></li>\r\n </ol>\r\n</ol>\r\n\r\n<div class=\"MsoNormal\" align=\"center\" style=\"text-align:center\"><span style=\"font-size:10.0pt;line-height:107%;font-family:Poppins\">\r\n\r\n<hr size=\"2\" width=\"100%\" align=\"center\">\r\n\r\n</span></div>', 'http://localhost:8080/lms/videos/Mastering_Goods_Receiving.mp4', 0, '', '', 1, 0, 1, 30, '[]', '[]', 41, 22, '2026-01-13 01:48:43', '2026-01-31 11:09:22'),
(84, 11, 'Define supply chain management', 'define-supply-chain-management', '', 'text', '<p class=\"MsoNormal\"><b><u><span style=\"font-size:10.0pt;line-height:107%;\r\nfont-family:Poppins\">INVENTORY RECEIVING SKILLS<o:p></o:p></span></u></b></p>\r\n\r\n<p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\nPoppins\">Based on the Standard Operating Procedure (SOP) for General Receiving\r\nGoods at PAB, the skills required to perform these tasks can be categorized\r\ninto technical, administrative, and safety-related competencies. The following\r\nlist identifies the skills available and required for the various roles\r\nmentioned (Receiving Clerk, Storeman, Security, etc.) to achieve the objectives\r\nof the procedure.<o:p></o:p></span></p>\r\n\r\n<div class=\"MsoNormal\" align=\"center\" style=\"text-align:center\"><span style=\"font-size:10.0pt;line-height:107%;font-family:Poppins\">\r\n\r\n<hr size=\"2\" width=\"100%\" align=\"center\">\r\n\r\n</span></div>\r\n\r\n<span style=\"font-size:10.0pt;line-height:107%;font-family:Poppins;mso-fareast-font-family:\r\nCalibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:\r\nEN-US;mso-bidi-language:AR-SA\">\r\n\r\n<ol style=\"margin-top:0cm\" start=\"1\" type=\"1\">\r\n <li class=\"MsoNormal\"><b><span style=\"font-size: 10pt; line-height: 107%;\">Technical Receiving &amp;\r\n     Inspection Skills<o:p></o:p></span></b></li>\r\n</ol>\r\n\r\n</span>\r\n\r\n<p class=\"MsoNormal\" style=\"margin-left:36.0pt\"><span style=\"font-size:10.0pt;\r\nline-height:107%;font-family:Poppins\">These skills are essential for the\r\nphysical verification and quality control of incoming inventory:<o:p></o:p></span></p>\r\n\r\n<ol style=\"margin-top:0cm\" start=\"1\" type=\"1\">\r\n <ol style=\"margin-top:0cm\" start=\"1\" type=\"a\">\r\n  <li class=\"MsoNormal\"><b><span style=\"font-size:10.0pt;line-height:107%;font-family:Poppins\">Inventory\r\n      Inspection:</span></b><span style=\"font-size:10.0pt;line-height:107%;\r\n      font-family:Poppins\"> Ability to inspect goods for damages, conformance\r\n      to specifications, and compliance with quality thresholds<b><o:p></o:p></b></span></li>\r\n  <li class=\"MsoNormal\"><b><span style=\"font-size:10.0pt;line-height:107%;font-family:Poppins\">Technical\r\n      Specification Review:</span></b><span style=\"font-size:10.0pt;line-height:\r\n      107%;font-family:Poppins\"> Capability to review technically specified\r\n      goods (like critical spares) against user requirements<b><o:p></o:p></b></span></li>\r\n  <li class=\"MsoNormal\"><b><span style=\"font-size:10.0pt;line-height:107%;font-family:Poppins\">Product-Specific\r\n      Handling:</span></b><span style=\"font-size:10.0pt;line-height:107%;\r\n      font-family:Poppins\"> Specialized knowledge for handling and inspecting\r\n      bulk stock (coal, feed) and hazardous materials (chemicals)<b><o:p></o:p></b></span></li>\r\n  <li class=\"MsoNormal\"><b><span style=\"font-size:10.0pt;line-height:107%;font-family:Poppins\">Temperature\r\n      Monitoring:</span></b><span style=\"font-size:10.0pt;line-height:107%;\r\n      font-family:Poppins\"> Skill in checking vehicle temperature history logs\r\n      and current product temperatures for temperature-controlled goods<b><o:p></o:p></b></span></li>\r\n  <li class=\"MsoNormal\"><b><span style=\"font-size:10.0pt;line-height:107%;font-family:Poppins\">Sampling\r\n      &amp; Testing:</span></b><span style=\"font-size:10.0pt;line-height:107%;\r\n      font-family:Poppins\"> Ability to collect samples as directed by Quality\r\n      Assurance (QA) and weigh samples for bulk deliveries<b><o:p></o:p></b></span></li>\r\n </ol>\r\n</ol>', '', 0, '', '', 1, 0, 1, 30, '[]', '[]', 46, 26, '2026-01-13 01:52:31', '2026-01-13 01:52:31'),
(85, 11, 'Logistics', 'logistics', '', 'video', 'logistics', 'https://vimeo.com/1088628453/956563a8ad?fl=ip&fe=ec', 0, '', '', 2, 0, 1, 30, '[]', '[]', 46, 26, '2026-01-13 01:59:46', '2026-01-13 01:59:46'),
(86, 11, 'Clite reviews', 'clite-reviews', '', 'assignment', 'assignement', '', 0, '', '', 1, 0, 1, 30, '[]', '[]', 46, 26, '2026-01-13 02:09:10', '2026-01-13 02:09:10');

-- --------------------------------------------------------

--
-- Table structure for table `course_lesson_progress`
--

CREATE TABLE `course_lesson_progress` (
  `id` int(11) NOT NULL,
  `enrollment_id` int(11) NOT NULL,
  `lesson_id` int(11) NOT NULL,
  `status` enum('not_started','in_progress','completed') DEFAULT 'not_started',
  `progress_percentage` decimal(5,2) DEFAULT 0.00,
  `time_spent` int(11) DEFAULT 0,
  `completed_at` timestamp NULL DEFAULT NULL,
  `last_accessed` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `notes` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `course_lesson_progress`
--

INSERT INTO `course_lesson_progress` (`id`, `enrollment_id`, `lesson_id`, `status`, `progress_percentage`, `time_spent`, `completed_at`, `last_accessed`, `notes`) VALUES
(1, 2, 1, 'in_progress', 100.00, 0, '2025-12-20 02:56:13', '2026-01-02 03:13:56', NULL),
(3, 2, 2, 'in_progress', 100.00, 0, '2025-12-20 02:56:24', '2026-01-02 03:14:03', NULL),
(5, 2, 3, 'in_progress', 100.00, 0, '2025-12-20 02:56:30', '2026-01-02 03:14:06', NULL),
(6, 2, 6, 'in_progress', 100.00, 0, '2025-12-20 02:56:42', '2026-01-02 03:14:08', NULL),
(7, 2, 7, 'in_progress', 100.00, 0, '2025-12-20 03:01:25', '2026-01-02 03:14:18', NULL),
(8, 2, 8, 'in_progress', 100.00, 0, '2025-12-20 03:03:04', '2026-01-02 03:14:14', NULL),
(13, 11, 9, 'in_progress', 100.00, 0, '2025-12-16 23:27:57', '2025-12-30 00:39:38', NULL),
(14, 11, 10, 'in_progress', 0.00, 0, NULL, '2025-12-25 13:17:39', NULL),
(45, 11, 11, 'in_progress', 0.00, 0, NULL, '2025-12-25 13:17:41', NULL),
(136, 12, 25, 'in_progress', 0.00, 0, NULL, '2025-12-30 10:54:17', NULL),
(139, 12, 26, 'in_progress', 0.00, 0, NULL, '2025-12-20 02:46:14', NULL),
(140, 12, 27, 'in_progress', 0.00, 0, NULL, '2025-12-20 02:46:35', NULL),
(141, 12, 28, 'in_progress', 0.00, 0, NULL, '2025-12-18 15:30:10', NULL),
(142, 12, 29, 'in_progress', 0.00, 0, NULL, '2025-12-18 15:44:58', NULL),
(143, 12, 30, 'in_progress', 0.00, 0, NULL, '2025-12-18 15:44:56', NULL),
(284, 1, 2, 'completed', 100.00, 60, '2026-03-14 23:45:58', '2026-03-14 23:45:58', NULL),
(285, 13, 78, 'completed', 100.00, 2, '2026-03-15 00:05:35', '2026-03-15 00:05:35', NULL),
(287, 13, 75, 'in_progress', 0.00, 0, NULL, '2026-03-15 00:16:17', NULL),
(288, 13, 71, 'in_progress', 0.00, 0, NULL, '2026-03-16 06:14:07', NULL),
(291, 13, 77, 'completed', 100.00, 6, '2026-03-15 00:16:08', '2026-03-15 00:16:08', NULL);

-- --------------------------------------------------------

--
-- Table structure for table `course_modules`
--

CREATE TABLE `course_modules` (
  `id` int(11) NOT NULL,
  `course_id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `sort_order` int(11) DEFAULT 0,
  `is_active` tinyint(1) DEFAULT 1,
  `estimated_time` int(11) DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `course_modules`
--

INSERT INTO `course_modules` (`id`, `course_id`, `title`, `slug`, `description`, `sort_order`, `is_active`, `estimated_time`, `created_at`, `updated_at`) VALUES
(1, 1, 'Introduction', 'welcome to stores training', 'introduction', 1, 1, 5, '2025-11-25 00:56:38', '2025-11-25 00:56:38'),
(2, 3, 'Background', 'True nature of business management', 'background', 1, 1, 30, '2025-11-25 11:16:06', '2025-11-25 11:16:06'),
(13, 9, '1.0 Understand and apply tools and techniques to measure and develop contract  performance in procurement and supply', '1-0-understand-and-apply-tools-and-techniques-to-measure-and-develop-contract-performance-in-procurement-and-supply', '', 1, 1, 30, '2025-12-18 06:56:16', '2025-12-18 06:56:16'),
(14, 9, '2.0 Understand and apply the concept of strategic sourcing', '2-0-understand-and-apply-the-concept-of-strategic-sourcing', '', 2, 1, 30, '2025-12-18 06:56:50', '2025-12-18 06:56:50'),
(15, 9, '3.0 Understand and apply financial techniques that affect supply chains', '3-0-understand-and-apply-financial-techniques-that-affect-supply-chains', '', 3, 1, 30, '2025-12-18 06:57:21', '2025-12-18 06:57:21'),
(16, 9, '4.0 Analyse and apply financial and performance measures that can affect the supply  chain', '4-0-analyse-and-apply-financial-and-performance-measures-that-can-affect-the-supply-chain', '', 4, 1, 30, '2025-12-18 06:57:58', '2025-12-18 06:57:58'),
(17, 9, 'Understand and apply approaches to planning and managing work groups or teams', 'understand-and-apply-approaches-to-planning-and-managing-work-groups-or-teams', '', 1, 1, 0, '2026-01-09 04:22:40', '2026-01-09 04:22:40'),
(18, 9, 'Understand and apply approaches to planning and managing work groups or teams', 'understand-and-apply-approaches-to-planning-and-managing-work-groups-or-teams-1', '', 1, 1, 0, '2026-01-09 04:53:50', '2026-01-09 04:53:50'),
(19, 9, 'Understand and apply approaches to planning and managing work groups or teams', 'understand-and-apply-approaches-to-planning-and-managing-work-groups-or-teams-2', '', 1, 1, 0, '2026-01-09 04:54:18', '2026-01-09 04:54:18'),
(20, 9, 'Understand and apply approaches to planning and managing work groups or teams', 'understand-and-apply-approaches-to-planning-and-managing-work-groups-or-teams-3', '', 1, 1, 0, '2026-01-09 05:49:56', '2026-01-09 05:49:56'),
(21, 10, 'Introduction', 'introduction', '', 1, 1, 0, '2026-01-09 06:40:03', '2026-01-09 06:40:03'),
(22, 10, 'Introduction', 'introduction-1', '', 1, 1, 0, '2026-01-09 06:47:20', '2026-01-09 06:47:20'),
(23, 10, 'Introduction', 'introduction-2', '', 1, 1, 0, '2026-01-09 07:00:08', '2026-01-09 07:00:08'),
(24, 10, 'Introduction', 'introduction-3', '', 1, 1, 0, '2026-01-09 12:01:37', '2026-01-09 12:01:37'),
(27, 1, 'Introduction', '1-introduction', NULL, 2, 1, 0, '2026-01-10 01:28:19', '2026-01-10 07:31:03'),
(41, 11, 'Introduction', '11-introduction-1768137003', '', 1, 1, 0, '2026-01-11 13:10:03', '2026-01-11 13:10:03'),
(46, 11, 'Supply Management', '11-supply-management-1768269024', '', 2, 1, 0, '2026-01-13 01:50:24', '2026-01-13 01:50:50');

-- --------------------------------------------------------

--
-- Table structure for table `course_resources`
--

CREATE TABLE `course_resources` (
  `id` int(11) NOT NULL,
  `course_id` int(11) NOT NULL,
  `module_id` int(11) DEFAULT NULL,
  `lesson_id` int(11) DEFAULT NULL,
  `title` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `resource_type` enum('document','video','audio','image','link','archive','other') DEFAULT 'document',
  `file_path` varchar(500) DEFAULT NULL,
  `file_name` varchar(255) DEFAULT NULL,
  `file_size` int(11) DEFAULT 0,
  `mime_type` varchar(100) DEFAULT NULL,
  `external_url` varchar(500) DEFAULT NULL,
  `thumbnail_path` varchar(255) DEFAULT NULL,
  `category` varchar(100) DEFAULT NULL,
  `tags` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`tags`)),
  `is_shared` tinyint(1) DEFAULT 0,
  `sharing_permissions` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`sharing_permissions`)),
  `download_count` int(11) DEFAULT 0,
  `view_count` int(11) DEFAULT 0,
  `is_active` tinyint(1) DEFAULT 1,
  `created_by` int(11) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `course_resources`
--

INSERT INTO `course_resources` (`id`, `course_id`, `module_id`, `lesson_id`, `title`, `slug`, `description`, `resource_type`, `file_path`, `file_name`, `file_size`, `mime_type`, `external_url`, `thumbnail_path`, `category`, `tags`, `is_shared`, `sharing_permissions`, `download_count`, `view_count`, `is_active`, `created_by`, `created_at`, `updated_at`) VALUES
(1, 3, NULL, NULL, 'Cips level 4 summary notes', 'cips-level-4-summary-notes', 'Welcome to the cips summary notes, that can make you to pass with confidence and prosperity.', 'document', 'uploads/resources/1764313713_69294a71df393.docx', '1764313713_69294a71df393.docx', 33974, 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', NULL, NULL, 'Exam solution', '[\"cips_level_4\"]', 0, '[\"instructor\"]', 0, 0, 1, 5, '2025-11-28 07:08:33', '2025-11-28 07:08:33');

-- --------------------------------------------------------

--
-- Table structure for table `course_reviews`
--

CREATE TABLE `course_reviews` (
  `id` int(11) NOT NULL,
  `course_id` int(11) NOT NULL,
  `student_id` int(11) NOT NULL,
  `rating` int(11) NOT NULL CHECK (`rating` >= 1 and `rating` <= 5),
  `review_title` varchar(255) DEFAULT NULL,
  `review_text` text DEFAULT NULL,
  `is_verified` tinyint(1) DEFAULT 0,
  `helpful_votes` int(11) DEFAULT 0,
  `status` enum('pending','approved','rejected') DEFAULT 'pending',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `course_reviews`
--

INSERT INTO `course_reviews` (`id`, `course_id`, `student_id`, `rating`, `review_title`, `review_text`, `is_verified`, `helpful_votes`, `status`, `created_at`, `updated_at`) VALUES
(1, 1, 4, 5, 'Good', 'Very good course', 1, 0, 'approved', '2025-12-05 22:24:37', '2025-12-05 22:24:37');

-- --------------------------------------------------------

--
-- Table structure for table `course_topics`
--

CREATE TABLE `course_topics` (
  `id` int(11) NOT NULL,
  `module_id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `sort_order` int(11) DEFAULT 1,
  `estimated_time` int(11) DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `course_topics`
--

INSERT INTO `course_topics` (`id`, `module_id`, `title`, `slug`, `description`, `sort_order`, `estimated_time`, `created_at`, `updated_at`) VALUES
(9, 13, '1.1 Assess the application  of key performance  indicators (KPIs) in  delivering contract  performance', '1-1-assess-the-application-of-key-performance-indicators-kpis-in-delivering-contract-performance', '', 1, 10, '2025-12-18 06:59:29', '2025-12-18 06:59:29'),
(10, 13, '1.2 Evaluate methods of  measuring and improving  contract performance', '1-2-evaluate-methods-of-measuring-and-improving-contract-performance', '', 2, 10, '2025-12-18 06:59:50', '2025-12-18 06:59:50'),
(11, 13, '1.3 Examine approaches  available for supplier  contract performance', '1-3-examine-approaches-available-for-supplier-contract-performance', '', 3, 110, '2025-12-18 07:00:12', '2025-12-18 07:00:12'),
(12, 13, '1.4 Assess scope and  developments to improve  ESG (Environmental,  Social, and Governance)  considerations in supply  chains', '1-4-assess-scope-and-developments-to-improve-esg-environmental-social-and-governance-considerations-in-supply-chains', '', 4, 10, '2025-12-18 07:00:34', '2025-12-18 07:00:34'),
(21, 41, 'Clite intro', '41-clite-intro-1768137015', '', 1, 0, '2026-01-11 13:10:15', '2026-01-11 13:10:15'),
(22, 41, 'Stores management', '41-stores-management-1768229277', '', 4, 0, '2026-01-12 14:47:57', '2026-01-12 14:47:57'),
(25, 41, 'Clite introduction', '41-clite-introduction-1768267182', '', 3, 0, '2026-01-13 01:19:42', '2026-01-13 01:19:42'),
(26, 46, 'Define supply chain management', '46-define-supply-chain-management-1768269077', '', 1, 0, '2026-01-13 01:51:17', '2026-01-13 01:51:17');

-- --------------------------------------------------------

--
-- Table structure for table `discount_codes`
--

CREATE TABLE `discount_codes` (
  `id` int(11) NOT NULL,
  `code` varchar(50) NOT NULL,
  `description` text DEFAULT NULL,
  `discount_type` enum('percentage','fixed_amount') NOT NULL,
  `discount_value` decimal(10,2) NOT NULL,
  `max_discount_amount` decimal(10,2) DEFAULT NULL,
  `min_purchase_amount` decimal(10,2) DEFAULT 0.00,
  `usage_limit` int(11) DEFAULT NULL,
  `usage_count` int(11) DEFAULT 0,
  `valid_from` timestamp NULL DEFAULT NULL,
  `valid_until` timestamp NULL DEFAULT NULL,
  `applicable_items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`applicable_items`)),
  `is_active` tinyint(1) DEFAULT 1,
  `created_by` int(11) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `discount_codes`
--

INSERT INTO `discount_codes` (`id`, `code`, `description`, `discount_type`, `discount_value`, `max_discount_amount`, `min_purchase_amount`, `usage_limit`, `usage_count`, `valid_from`, `valid_until`, `applicable_items`, `is_active`, `created_by`, `created_at`, `updated_at`) VALUES
(1, 'WELCOME10', 'Welcome discount for new students', 'percentage', 15.00, NULL, 0.00, 100, 0, NULL, '2026-11-24 22:00:00', NULL, 1, 1, '2025-11-25 11:54:15', '2025-11-26 16:15:50'),
(2, 'EARLYBIRD20', 'Early bird discount', 'percentage', 20.00, NULL, 0.00, 50, 0, NULL, '2026-02-25 11:54:15', NULL, 1, 1, '2025-11-25 11:54:15', '2025-11-25 11:54:15'),
(3, 'STUDENT50', 'Student discount', 'fixed_amount', 50.00, NULL, 0.00, NULL, 0, NULL, '2026-05-25 11:54:15', NULL, 1, 1, '2025-11-25 11:54:15', '2025-11-25 11:54:15');

-- --------------------------------------------------------

--
-- Table structure for table `exams`
--

CREATE TABLE `exams` (
  `id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `description` longtext DEFAULT NULL,
  `course_id` int(11) DEFAULT NULL,
  `instructor_id` int(11) NOT NULL,
  `exam_type` enum('quiz','midterm','final','practice','certification') DEFAULT 'quiz',
  `total_points` decimal(6,2) DEFAULT 0.00,
  `price` decimal(10,2) DEFAULT 0.00,
  `currency` varchar(3) DEFAULT 'USD',
  `is_free` tinyint(1) DEFAULT 1,
  `passing_score` decimal(5,2) DEFAULT 50.00,
  `time_limit` int(11) DEFAULT NULL,
  `max_attempts` int(11) DEFAULT 1,
  `shuffle_questions` tinyint(1) DEFAULT 0,
  `shuffle_options` tinyint(1) DEFAULT 0,
  `show_results` tinyint(1) DEFAULT 1,
  `show_answers` tinyint(1) DEFAULT 0,
  `allow_review` tinyint(1) DEFAULT 1,
  `start_date` timestamp NULL DEFAULT NULL,
  `end_date` timestamp NULL DEFAULT NULL,
  `is_proctored` tinyint(1) DEFAULT 0,
  `proctoring_settings` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`proctoring_settings`)),
  `security_settings` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`security_settings`)),
  `instructions` longtext DEFAULT NULL,
  `status` enum('draft','published','archived') DEFAULT 'draft',
  `is_template` tinyint(1) DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `exams`
--

INSERT INTO `exams` (`id`, `title`, `slug`, `description`, `course_id`, `instructor_id`, `exam_type`, `total_points`, `price`, `currency`, `is_free`, `passing_score`, `time_limit`, `max_attempts`, `shuffle_questions`, `shuffle_options`, `show_results`, `show_answers`, `allow_review`, `start_date`, `end_date`, `is_proctored`, `proctoring_settings`, `security_settings`, `instructions`, `status`, `is_template`, `created_at`, `updated_at`) VALUES
(2, 'cips l4', 'cips-l4', 'supply chain', NULL, 5, 'quiz', 3.00, 10.00, 'USD', 0, 70.00, 30, 4, 1, 0, 1, 0, 1, NULL, NULL, 0, '[]', '[]', 'answer all', 'published', 0, '2025-12-01 18:45:47', '2026-01-31 10:27:45'),
(11, 'L5M1 Quiz 1', 'l5m1-quiz-1', 'Managing Teams and Individuals', NULL, 5, 'quiz', 27.00, 5.00, 'USD', 0, 50.00, 180, 3, 1, 1, 0, 0, 1, NULL, NULL, 0, '[]', '[]', 'Answer All questions', 'published', 0, '2026-01-03 03:01:51', '2026-01-31 10:27:58'),
(12, 'L5M4 Mock 1', 'l5m4-mock-1', 'Financial management', NULL, 5, 'practice', 50.00, 0.00, 'USD', 1, 70.00, 180, 2, 1, 1, 0, 0, 1, NULL, NULL, 0, '[]', '[]', 'Answer all questions', 'published', 0, '2026-03-01 04:06:22', '2026-03-01 12:18:29'),
(13, 'L5M1 Mock 2', 'l5m1-mock-2', 'supply chain', NULL, 5, 'quiz', 76.00, 0.00, 'USD', 1, 70.00, 180, 20, 0, 0, 0, 0, 0, NULL, NULL, 0, '[]', '[]', 'Answer all', 'published', 0, '2026-03-01 12:33:31', '2026-03-07 12:36:38'),
(14, 'L5M1 3', 'l5m1-3', 'Supply chain', NULL, 5, 'practice', 75.00, 0.00, 'USD', 1, 70.00, 180, 10, 0, 0, 1, 0, 1, NULL, NULL, 0, '[]', '[]', 'Answer all questions', 'published', 0, '2026-03-07 12:46:19', '2026-03-07 12:46:19');

-- --------------------------------------------------------

--
-- Table structure for table `exam_access`
--

CREATE TABLE `exam_access` (
  `id` int(11) NOT NULL,
  `exam_id` int(11) NOT NULL,
  `student_id` int(11) NOT NULL,
  `payment_status` enum('pending','paid','free') NOT NULL DEFAULT 'free',
  `payment_amount` decimal(10,2) DEFAULT 0.00,
  `currency` varchar(3) DEFAULT 'USD',
  `access_granted_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `expires_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `exam_access`
--

INSERT INTO `exam_access` (`id`, `exam_id`, `student_id`, `payment_status`, `payment_amount`, `currency`, `access_granted_at`, `expires_at`, `created_at`, `updated_at`) VALUES
(5, 2, 4, 'free', 0.00, 'USD', '2025-12-11 14:42:29', NULL, '2025-12-11 14:42:29', '2025-12-11 14:42:29'),
(8, 12, 4, 'free', 0.00, 'USD', '2026-03-01 04:09:08', NULL, '2026-03-01 04:09:08', '2026-03-01 04:09:08'),
(9, 13, 4, 'free', 0.00, 'USD', '2026-03-01 12:33:44', NULL, '2026-03-01 12:33:44', '2026-03-01 12:33:44'),
(10, 14, 4, 'free', 0.00, 'USD', '2026-03-07 12:46:53', NULL, '2026-03-07 12:46:53', '2026-03-07 12:46:53');

-- --------------------------------------------------------

--
-- Table structure for table `exam_attempts`
--

CREATE TABLE `exam_attempts` (
  `id` int(11) NOT NULL,
  `student_id` int(11) NOT NULL,
  `exam_id` int(11) NOT NULL,
  `attempt_number` int(11) NOT NULL DEFAULT 1,
  `started_at` timestamp NULL DEFAULT NULL,
  `ended_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `score` decimal(10,2) DEFAULT NULL,
  `max_score` decimal(10,2) DEFAULT NULL,
  `percentage` decimal(5,2) DEFAULT NULL,
  `is_passed` tinyint(1) NOT NULL DEFAULT 0,
  `grade` varchar(10) DEFAULT NULL,
  `status` enum('in_progress','saved','submitted','graded','expired','abandoned','pending_review') NOT NULL DEFAULT 'in_progress',
  `completed_at` timestamp NULL DEFAULT NULL,
  `time_limit_minutes` int(11) DEFAULT NULL,
  `time_spent_seconds` int(11) NOT NULL DEFAULT 0,
  `ip_address` varchar(45) DEFAULT NULL,
  `browser_info` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`browser_info`)),
  `device_info` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`device_info`)),
  `user_agent` text DEFAULT NULL,
  `exam_version` varchar(50) DEFAULT NULL,
  `randomized_questions` tinyint(1) NOT NULL DEFAULT 0,
  `tab_switch_count` int(11) NOT NULL DEFAULT 0,
  `max_tab_switches` int(11) NOT NULL DEFAULT 0,
  `is_flagged` tinyint(1) NOT NULL DEFAULT 0,
  `flag_reason` text DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `is_time_expired` tinyint(1) NOT NULL DEFAULT 0,
  `submitted_early` tinyint(1) NOT NULL DEFAULT 0,
  `auto_submitted` tinyint(1) NOT NULL DEFAULT 0,
  `submission_ip` varchar(45) DEFAULT NULL,
  `abandoned_at` timestamp NULL DEFAULT NULL,
  `abandonment_reason` text DEFAULT NULL,
  `graded_by` int(11) DEFAULT NULL,
  `graded_at` timestamp NULL DEFAULT NULL,
  `grading_method` enum('auto','manual','ai','hybrid') DEFAULT NULL,
  `grading_comments` text DEFAULT NULL,
  `feedback` text DEFAULT NULL,
  `feedback_provided` tinyint(1) NOT NULL DEFAULT 0,
  `feedback_viewed_at` timestamp NULL DEFAULT NULL,
  `is_deleted` tinyint(1) NOT NULL DEFAULT 0,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `exam_attempts`
--

INSERT INTO `exam_attempts` (`id`, `student_id`, `exam_id`, `attempt_number`, `started_at`, `ended_at`, `created_at`, `updated_at`, `score`, `max_score`, `percentage`, `is_passed`, `grade`, `status`, `completed_at`, `time_limit_minutes`, `time_spent_seconds`, `ip_address`, `browser_info`, `device_info`, `user_agent`, `exam_version`, `randomized_questions`, `tab_switch_count`, `max_tab_switches`, `is_flagged`, `flag_reason`, `expires_at`, `is_time_expired`, `submitted_early`, `auto_submitted`, `submission_ip`, `abandoned_at`, `abandonment_reason`, `graded_by`, `graded_at`, `grading_method`, `grading_comments`, `feedback`, `feedback_provided`, `feedback_viewed_at`, `is_deleted`, `deleted_at`) VALUES
(1, 4, 14, 1, '2026-03-08 23:31:24', NULL, '2026-03-08 23:31:24', '2026-03-10 04:39:05', 0.00, 75.00, 0.00, 0, NULL, 'submitted', '2026-03-09 00:07:46', NULL, 23, '::1', '{\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/145.0.0.0 Safari\\/537.36\",\"accept_language\":\"en-US,en;q=0.9\"}', NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL),
(2, 4, 14, 2, '2026-03-09 04:15:33', NULL, '2026-03-09 04:15:33', '2026-03-12 17:48:43', 75.00, 75.00, 100.00, 1, NULL, 'graded', '2026-03-09 04:16:10', NULL, 32, '::1', '{\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/145.0.0.0 Safari\\/537.36\",\"accept_language\":\"en-US,en;q=0.9\"}', NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, 0, 0, 0, NULL, NULL, NULL, 5, '2026-03-12 17:48:43', NULL, NULL, 'good news', 0, NULL, 0, NULL),
(3, 4, 14, 3, '2026-03-09 04:55:24', NULL, '2026-03-09 04:55:24', '2026-03-12 17:49:25', 75.00, 75.00, 100.00, 1, NULL, 'graded', '2026-03-09 05:17:32', NULL, 1324, '::1', '{\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/145.0.0.0 Safari\\/537.36\",\"accept_language\":\"en-US,en;q=0.9\"}', NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, 0, 0, 0, NULL, NULL, NULL, 5, '2026-03-12 17:49:25', NULL, NULL, 'great', 0, NULL, 0, NULL),
(10, 4, 2, 1, '2026-03-09 05:12:53', NULL, '2026-03-09 05:12:53', '2026-03-12 23:38:54', 1.00, 3.00, 33.33, 0, NULL, 'graded', '2026-03-09 05:23:11', NULL, 27, '127.0.0.1', NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, 0, 0, 0, NULL, NULL, NULL, 5, '2026-03-12 23:38:54', NULL, NULL, 'good', 0, NULL, 0, NULL),
(12, 4, 2, 2, '2026-03-09 05:13:39', NULL, '2026-03-09 05:13:39', '2026-03-12 23:49:21', 1.00, 3.00, 33.33, 0, NULL, 'graded', NULL, NULL, 0, '127.0.0.1', NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, 0, 0, 0, NULL, NULL, NULL, 5, '2026-03-12 23:49:21', NULL, NULL, '', 0, NULL, 0, NULL),
(13, 4, 12, 1, '2026-03-09 05:25:56', NULL, '2026-03-09 05:25:56', '2026-03-13 00:16:43', 50.00, 50.00, 100.00, 1, NULL, 'graded', '2026-03-09 05:26:33', NULL, 34, '::1', '{\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/145.0.0.0 Safari\\/537.36\",\"accept_language\":\"en-US,en;q=0.9\"}', NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, 0, 0, 0, NULL, NULL, NULL, 5, '2026-03-13 00:16:43', NULL, NULL, 'good', 0, NULL, 0, NULL),
(14, 4, 14, 4, '2026-03-10 03:50:26', NULL, '2026-03-10 03:50:26', '2026-03-10 04:39:05', 0.00, 75.00, 0.00, 0, NULL, 'submitted', '2026-03-10 03:51:13', NULL, 43, '::1', '{\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/145.0.0.0 Safari\\/537.36\",\"accept_language\":\"en-US,en;q=0.9\"}', NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL),
(19, 4, 13, 1, '2026-03-13 01:44:43', NULL, '2026-03-13 01:44:43', '2026-03-13 01:44:43', NULL, NULL, NULL, 0, NULL, 'in_progress', NULL, NULL, 0, '::1', '{\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/146.0.0.0 Safari\\/537.36\",\"accept_language\":\"en-US,en;q=0.9\"}', NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL),
(20, 4, 14, 5, '2026-03-13 02:19:12', NULL, '2026-03-13 02:19:12', '2026-03-13 02:19:12', NULL, NULL, NULL, 0, NULL, 'in_progress', NULL, NULL, 0, '::1', '{\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/146.0.0.0 Safari\\/537.36\",\"accept_language\":\"en-US,en;q=0.9\"}', NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL);

--
-- Triggers `exam_attempts`
--
DELIMITER $$
CREATE TRIGGER `trg_after_exam_attempt_submit` AFTER UPDATE ON `exam_attempts` FOR EACH ROW BEGIN
            DECLARE v_existing_count INT DEFAULT 0;

            IF NEW.status IN ('submitted', 'completed')
               AND OLD.status != NEW.status
               AND NEW.student_id IS NOT NULL
               AND NEW.exam_id IS NOT NULL THEN

                SELECT COUNT(*) INTO v_existing_count
                FROM student_answer
                WHERE exam_id = NEW.exam_id
                  AND student_id = NEW.student_id
                  AND attempt_number = NEW.attempt_number
                  AND submitted_at IS NOT NULL;

                IF v_existing_count = 0 THEN
                    CALL capture_student_exam_submission(
                        NEW.exam_id,
                        NEW.student_id,
                        NEW.id
                    );
                END IF;
            END IF;
        END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `trg_before_exam_attempt_insert` AFTER INSERT ON `exam_attempts` FOR EACH ROW BEGIN
            INSERT IGNORE INTO student_answer (
                student_id,
                exam_id,
                question_id,
                answer_text,
                answer_choice,
                is_correct,
                score,
                status,
                submitted_at,
                attempt_number,
                time_spent_seconds,
                ip_address,
                created_at
            )
            SELECT
                NEW.student_id,
                NEW.exam_id,
                eq.question_id,
                NULL,
                NULL,
                NULL,
                NULL,
                'in_progress',
                NULL,
                NEW.attempt_number,
                0,
                NEW.ip_address,
                NOW()
            FROM exam_questions eq
            WHERE eq.exam_id = NEW.exam_id;
        END
$$
DELIMITER ;

-- --------------------------------------------------------

--
-- Table structure for table `exam_questions`
--

CREATE TABLE `exam_questions` (
  `id` int(11) NOT NULL,
  `exam_id` int(11) NOT NULL,
  `question_id` int(11) NOT NULL,
  `sort_order` int(11) DEFAULT 0,
  `points` decimal(5,2) DEFAULT 1.00,
  `time_limit` int(11) DEFAULT NULL,
  `is_required` tinyint(1) DEFAULT 1,
  `section_name` varchar(100) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `exam_questions`
--

INSERT INTO `exam_questions` (`id`, `exam_id`, `question_id`, `sort_order`, `points`, `time_limit`, `is_required`, `section_name`, `created_at`) VALUES
(87, 11, 33, 1, 1.00, NULL, 1, NULL, '2026-01-31 00:13:16'),
(88, 11, 29, 2, 1.00, NULL, 1, NULL, '2026-01-31 00:13:16'),
(89, 11, 4, 3, 25.00, NULL, 1, NULL, '2026-01-31 00:13:16'),
(93, 2, 39, 1, 1.00, NULL, 1, NULL, '2026-01-31 00:14:07'),
(94, 2, 37, 2, 1.00, NULL, 1, NULL, '2026-01-31 00:14:07'),
(95, 2, 38, 3, 1.00, NULL, 1, NULL, '2026-01-31 00:14:07'),
(100, 12, 41, 1, 25.00, NULL, 1, NULL, '2026-03-01 12:18:29'),
(101, 12, 42, 2, 25.00, NULL, 1, NULL, '2026-03-01 12:18:29'),
(137, 13, 42, 1, 25.00, NULL, 1, NULL, '2026-03-07 12:36:38'),
(138, 13, 41, 2, 25.00, NULL, 1, NULL, '2026-03-07 12:36:38'),
(139, 13, 29, 3, 1.00, NULL, 1, NULL, '2026-03-07 12:36:38'),
(140, 13, 43, 4, 25.00, NULL, 1, NULL, '2026-03-07 12:36:38'),
(141, 14, 43, 1, 25.00, NULL, 1, NULL, '2026-03-07 12:46:19'),
(142, 14, 42, 2, 25.00, NULL, 1, NULL, '2026-03-07 12:46:19'),
(143, 14, 41, 3, 25.00, NULL, 1, NULL, '2026-03-07 12:46:19');

-- --------------------------------------------------------

--
-- Table structure for table `exam_question_grades`
--

CREATE TABLE `exam_question_grades` (
  `id` int(11) NOT NULL,
  `attempt_id` int(11) NOT NULL,
  `question_id` int(11) NOT NULL,
  `points_earned` decimal(10,2) DEFAULT 0.00,
  `max_points` decimal(10,2) DEFAULT 0.00,
  `feedback` text DEFAULT NULL,
  `is_correct` tinyint(1) DEFAULT NULL,
  `graded_by` int(11) DEFAULT NULL,
  `graded_at` timestamp NULL DEFAULT NULL,
  `grading_method` enum('auto','manual','ai') DEFAULT 'auto',
  `rubric_criteria_id` int(11) DEFAULT NULL,
  `rubric_score` decimal(10,2) DEFAULT 0.00,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `exam_question_grades`
--

INSERT INTO `exam_question_grades` (`id`, `attempt_id`, `question_id`, `points_earned`, `max_points`, `feedback`, `is_correct`, `graded_by`, `graded_at`, `grading_method`, `rubric_criteria_id`, `rubric_score`, `created_at`, `updated_at`) VALUES
(22, 2, 41, 25.00, 0.00, '', NULL, 5, '2026-03-12 17:48:43', 'auto', NULL, 0.00, '2026-03-12 17:48:43', '2026-03-12 17:48:43'),
(23, 2, 42, 25.00, 0.00, '', NULL, 5, '2026-03-12 17:48:43', 'auto', NULL, 0.00, '2026-03-12 17:48:43', '2026-03-12 17:48:43'),
(24, 2, 43, 25.00, 0.00, '', NULL, 5, '2026-03-12 17:48:43', 'auto', NULL, 0.00, '2026-03-12 17:48:43', '2026-03-12 17:48:43'),
(25, 3, 41, 25.00, 0.00, '', NULL, 5, '2026-03-12 17:49:25', 'auto', NULL, 0.00, '2026-03-12 17:49:25', '2026-03-12 17:49:25'),
(26, 3, 42, 25.00, 0.00, '', NULL, 5, '2026-03-12 17:49:25', 'auto', NULL, 0.00, '2026-03-12 17:49:25', '2026-03-12 17:49:25'),
(27, 3, 43, 25.00, 0.00, '', NULL, 5, '2026-03-12 17:49:25', 'auto', NULL, 0.00, '2026-03-12 17:49:25', '2026-03-12 17:49:25'),
(28, 10, 37, 0.00, 0.00, '', NULL, 5, '2026-03-12 23:38:54', 'auto', NULL, 0.00, '2026-03-12 23:38:54', '2026-03-12 23:38:54'),
(29, 10, 38, 0.00, 0.00, '', NULL, 5, '2026-03-12 23:38:54', 'auto', NULL, 0.00, '2026-03-12 23:38:54', '2026-03-12 23:38:54'),
(30, 10, 39, 1.00, 0.00, '', NULL, 5, '2026-03-12 23:38:54', 'auto', NULL, 0.00, '2026-03-12 23:38:54', '2026-03-12 23:38:54'),
(31, 12, 37, 0.00, 0.00, '', NULL, 5, '2026-03-12 23:49:21', 'auto', NULL, 0.00, '2026-03-12 23:49:21', '2026-03-12 23:49:21'),
(32, 12, 38, 0.00, 0.00, '', NULL, 5, '2026-03-12 23:49:21', 'auto', NULL, 0.00, '2026-03-12 23:49:21', '2026-03-12 23:49:21'),
(33, 12, 39, 1.00, 0.00, '', NULL, 5, '2026-03-12 23:49:21', 'auto', NULL, 0.00, '2026-03-12 23:49:21', '2026-03-12 23:49:21'),
(34, 13, 41, 25.00, 0.00, '', NULL, 5, '2026-03-13 00:16:43', 'auto', NULL, 0.00, '2026-03-13 00:16:43', '2026-03-13 00:16:43'),
(35, 13, 42, 25.00, 0.00, '', NULL, 5, '2026-03-13 00:16:43', 'auto', NULL, 0.00, '2026-03-13 00:16:43', '2026-03-13 00:16:43');

-- --------------------------------------------------------

--
-- Table structure for table `exam_reviews`
--

CREATE TABLE `exam_reviews` (
  `id` int(11) NOT NULL,
  `exam_id` int(11) NOT NULL,
  `student_id` int(11) NOT NULL,
  `rating` decimal(3,2) NOT NULL,
  `review_text` text DEFAULT NULL,
  `status` enum('pending','approved','rejected') NOT NULL DEFAULT 'pending',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `grade_scale`
--

CREATE TABLE `grade_scale` (
  `id` int(11) NOT NULL,
  `grade_letter` varchar(2) NOT NULL,
  `grade_points` decimal(3,2) NOT NULL,
  `min_percentage` decimal(5,2) NOT NULL,
  `max_percentage` decimal(5,2) NOT NULL,
  `description` varchar(100) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `grade_scale`
--

INSERT INTO `grade_scale` (`id`, `grade_letter`, `grade_points`, `min_percentage`, `max_percentage`, `description`, `is_active`, `created_at`, `updated_at`) VALUES
(1, 'A+', 4.00, 97.00, 100.00, 'Excellent', 1, '2026-03-14 12:17:37', '2026-03-14 12:17:37'),
(2, 'A', 4.00, 93.00, 96.99, 'Excellent', 1, '2026-03-14 12:17:37', '2026-03-14 12:17:37'),
(3, 'A-', 3.70, 90.00, 92.99, 'Excellent', 1, '2026-03-14 12:17:37', '2026-03-14 12:17:37'),
(4, 'B+', 3.30, 87.00, 89.99, 'Good', 1, '2026-03-14 12:17:37', '2026-03-14 12:17:37'),
(5, 'B', 3.00, 83.00, 86.99, 'Good', 1, '2026-03-14 12:17:37', '2026-03-14 12:17:37'),
(6, 'B-', 2.70, 80.00, 82.99, 'Good', 1, '2026-03-14 12:17:37', '2026-03-14 12:17:37'),
(7, 'C+', 2.30, 77.00, 79.99, 'Satisfactory', 1, '2026-03-14 12:17:37', '2026-03-14 12:17:37'),
(8, 'C', 2.00, 73.00, 76.99, 'Satisfactory', 1, '2026-03-14 12:17:37', '2026-03-14 12:17:37'),
(9, 'C-', 1.70, 70.00, 72.99, 'Satisfactory', 1, '2026-03-14 12:17:37', '2026-03-14 12:17:37'),
(10, 'D+', 1.30, 67.00, 69.99, 'Pass', 1, '2026-03-14 12:17:37', '2026-03-14 12:17:37'),
(11, 'D', 1.00, 63.00, 66.99, 'Pass', 1, '2026-03-14 12:17:37', '2026-03-14 12:17:37'),
(12, 'D-', 0.70, 60.00, 62.99, 'Pass', 1, '2026-03-14 12:17:37', '2026-03-14 12:17:37'),
(13, 'F', 0.00, 0.00, 59.99, 'Fail', 1, '2026-03-14 12:17:37', '2026-03-14 12:17:37');

-- --------------------------------------------------------

--
-- Table structure for table `lesson_resources`
--

CREATE TABLE `lesson_resources` (
  `id` int(11) NOT NULL,
  `lesson_id` int(11) NOT NULL,
  `resource_id` int(11) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `lesson_versions`
--

CREATE TABLE `lesson_versions` (
  `id` int(11) NOT NULL,
  `lesson_id` int(11) NOT NULL,
  `version_number` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `content` longtext DEFAULT NULL,
  `video_url` varchar(500) DEFAULT NULL,
  `attachment_url` varchar(255) DEFAULT NULL,
  `attachment_name` varchar(255) DEFAULT NULL,
  `changes_description` text DEFAULT NULL,
  `is_published` tinyint(1) DEFAULT 0,
  `created_by` int(11) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `payment_analytics`
--

CREATE TABLE `payment_analytics` (
  `id` int(11) NOT NULL,
  `date` date NOT NULL,
  `gateway_name` varchar(50) DEFAULT NULL,
  `currency` varchar(3) DEFAULT 'USD',
  `total_transactions` int(11) DEFAULT 0,
  `successful_transactions` int(11) DEFAULT 0,
  `failed_transactions` int(11) DEFAULT 0,
  `total_amount` decimal(15,2) DEFAULT 0.00,
  `refunded_amount` decimal(15,2) DEFAULT 0.00,
  `net_amount` decimal(15,2) DEFAULT 0.00,
  `average_transaction` decimal(10,2) DEFAULT 0.00,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `payment_gateway_settings`
--

CREATE TABLE `payment_gateway_settings` (
  `id` int(11) NOT NULL,
  `gateway_name` varchar(50) NOT NULL,
  `gateway_type` enum('sandbox','live') DEFAULT 'sandbox',
  `api_key` varchar(255) DEFAULT NULL,
  `api_secret` varchar(255) DEFAULT NULL,
  `merchant_id` varchar(255) DEFAULT NULL,
  `merchant_email` varchar(255) DEFAULT NULL,
  `merchant_mobile` varchar(20) DEFAULT NULL,
  `webhook_url` varchar(500) DEFAULT NULL,
  `return_url` varchar(500) DEFAULT NULL,
  `cancel_url` varchar(500) DEFAULT NULL,
  `additional_settings` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`additional_settings`)),
  `is_active` tinyint(1) DEFAULT 0,
  `test_mode` tinyint(1) DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `payment_gateway_settings`
--

INSERT INTO `payment_gateway_settings` (`id`, `gateway_name`, `gateway_type`, `api_key`, `api_secret`, `merchant_id`, `merchant_email`, `merchant_mobile`, `webhook_url`, `return_url`, `cancel_url`, `additional_settings`, `is_active`, `test_mode`, `created_at`, `updated_at`) VALUES
(1, 'paypal', 'sandbox', 'YOUR_PAYPAL_SANDBOX_CLIENT_ID', 'YOUR_PAYPAL_SANDBOX_CLIENT_SECRET', NULL, 'sb-seller@example.com', NULL, NULL, NULL, NULL, NULL, 1, 1, '2025-11-25 11:54:15', '2025-11-28 17:07:50'),
(2, 'paypal', 'live', 'YOUR_PAYPAL_LIVE_CLIENT_ID', 'YOUR_PAYPAL_LIVE_CLIENT_SECRET', NULL, 'seller@example.com', NULL, NULL, NULL, NULL, NULL, 0, 0, '2025-11-25 11:54:15', '2025-11-25 11:54:15'),
(3, 'paynow', 'sandbox', 'YOUR_PAYNOW_SANDBOX_INTEGRATION_ID', 'YOUR_PAYNOW_SANDBOX_INTEGRATION_KEY', 'YOUR_PAYNOW_SANDBOX_ID', NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, '2025-11-25 11:54:15', '2025-11-28 17:07:50'),
(4, 'paynow', 'live', 'YOUR_PAYNOW_LIVE_INTEGRATION_ID', 'YOUR_PAYNOW_LIVE_INTEGRATION_KEY', 'YOUR_PAYNOW_LIVE_ID', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, '2025-11-25 11:54:15', '2025-11-25 11:54:15');

-- --------------------------------------------------------

--
-- Table structure for table `payment_logs`
--

CREATE TABLE `payment_logs` (
  `id` int(11) NOT NULL,
  `transaction_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `action` varchar(100) NOT NULL,
  `level` enum('info','warning','error') DEFAULT 'info',
  `message` text NOT NULL,
  `context` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`context`)),
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `payment_refunds`
--

CREATE TABLE `payment_refunds` (
  `id` int(11) NOT NULL,
  `transaction_id` int(11) NOT NULL,
  `refund_transaction_id` varchar(255) DEFAULT NULL,
  `reference_number` varchar(255) NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `reason` text DEFAULT NULL,
  `status` enum('pending','processing','completed','failed','cancelled') DEFAULT 'pending',
  `gateway_response` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`gateway_response`)),
  `processed_by` int(11) DEFAULT NULL,
  `processed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `payment_transactions`
--

CREATE TABLE `payment_transactions` (
  `id` int(11) NOT NULL,
  `transaction_id` varchar(255) NOT NULL,
  `reference_number` varchar(255) NOT NULL,
  `gateway_name` varchar(50) NOT NULL,
  `gateway_type` enum('sandbox','live') DEFAULT 'sandbox',
  `user_id` int(11) NOT NULL,
  `item_type` enum('course','exam','subscription') NOT NULL,
  `item_id` int(11) NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `currency` varchar(3) DEFAULT 'USD',
  `discount_code` varchar(50) DEFAULT NULL,
  `discount_amount` decimal(10,2) DEFAULT 0.00,
  `tax_amount` decimal(10,2) DEFAULT 0.00,
  `final_amount` decimal(10,2) NOT NULL,
  `status` enum('pending','processing','completed','failed','cancelled','refunded','partially_refunded') DEFAULT 'pending',
  `payment_method` varchar(50) DEFAULT NULL,
  `gateway_response` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`gateway_response`)),
  `gateway_metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`gateway_metadata`)),
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `processed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `payment_transactions`
--

INSERT INTO `payment_transactions` (`id`, `transaction_id`, `reference_number`, `gateway_name`, `gateway_type`, `user_id`, `item_type`, `item_id`, `amount`, `currency`, `discount_code`, `discount_amount`, `tax_amount`, `final_amount`, `status`, `payment_method`, `gateway_response`, `gateway_metadata`, `ip_address`, `user_agent`, `notes`, `processed_at`, `created_at`, `updated_at`) VALUES
(1, 'TXN_1769992072_5224', 'TXN_1769992072_5224', 'card', 'sandbox', 7, '', 0, 22.00, 'USD', NULL, 0.00, 0.00, 22.00, 'completed', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-02-02 00:27:52', '2026-02-02 00:27:52'),
(2, 'TXN_1769997305_9182', 'TXN_1769997305_9182', 'paynow', 'sandbox', 7, '', 0, 11.00, 'USD', NULL, 0.00, 0.00, 11.00, 'completed', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-02-02 01:55:05', '2026-02-02 01:55:05'),
(3, 'TXN_1769997497_2253', 'TXN_1769997497_2253', 'paynow', 'sandbox', 8, '', 0, 22.00, 'USD', NULL, 0.00, 0.00, 22.00, 'completed', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-02-02 01:58:17', '2026-02-02 01:58:17');

-- --------------------------------------------------------

--
-- Table structure for table `posts`
--

CREATE TABLE `posts` (
  `id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `content` longtext NOT NULL,
  `excerpt` text DEFAULT NULL,
  `category_id` int(11) DEFAULT NULL,
  `author_id` int(11) DEFAULT NULL,
  `status` enum('draft','published') DEFAULT 'draft',
  `featured_image` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `manual_author_name` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `posts`
--

INSERT INTO `posts` (`id`, `title`, `slug`, `content`, `excerpt`, `category_id`, `author_id`, `status`, `featured_image`, `created_at`, `updated_at`, `manual_author_name`) VALUES
(1, 'Welcome to Our Blog', 'welcome-to-our-blog', '<p>Welcome to our platform! This is where we\'ll share news, articles, and journals.</p><p>Stay tuned for more exciting content.</p><p><br></p>', 'Welcome to our platform! This is where we\'ll share news, articles, and journals.Stay tuned for more exciting content.', 1, 1, 'draft', NULL, '2025-09-10 03:45:35', '2025-11-07 04:41:58', NULL),
(2, 'Getting Started with PHP', 'getting-started-with-php', '<p>PHP is a powerful server-side scripting language that\'s perfect for web development.</p><p>In this article, we\'ll explore the basics of PHP programming.</p>', 'PHP is a powerful server-side scripting language that\'s perfect for web development.In this article, we\'ll explore the basics of PHP programming.', 2, 1, 'draft', NULL, '2025-09-10 03:45:35', '2025-11-07 04:42:10', NULL),
(3, 'Explain 5 different metaphors that can be used to describe an organisation', 'explain-5-different-metaphors-that-can-be-used-to-describe-an-organisation', '<p class=\"MsoListParagraphCxSpFirst\"><strong><span lang=\"EN-GB\" style=\"font-family:\r\n&quot;Calibri&quot;,sans-serif;mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:\r\nminor-latin;mso-bidi-theme-font:minor-latin;font-weight:normal\">A ‘metaphor’\r\ncan be described as a figure of speech in which an object or action can be used\r\nto describe a concept – the word or phrase used will be figurative and not\r\nliteral.</span></strong></p><p class=\"MsoListParagraphCxSpMiddle\"><strong><span lang=\"EN-GB\" style=\"font-family:\r\n&quot;Calibri&quot;,sans-serif;mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:\r\nminor-latin;mso-bidi-theme-font:minor-latin;font-weight:normal\">Metaphors are\r\ncommonly used to describe an organisation include: -</span></strong></p><p class=\"MsoListParagraphCxSpMiddle\"><strong><span lang=\"EN-GB\" style=\"font-family:\r\n&quot;Calibri&quot;,sans-serif;mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:\r\nminor-latin;mso-bidi-theme-font:minor-latin;font-weight:normal\">1) </span></strong><strong><span lang=\"EN-GB\" style=\"font-family:&quot;Calibri&quot;,sans-serif;mso-ascii-theme-font:minor-latin;\r\nmso-hansi-theme-font:minor-latin;mso-bidi-theme-font:minor-latin\">Machine</span></strong><strong><span lang=\"EN-GB\" style=\"font-family:&quot;Calibri&quot;,sans-serif;mso-ascii-theme-font:minor-latin;\r\nmso-hansi-theme-font:minor-latin;mso-bidi-theme-font:minor-latin;font-weight:\r\nnormal\"> = In other words, a system to be managed (most common metaphor)</span></strong></p><p class=\"MsoListParagraphCxSpMiddle\"><strong><span lang=\"EN-GB\" style=\"font-family:\r\n&quot;Calibri&quot;,sans-serif;mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:\r\nminor-latin;mso-bidi-theme-font:minor-latin;font-weight:normal\">2) </span></strong><strong><span lang=\"EN-GB\" style=\"font-family:&quot;Calibri&quot;,sans-serif;mso-ascii-theme-font:minor-latin;\r\nmso-hansi-theme-font:minor-latin;mso-bidi-theme-font:minor-latin\">Organism</span></strong><strong><span lang=\"EN-GB\" style=\"font-family:&quot;Calibri&quot;,sans-serif;mso-ascii-theme-font:minor-latin;\r\nmso-hansi-theme-font:minor-latin;mso-bidi-theme-font:minor-latin;font-weight:\r\nnormal\"> = which likens an organisation to an organic, living, or biological\r\n‘being’</span></strong></p><p class=\"MsoListParagraphCxSpMiddle\"><strong><span lang=\"EN-GB\" style=\"font-family:\r\n&quot;Calibri&quot;,sans-serif;mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:\r\nminor-latin;mso-bidi-theme-font:minor-latin;font-weight:normal\">3) </span></strong><strong><span lang=\"EN-GB\" style=\"font-family:&quot;Calibri&quot;,sans-serif;mso-ascii-theme-font:minor-latin;\r\nmso-hansi-theme-font:minor-latin;mso-bidi-theme-font:minor-latin\">Brain</span></strong><strong><span lang=\"EN-GB\" style=\"font-family:&quot;Calibri&quot;,sans-serif;mso-ascii-theme-font:minor-latin;\r\nmso-hansi-theme-font:minor-latin;mso-bidi-theme-font:minor-latin;font-weight:\r\nnormal\"> = describes and organisation as ‘intelligent and able to learn’</span></strong></p><p class=\"MsoListParagraphCxSpMiddle\"><strong><span lang=\"EN-GB\" style=\"font-family:\r\n&quot;Calibri&quot;,sans-serif;mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:\r\nminor-latin;mso-bidi-theme-font:minor-latin;font-weight:normal\">4) </span></strong><strong><span lang=\"EN-GB\" style=\"font-family:&quot;Calibri&quot;,sans-serif;mso-ascii-theme-font:minor-latin;\r\nmso-hansi-theme-font:minor-latin;mso-bidi-theme-font:minor-latin\">Culture</span></strong><strong><span lang=\"EN-GB\" style=\"font-family:&quot;Calibri&quot;,sans-serif;mso-ascii-theme-font:minor-latin;\r\nmso-hansi-theme-font:minor-latin;mso-bidi-theme-font:minor-latin;font-weight:\r\nnormal\"> = Which sees an organisation as an entity with an identity shaped by\r\nritual and symbolism</span></strong></p><p class=\"MsoListParagraphCxSpMiddle\"><strong><span lang=\"EN-GB\" style=\"font-family:\r\n&quot;Calibri&quot;,sans-serif;mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:\r\nminor-latin;mso-bidi-theme-font:minor-latin;font-weight:normal\">5) </span></strong><strong><span lang=\"EN-GB\" style=\"font-family:&quot;Calibri&quot;,sans-serif;mso-ascii-theme-font:minor-latin;\r\nmso-hansi-theme-font:minor-latin;mso-bidi-theme-font:minor-latin\">Political\r\nSystem</span></strong><strong><span lang=\"EN-GB\" style=\"font-family:&quot;Calibri&quot;,sans-serif;\r\nmso-ascii-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-theme-font:\r\nminor-latin;font-weight:normal\"> = equates organisation as places filled with\r\ndiversity of conflicts and power (stakeholder theories)</span></strong></p><p class=\"MsoListParagraphCxSpMiddle\"><strong><span lang=\"EN-GB\" style=\"font-family:\r\n&quot;Calibri&quot;,sans-serif;mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:\r\nminor-latin;mso-bidi-theme-font:minor-latin;font-weight:normal\">6) </span></strong><strong><span lang=\"EN-GB\" style=\"font-family:&quot;Calibri&quot;,sans-serif;mso-ascii-theme-font:minor-latin;\r\nmso-hansi-theme-font:minor-latin;mso-bidi-theme-font:minor-latin\">Psychic\r\nPrison</span></strong><strong><span lang=\"EN-GB\" style=\"font-family:&quot;Calibri&quot;,sans-serif;\r\nmso-ascii-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-theme-font:\r\nminor-latin;font-weight:normal\"> = sees individuals within an organisation as\r\nrepressed, controlled or trapped.</span></strong></p><p>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n</p><p class=\"MsoListParagraphCxSpLast\"><strong><span lang=\"EN-GB\" style=\"font-family:\r\n&quot;Calibri&quot;,sans-serif;mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:\r\nminor-latin;mso-bidi-theme-font:minor-latin;font-weight:normal\">7) </span></strong><strong><span lang=\"EN-GB\" style=\"font-family:&quot;Calibri&quot;,sans-serif;mso-ascii-theme-font:minor-latin;\r\nmso-hansi-theme-font:minor-latin;mso-bidi-theme-font:minor-latin\">Instrument of\r\nDomination</span></strong><strong><span lang=\"EN-GB\" style=\"font-family:&quot;Calibri&quot;,sans-serif;\r\nmso-ascii-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-theme-font:\r\nminor-latin;font-weight:normal\"> which are exploitative and powerful<o:p></o:p></span></strong></p>', 'A ‘metaphor’\r\ncan be described as a figure of speech in which an object or action can be used\r\nto describe a concept – the word or phrase used...', 4, 1, 'draft', NULL, '2025-09-10 04:51:33', '2025-11-07 04:41:43', NULL),
(5, 'Discuss the factors that influence psychological contract and how an employer can protect it', 'discuss-the-factors-that-influence-psychological-contract-and-how-an-employer-can-protect-it', '<p class=\"MsoNormal\" style=\"margin-left:36.0pt\"><span lang=\"EN-GB\">The term\r\n\'psychological contract\' refers to individuals\' expectations, beliefs, ambitions\r\nand obligations, as perceived by the employer and the worker.<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"margin-left:36.0pt\"><span lang=\"EN-GB\">The\r\npsychological contract concerns the intangible aspects of a person’s role\r\nwithin and organisation, it stands outside of the written terms and conditions\r\nof employment, in that it relates more to the unwritten agreement between an\r\nemployee and their employer that describes the informal commitments,\r\nexpectations and understandings that make up their relationship.<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"margin-left:36.0pt\"><span lang=\"EN-GB\">In essence\r\nit outlines commonly understood ‘expectations’ that aren’t in the legal\r\nemployment contract such as: -<o:p></o:p></span></p><p class=\"MsoListParagraphCxSpFirst\" style=\"margin-left:54.0pt;mso-add-space:\r\nauto;text-indent:-18.0pt;mso-list:l1 level1 lfo1\"><!--[if !supportLists]--><span lang=\"EN-GB\">a.<span style=\"font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-size-adjust: none; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-variant-emoji: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n</span></span><!--[endif]--><b><span lang=\"EN-GB\">For the employee:</span></b><span lang=\"EN-GB\">\r\nit would deal with the employee’s feelings and expectations in relation to job\r\nsecurity, career progression, development opportunities, fair pay and benefits\r\nand expected support. <o:p></o:p></span></p><p class=\"MsoListParagraphCxSpLast\" style=\"margin-left:54.0pt;mso-add-space:auto;\r\ntext-indent:-18.0pt;mso-list:l1 level1 lfo1\"><!--[if !supportLists]--><span lang=\"EN-GB\">b.<span style=\"font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-size-adjust: none; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-variant-emoji: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n</span></span><!--[endif]--><b><span lang=\"EN-GB\">For the manager:</span></b><span lang=\"EN-GB\">\r\nThey would have expectations and attitudes around expected timeliness, dress\r\ncode, respect, and attitude.<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"margin-left:36.0pt\"><span lang=\"EN-GB\">The\r\npsychological contract is something which develops over time, through customs\r\nand practice and is built on the actions of both parties (manager and employee)\r\nand over time it sets out how people behave (e.g., whether turning up late is\r\nacceptable or not).&nbsp; Individuals can\r\ninadvertently fall foul to such practices by not fitting in, and sometimes\r\nthese cultures can be regarded as toxic.<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"margin-left:36.0pt\"><span lang=\"EN-GB\">Often\r\nimprecise and rarely spoken, it can often be simply inferred, and expectations\r\ncan be hard to pin down and even harder to enforce if expectations are not made\r\nclear.<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"margin-left:36.0pt\"><span lang=\"EN-GB\">Factors\r\nwhich can influence the phycological contract include; a person’s experience in\r\nprevious employment, the recruitment process, 121s (or lack thereof), other\r\nmanagers / teams within organisation, or public statements made by the company.<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"margin-left:36.0pt\"><span lang=\"EN-GB\">It is\r\nimportant to cultivate a healthy psychological contract via: -<o:p></o:p></span></p><p class=\"MsoListParagraphCxSpFirst\" style=\"margin-left:54.0pt;mso-add-space:\r\nauto;text-indent:-18.0pt;mso-list:l0 level1 lfo2\"><!--[if !supportLists]--><span lang=\"EN-GB\">-<span style=\"font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-size-adjust: none; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-variant-emoji: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n</span></span><!--[endif]--><b><span lang=\"EN-GB\">Employer brand</span></b><span lang=\"EN-GB\">\r\n– being open about attitudes to e.g. The environment and society, flexible\r\nworking, diversity etc, can help to cultivate pride and loyalty among a\r\nworkforce.<o:p></o:p></span></p><p class=\"MsoListParagraphCxSpMiddle\" style=\"margin-left:54.0pt;mso-add-space:\r\nauto;text-indent:-18.0pt;mso-list:l0 level1 lfo2\"><!--[if !supportLists]--><span lang=\"EN-GB\">-<span style=\"font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-size-adjust: none; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-variant-emoji: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n</span></span><!--[endif]--><b><span lang=\"EN-GB\">Communication</span></b><span lang=\"EN-GB\">\r\n– clear open and honest communication promotes confidence among employees to\r\nshare their feelings, concerns and wants.<o:p></o:p></span></p><p class=\"MsoListParagraphCxSpMiddle\" style=\"margin-left:54.0pt;mso-add-space:\r\nauto;text-indent:-18.0pt;mso-list:l0 level1 lfo2\"><!--[if !supportLists]--><span lang=\"EN-GB\">-<span style=\"font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-size-adjust: none; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-variant-emoji: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n</span></span><!--[endif]--><b><span lang=\"EN-GB\">Learning and career development</span></b><span lang=\"EN-GB\">\r\n– instils loyalty as individuals who can see a clear pathway to career\r\ndevelopment are more likely to stay and thrive. <o:p></o:p></span></p><p class=\"MsoListParagraphCxSpMiddle\" style=\"margin-left:54.0pt;mso-add-space:\r\nauto;text-indent:-18.0pt;mso-list:l0 level1 lfo2\"><!--[if !supportLists]--><span lang=\"EN-GB\">-<span style=\"font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-size-adjust: none; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-variant-emoji: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n</span></span><!--[endif]--><b><span lang=\"EN-GB\">Management style</span></b><span lang=\"EN-GB\">\r\n– an organisation should aim to cultivate a ‘leadership’ style of management,\r\nwhere managers lead and help their subordinates to grow, learn and develop\r\nconfidence.<o:p></o:p></span></p><p class=\"MsoListParagraphCxSpMiddle\" style=\"margin-left:54.0pt;mso-add-space:\r\nauto;text-indent:-18.0pt;mso-list:l0 level1 lfo2\"><!--[if !supportLists]--><span lang=\"EN-GB\">-<span style=\"font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-size-adjust: none; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-variant-emoji: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n</span></span><!--[endif]--><b><span lang=\"EN-GB\">Managing expectations</span></b><span lang=\"EN-GB\">\r\n– it’s important to be honest, measured and honest about what is expected, and\r\nnot impose unrealistic goals on over stretched employees.&nbsp; Employees will comply, and simply plan their\r\nexit.<o:p></o:p></span></p><p class=\"MsoListParagraphCxSpMiddle\" style=\"margin-left:54.0pt;mso-add-space:\r\nauto;text-indent:-18.0pt;mso-list:l0 level1 lfo2\"><!--[if !supportLists]--><span lang=\"EN-GB\">-<span style=\"font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-size-adjust: none; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-variant-emoji: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n</span></span><!--[endif]--><b><span lang=\"EN-GB\">Measuring employee attitude</span></b><span lang=\"EN-GB\">\r\n– Regular anonymous surveys are a useful tool to regularly gauge workers\r\nattitude to the organization, and how they feel about the culture and the way\r\nthe business is run. Using this information in an active or rather that passive\r\nway is a good way to generate a healthy culture.<o:p></o:p></span></p><p>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n</p><p class=\"MsoListParagraphCxSpLast\" style=\"margin-left:54.0pt;mso-add-space:auto;\r\ntext-indent:-18.0pt;mso-list:l0 level1 lfo2\"><!--[if !supportLists]--><span lang=\"EN-GB\">-<span style=\"font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-size-adjust: none; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-variant-emoji: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n</span></span><!--[endif]--><span lang=\"EN-GB\">The recruitment process - is often the\r\nfirst interaction between a manager and a new employee and can form the\r\nfoundation of the phycological contract. It is useful at interview for a\r\nmanager to honestly represent what is expected, and e.g., If a representation\r\nthat people employed within this role progress to the next more senior level\r\nwithin 2 years, is not followed through this would likely erode trust in the\r\norganisation, and lead to higher attrition rates.<o:p></o:p></span></p>', 'The term\r\n\'psychological contract\' refers to individuals\' expectations, beliefs, ambitions\r\nand obligations, as perceived by the employer and the...', 4, 1, 'draft', NULL, '2025-09-10 05:04:34', '2025-11-07 04:41:30', NULL),
(6, 'Control the quality of your stock', 'control-the-quality-of-your-stock', '<p style=\"margin-bottom: 15px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-variant-position: inherit; font-variant-emoji: inherit; font-stretch: inherit; font-size: 13px; line-height: inherit; font-family: Arial, Helvetica, sans-serif; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; color: rgb(119, 111, 101);\">quality of the finished product.</p><p style=\"margin-bottom: 15px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-variant-position: inherit; font-variant-emoji: inherit; font-stretch: inherit; font-size: 13px; line-height: inherit; font-family: Arial, Helvetica, sans-serif; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; color: rgb(119, 111, 101);\">Efficient stock control should incorporate&nbsp;<strong style=\"border: 0px; font-style: inherit; font-variant: inherit; font-weight: bold; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit;\">stock tracking&nbsp;</strong>and&nbsp;<strong style=\"border: 0px; font-style: inherit; font-variant: inherit; font-weight: bold; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit;\">batch tracking</strong>. This means being able to trace a particular item backwards or forwards from source to finished product, and identifying the other items in the batch.</p><p style=\"margin-bottom: 15px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-variant-position: inherit; font-variant-emoji: inherit; font-stretch: inherit; font-size: 13px; line-height: inherit; font-family: Arial, Helvetica, sans-serif; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; color: rgb(119, 111, 101);\">Goods should be checked systematically for quality, faults identified and the affected batch weeded out. This will allow you to raise any problems with your supplier and at the same time demonstrate the safety and quality of your product.</p><p style=\"margin-bottom: 15px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-variant-position: inherit; font-variant-emoji: inherit; font-stretch: inherit; font-size: 13px; line-height: inherit; font-family: Arial, Helvetica, sans-serif; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; color: rgb(119, 111, 101);\">With a good computerised stock control system, this kind of tracking is relatively straightforward. Manual stock control methods can also use&nbsp;<strong style=\"border: 0px; font-style: inherit; font-variant: inherit; font-weight: bold; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit;\">codes</strong>&nbsp;to systematise tracking and make it easier to trace particular batches.</p><p style=\"margin-bottom: 15px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-variant-position: inherit; font-variant-emoji: inherit; font-stretch: inherit; font-size: 13px; line-height: inherit; font-family: Arial, Helvetica, sans-serif; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; color: rgb(119, 111, 101);\">Radio Frequency Identification (RFID) can be used to store information about a product or component\'s manufacturing date, to ensure that it is sold or processed in time. The system can also be used to trace faulty products quickly and efficiently. See the page in this guide on using RFID for inventory control, stock security and quality management.</p>', 'quality of the finished product.Efficient stock control should incorporate&nbsp;stock tracking&nbsp;and&nbsp;batch tracking. This means being able to...', 2, 1, 'draft', NULL, '2025-09-10 12:44:23', '2025-11-07 04:41:14', NULL),
(7, 'Stock security Control', 'stock-security-control', '<h3 style=\"margin-bottom: 15px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-variant-position: inherit; font-variant-emoji: inherit; font-stretch: inherit; font-size: 13px; line-height: inherit; font-family: Arial, Helvetica, sans-serif; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; color: rgb(119, 111, 101);\" class=\"\"><span style=\"font-weight: normal;\">Goods hhg</span></h3><h3 style=\"margin-bottom: 15px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-variant-position: inherit; font-variant-emoji: inherit; font-stretch: inherit; font-size: 13px; line-height: inherit; font-family: Arial, Helvetica, sans-serif; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; color: rgb(119, 111, 101);\" class=\"\"><span style=\"font-weight: normal;\">hghg<br></span><h3 class=\"\"><span style=\"font-weight: normal;\">Keeping stock secure depends on knowing what you have, where it is located and how much it is worth - so good records are essential. Stock that is portable, does not feature the business\' logo, or is easy to sell on, is at particular risk.<br>Thieves and shoplifters<br>A thief coming in from outside is an obvious threat. Check the security around your premises to keep the risk to a minimum. In a store, thieves may steal in groups - some providing a distraction while others take goods. Teach your staff to be alert and to recognise behaviour like this. Set up a clear policy and make sure staff are trained in dealing with thieves.<br>Offering to help a customer if you are suspicious will often prevent a theft. Avoid using confrontational words like \"steal\" if you do have to approach a suspected thief, and avoid getting into a dangerous situation.<br>Protect your stock</span><ul style=\"margin-bottom: 15px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; list-style: none;\"><li style=\"padding-left: 15px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; list-style: none; background: url(&quot;/cassette.axd/file/feuil/themes/web/images/entre/bullet-list-510d6d670894aa6323f5cedfb9bf2cbc01389418.png&quot;) 0px 1px no-repeat;\"><span style=\"font-weight: normal;\">Identify and mark expensive portable equipment (such as computers). If possible, fit valuable stock with security tags - such as Radio Frequency Identification tags - which will sound an alarm if they are moved.</span></li></ul><ul style=\"margin-bottom: 15px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; list-style: none;\"><li style=\"padding-left: 15px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; list-style: none; background: url(&quot;/cassette.axd/file/feuil/themes/web/images/entre/bullet-list-510d6d670894aa6323f5cedfb9bf2cbc01389418.png&quot;) 0px 1px no-repeat;\"><span style=\"font-weight: normal;\">Don\'t leave equipment hanging around after delivery. Put it away in a secure place, record it and clear up packaging. It is a good idea to dispose of packaging securely -leaving boxes in view could be an advertisement to thieves.</span></li></ul><ul style=\"margin-bottom: 15px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; list-style: none;\"><li style=\"padding-left: 15px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; list-style: none; background: url(&quot;/cassette.axd/file/feuil/themes/web/images/entre/bullet-list-510d6d670894aa6323f5cedfb9bf2cbc01389418.png&quot;) 0px 1px no-repeat;\"><span style=\"font-weight: normal;\">Take regular inventories.</span></li></ul><ul style=\"margin-bottom: 15px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; list-style: none;\"><li style=\"padding-left: 15px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; list-style: none; background: url(&quot;/cassette.axd/file/feuil/themes/web/images/entre/bullet-list-510d6d670894aa6323f5cedfb9bf2cbc01389418.png&quot;) 0px 1px no-repeat;\"><span style=\"font-weight: normal;\">Put CCTV in parking lots and other key locations.</span></li></ul><span style=\"font-weight: normal;\">Theft by staff<br>Theft by employees can sometimes be a problem. To prevent this:</span><ul style=\"margin-bottom: 15px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; list-style: none;\"><li style=\"padding-left: 15px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; list-style: none; background: url(&quot;/cassette.axd/file/feuil/themes/web/images/entre/bullet-list-510d6d670894aa6323f5cedfb9bf2cbc01389418.png&quot;) 0px 1px no-repeat;\"><span style=\"font-weight: normal;\">Train staff about your security systems and your disciplinary policies and procedures. Training about the cost of stock theft will help, as many people aren\'t aware of the implications for company turnover and job security.</span></li></ul><ul style=\"margin-bottom: 15px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; list-style: none;\"><li style=\"padding-left: 15px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; list-style: none; background: url(&quot;/cassette.axd/file/feuil/themes/web/images/entre/bullet-list-510d6d670894aa6323f5cedfb9bf2cbc01389418.png&quot;) 0px 1px no-repeat;\"><span style=\"font-weight: normal;\">Set up procedures to prevent theft. Staff with financial responsibilities should not be in charge of stock records.</span></li></ul><ul style=\"margin-bottom: 15px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; list-style: none;\"><li style=\"padding-left: 15px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; list-style: none; background: url(&quot;/cassette.axd/file/feuil/themes/web/images/entre/bullet-list-510d6d670894aa6323f5cedfb9bf2cbc01389418.png&quot;) 0px 1px no-repeat;\"><span style=\"font-weight: normal;\">Restrict access to warehouses, stockrooms and stationery cupboards.</span></li></ul><ul style=\"margin-bottom: 15px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; list-style: none;\"><li style=\"font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; padding-left: 15px; border: 0px; list-style: none; background: url(&quot;/cassette.axd/file/feuil/themes/web/images/entre/bullet-list-510d6d670894aa6323f5cedfb9bf2cbc01389418.png&quot;) 0px 1px no-repeat;\"><span style=\"font-weight: normal;\">Regularly change staff controlling stock to avoid collusion or bad practice.</span></li></ul></h3></h3>', 'Goods hhghghgKeeping stock secure depends on knowing what you have, where it is located and how much it is worth - so good records are essential....', 2, 1, 'draft', NULL, '2025-09-10 13:12:01', '2025-11-07 04:40:59', 'Clite Mutale (BBA, MBA, MCIPS)'),
(8, 'Central stores training for FY 2025 Develiopment agenda', 'central-stores-training-for-fy-2025-develiopment-agenda', '<p><p><br></p><img src=\"assets/images/68c283a1c3fe8.png\" alt=\"PAB Logo.png\" style=\"max-width: 100%; width: 100%;\"></p><p>Well to central stores training at Padenga&nbsp;</p>', 'Well to central stores training at Padenga&nbsp;', 1, 1, 'draft', NULL, '2025-09-11 08:09:05', '2025-11-07 04:40:44', 'Clite Mutale (BBA, MBA, MCIPS)'),
(9, 'invoice', 'invoice', '<img src=\"assets/images/68c285522f673.JPG\" alt=\"Invoice Tony waite.JPG\" style=\"max-width: 100%; width: 50%;\"><p>good news for alll</p>', 'good news for alll', 1, 1, 'draft', NULL, '2025-09-11 08:16:18', '2025-11-07 04:40:33', 'clite'),
(10, 'Analyse how individual behavioural characteristics influence a manager’s leadership style in procurement and supply functions.', 'analyse-how-individual-behavioural-characteristics-influence-a-manager-s-leadership-style-in-procurement-and-supply-functions', '<h5 style=\"margin-left:36.0pt;text-align:justify\" class=\"\"><p class=\"MsoNormal\" style=\"line-height: 150%;\"><span style=\"font-size: 12pt; line-height: 150%; font-family: Poppins; font-weight: normal;\">Behavioural\r\ncharacteristics refer to enduring psychological traits that shape how\r\nindividuals think, feel, and act in organisational settings. In procurement and\r\nsupply—functions increasingly reliant on stakeholder collaboration, ethical\r\ndecision-making, and cross-cultural negotiation—these traits directly influence\r\nmanagerial effectiveness. This answer will analyse how personality (e.g., Big\r\nFive traits), emotional intelligence, and cognitive styles shape leadership\r\napproaches, drawing on trait theory, behavioural models, and CIPS-aligned\r\npractices.<o:p></o:p></span></p>\r\n\r\n<p class=\"MsoNormal\" style=\"line-height: 150%;\"><span style=\"font-size: 12pt; line-height: 150%; font-family: Poppins; font-weight: normal;\"><br>\r\n<u>Personality traits fundamentally predispose managers to specific leadership\r\nbehaviours</u>. Trait theory, notably advanced by Stogdill (1974) and McCall\r\n&amp; Lombardo (1983), identifies core traits such as emotional stability,\r\nintellectual breadth, interpersonal skill, and willingness to admit error as\r\nhallmarks of effective leadership. These align with dimensions in the Big Five\r\nmodel (e.g., high conscientiousness correlates with structured planning; high\r\nagreeableness supports collaborative supplier relations). For example a\r\nprocurement manager scoring high in openness to experience may champion innovation\r\nin sustainable sourcing, whereas one high in neuroticism might delay decisions\r\nduring supply chain disruptions due to anxiety. The Ohio State Leadership\r\nTheory further validates this: “initiating structure” (task focus) often stems\r\nfrom conscientiousness, while “consideration” (people focus) reflects\r\nagreeableness.<br>\r\nThus, inherent behavioural traits serve as a baseline for leadership style,\r\ndirectly affecting team morale and operational outcomes.<o:p></o:p></span></p>\r\n\r\n<p class=\"MsoNormal\" style=\"line-height: 150%;\"><span style=\"font-size: 12pt; line-height: 150%; font-family: Poppins; font-weight: normal;\"><br>\r\n<u>Emotional intelligence (EI) enables adaptive, context-sensitive leadership</u>.<br>\r\nGoleman (1995) posits that EI—comprising self-awareness, self-regulation,\r\nempathy, and social skills—accounts for up to 75% of performance variance\r\nbeyond IQ. In procurement, where influencing without authority is critical, EI\r\nallows managers to read emotional cues, manage conflict, and build trust across\r\ndiverse stakeholders. For example during a tense contract renegotiation with an\r\noverseas supplier, a high-EI manager might detect unspoken concerns about cash\r\nflow and propose flexible payment terms, preserving the relationship. CIPS\r\nguidance emphasises EI in ethical sourcing and stakeholder engagement,\r\nparticularly in global contexts. EI transforms static personality into dynamic\r\nresponsiveness, allowing managers to tailor their approach to cultural and\r\nsituational demands.<o:p></o:p></span></p>\r\n\r\n<p class=\"MsoNormal\" style=\"line-height: 150%;\"><span style=\"font-size: 12pt; line-height: 150%; font-family: Poppins; font-weight: normal;\"><br>\r\n<u>Cognitive and experiential backgrounds shape strategic orientation and\r\ncommunication preferences</u>.<br>\r\nA manager’s education, generational cohort, and professional history influence\r\nrisk tolerance, digital fluency, and values. For instance, a Gen Z procurement\r\nofficer may prioritise ESG metrics and digital tools, while a veteran may rely\r\non long-term relational contracts. Lewin’s (1951) interactionist perspective\r\nconfirms that behaviour results from both innate traits and environmental\r\nconditioning.<br>\r\nFor example in multinational firms, managers with international exposure often\r\nadopt inclusive, culturally intelligent practices—such as adjusting negotiation\r\nstyles for high-context vs. low-context cultures—enhancing supplier diversity\r\nand innovation. Recognising these differences allows procurement leaders to\r\nbridge generational and cognitive gaps, fostering cohesive teams.<o:p></o:p></span></p>\r\n\r\n<p class=\"MsoNormal\" style=\"line-height: 150%;\"><span style=\"font-size:12.0pt;line-height:150%;font-family:Poppins\"><span style=\"font-weight: normal;\"><br>\r\nIndividual behavioural characteristics—whether biologically rooted or shaped by\r\nexperience—profoundly shape leadership in procurement. While traits like\r\nconscientiousness or emotional stability set a foundation, self-awareness and\r\nEI enable adaptation. Therefore, effective procurement managers must engage in\r\ncontinuous reflection and development to align their natural tendencies with\r\norganisational needs and team dynamics.</span><b><o:p></o:p></b></span></p></h5>', 'Behavioural\r\ncharacteristics refer to enduring psychological traits that shape how\r\nindividuals think, feel, and act in organisational settings. In pr...', 4, 1, 'published', NULL, '2025-09-11 13:18:27', '2026-01-24 09:29:39', 'Clite Mutale (BBA, MBA, MCIPS)'),
(11, 'Welcome', 'welcome', '<p>You are welcome to mutalex</p>', 'You are welcome to mutalex', 1, 1, 'draft', NULL, '2025-09-11 14:23:23', '2025-11-07 04:40:08', 'Clite Mutale (BBA, MBA, MCIPS)'),
(12, 'communicationn', 'communicationn', '<img src=\"assets/images/690b7a0d0cefa.png\" alt=\"Gemini_Generated_Image_e597yne597yne597.png\" style=\"max-width:100%;\"><p><br></p><p>good communication&nbsp;</p>', 'good communication&nbsp;', 6, 1, 'draft', NULL, '2025-11-05 16:23:41', '2025-11-07 04:39:53', 'Clite Mutale (BBA, MBA, MCIPS)'),
(13, 'quality control', 'quality-control', '<img src=\"assets/images/690b7a53874b7.png\" alt=\"Gemini_Generated_Image_3psg7p3psg7p3psg.png\" style=\"max-width:100%;\"><p><br></p><p><br></p><p>keep quality food in the warehouse</p>', 'keep quality food in the warehouse', 6, 1, 'draft', NULL, '2025-11-05 16:24:51', '2025-11-07 04:39:43', 'Clite Mutale (BBA, MBA, MCIPS)'),
(14, 'sustainability', 'sustainability', '<p style=\"margin-left: 25px;\">Good sustainability practice, will be good for the business.&nbsp;</p><ol><li><li><li><li><li><li><li><li><li><ol><li><ol><li style=\"margin-left: 25px;\"><ol><li style=\"text-align: left; margin-left: 25px;\">hhghhghghghkkg&nbsp;</li><li style=\"text-align: left; margin-left: 25px;\">ghhhhh</li><li style=\"text-align: left; margin-left: 25px;\">hh</li><li style=\"text-align: left; margin-left: 25px;\">jgjgjgjgjg</li><li style=\"text-align: left; margin-left: 25px;\">hhhmmh</li><li style=\"text-align: left; margin-left: 25px;\">hhh</li><li style=\"text-align: left; margin-left: 25px;\">hghghg</li></ol></li></ol></li></ol></li></li></li></li></li></li></li></li></li></ol>', 'Good sustainability practice, will be good for the business.&nbsp;hhghhghghghkkg&nbsp;ghhhhhhhjgjgjgjgjghhhmmhhhhhghghg', 6, 1, 'draft', NULL, '2025-11-06 14:10:44', '2025-11-07 04:39:33', 'Clite Mutale (BBA, MBA, MCIPS)'),
(15, '1.	(a) Outline TWO differences between procurement and purchasing and supply. (b) Describe FIVE advantages of implementing a supply chain management approach.', '1-a-outline-two-differences-between-procurement-and-purchasing-and-supply-b-describe-five-advantages-of-implementing-a-supply-chain-management-approach-', '<p style=\"border-width: 0px; border-style: solid; margin-bottom: 6px; color: rgb(39, 39, 42); line-height: 1.625; font-family: &quot;Source Sans Pro&quot;, ui-sans-serif, system-ui, sans-serif; font-size: 16px; background-color: rgb(250, 250, 250);\">Procurement, purchasing, and supply are related but distinct functions in an organization\'s operations. Here are two key differences between them:</p><ol style=\"border-width: 0px; border-style: solid; margin-bottom: 6px; color: rgb(39, 39, 42); list-style-position: inside; list-style-image: initial; font-family: &quot;Source Sans Pro&quot;, ui-sans-serif, system-ui, sans-serif; font-size: 16px; background-color: rgb(250, 250, 250);\"><li style=\"border-width: 0px; border-style: solid; margin-bottom: 0.5em;\">Scope:<br style=\"border-width: 0px; border-style: solid;\">* Procurement: This function involves the overall acquisition of goods, services, or works from external sources, including evaluating suppliers, negotiating contracts, and managing relationships. It has a broader scope than purchasing and supply, as it encompasses not only the sourcing process but also the management of supplier relationships and risk mitigation strategies.<br style=\"border-width: 0px; border-style: solid;\">* Purchasing: This function is focused specifically on the acquisition of goods and services within an organization. Purchasing professionals work closely with internal stakeholders to identify their needs and source products that meet those requirements. While they may be involved in the evaluation and selection of suppliers, their primary focus is on procuring specific items at the best possible price.</li><li style=\"border-width: 0px; border-style: solid;\">Level of Strategic Focus:<br style=\"border-width: 0px; border-style: solid;\">* Procurement: As mentioned earlier, procurement involves more than just buying goods and services; it includes developing and implementing long-term strategies for acquiring essential resources. Procurement professionals often work closely with top executives to develop sourcing plans that align with the company\'s overall goals and objectives. They must consider factors such as cost savings, quality improvements, sustainability initiatives, and risk management when making decisions.<br style=\"border-width: 0px; border-style: solid;\">* Purchasing: In contrast, purchasing tends to have a more tactical focus. Purchasing agents typically follow established procedures and protocols to obtain necessary supplies without necessarily considering the bigger picture. Their primary objective is to complete transactions efficiently while ensuring compliance with organizational policies and regulations. While some purchasing professionals may contribute to strategic planning, their role primarily revolves around executing day-to-day purchasing activities.</li></ol><p style=\"border-width: 0px; border-style: solid; margin-top: 16px; color: rgb(39, 39, 42); line-height: 1.625; font-family: &quot;Source Sans Pro&quot;, ui-sans-serif, system-ui, sans-serif; font-size: 16px; background-color: rgb(250, 250, 250);\">In summary, while all three terms relate to the acquisition of goods and services, \"procurement\" emphasizes strategic decision-making and supplier relationship management, whereas \"purchasing\" concentrates on transactional tasks and operational efficiency.</p>', 'Procurement, purchasing, and supply are related but distinct functions in an organization\'s operations. Here are two key differences between...', 8, 1, 'published', NULL, '2025-11-07 04:45:17', '2025-11-07 04:45:17', 'Clite Mutale (BBA, MBA, MCIPS)');
INSERT INTO `posts` (`id`, `title`, `slug`, `content`, `excerpt`, `category_id`, `author_id`, `status`, `featured_image`, `created_at`, `updated_at`, `manual_author_name`) VALUES
(16, 'How may inventory drive a company’s financial performance', 'how-may-inventory-drive-a-company-s-financial-performance', '<p class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">Inventory can significantly impact a company\'s financial\r\nperformance in various ways. Here are some key drivers:<o:p></o:p></span></p><ol style=\"margin-top:0cm\" start=\"1\" type=\"1\">\r\n <li class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Cost\r\n     of Goods Sold (COGS): Inventory represents a significant portion of COGS,\r\n     which is one of the most important metrics for measuring a company\'s\r\n     profitability. The higher the inventory levels, the more COGS will be, and\r\n     therefore, the lower the gross margin will be.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Working\r\n     Capital Requirements: Inventories require working capital to finance their\r\n     purchase, storage, and eventual sale. Higher inventory levels consume more\r\n     working capital, which can limit a company\'s ability to invest in other\r\n     areas or respond to changes in market conditions.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Cash\r\n     Flow: Inventory can generate both cash inflows (through sales) and cash\r\n     outflows (through purchases and holding costs). Managing inventory\r\n     effectively can help a company maintain a healthy cash flow position.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Risk\r\n     Management: Inventory can pose risks such as spoilage, damage, and\r\n     obsolescence. Effective inventory management helps mitigate these risks,\r\n     reducing the likelihood of write-offs and increasing the chances of\r\n     realizing full economic value from inventory assets.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Customer\r\n     Satisfaction: Proper inventory management ensures timely delivery of\r\n     products to meet customer demands, leading to increased customer\r\n     satisfaction and loyalty. This, in turn, can contribute to higher sales\r\n     and profits.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Competitive\r\n     Advantage: Companies that excel at managing inventory can gain a\r\n     competitive advantage by being able to offer faster delivery times, wider\r\n     product selection, and greater flexibility in response to changing market\r\n     conditions.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Asset\r\n     Turnover: Inventory represents a significant asset for many companies,\r\n     particularly those in manufacturing or retail. Effective inventory\r\n     management can help improve asset turnover ratio, which measures how\r\n     efficiently a company is using its assets to generate sales.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Return\r\n     on Invested Capital (ROIC): Inventory can be a major component of invested\r\n     capital, so effective inventory management can directly impact ROIC. By\r\n     reducing inventory costs and improving turns, companies can increase their\r\n     return on invested capital.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Profit\r\n     Margins: Inventory management affects profit margins by influencing the\r\n     cost of goods sold, overhead expenses related to holding and handling\r\n     inventory, and the opportunity cost of tying up capital in unsold\r\n     inventory.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Market\r\n     Volatility: Inventory management becomes even more critical during periods\r\n     of market volatility, when unexpected changes in demand or supply can have\r\n     a significant impact on a company\'s financials. By maintaining optimal\r\n     inventory levels, companies can better navigate these challenges and avoid\r\n     excessive stockpiling or shortages.<o:p></o:p></span></li>\r\n</ol><p class=\"MsoNormal\">\r\n\r\n\r\n\r\n</p><p class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">In summary, inventory plays a crucial role in driving a\r\ncompany\'s financial performance by affecting various aspects of operations,\r\nincluding cost of goods sold, working capital requirements, cash flow, risk\r\nmanagement, customer satisfaction, competitive advantage, asset turnover,\r\nreturn on invested capital, profit margins, and market volatility.<o:p></o:p></span></p>', 'Inventory can significantly impact a company\'s financial\r\nperformance in various ways. Here are some key drivers:\r\n Cost\r\n     of Goods Sold (COGS):...', 2, 1, 'draft', NULL, '2025-11-08 11:28:00', '2025-11-08 11:28:00', 'Clite Mutale (BBA, MBA, MCIPS)'),
(17, 'How do I know if I have an inventory problems and diagonize inventory problems and find solution to inventory problems', 'how-do-i-know-if-i-have-an-inventory-problems-and-diagonize-inventory-problems-and-find-solution-to-inventory-problems', '<p style=\"text-align: justify; margin-left: 25px;\"><b><span style=\"font-size:12.0pt;line-height:107%;\r\nfont-family:&quot;Poppins&quot;,serif\">How do I know if I have an inventory problems and\r\ndiagonize inventory problems and find solution to inventory problems. <o:p></o:p></span></b></p><p class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">Identifying inventory problems can be challenging, but there\r\nare several signs that may indicate the presence of inventory issues:<o:p></o:p></span></p><ol style=\"margin-top:0cm\" start=\"1\" type=\"1\">\r\n <li class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">High\r\n     Inventory Levels: If you have more stock than you need, it can lead to\r\n     unnecessary holding costs, obsolescence, and space constraints.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Stockouts\r\n     or Shortages: Unexpected stockouts or shortages can result in lost sales\r\n     and dissatisfied customers.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Inaccurate\r\n     Forecasting: Incorrect forecasts can lead to overstocking or\r\n     understocking, resulting in wasted resources and missed opportunities.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Inefficient\r\n     Ordering Processes: Disorganized or slow ordering processes can cause\r\n     delays and increase the risk of stockouts or oversupply.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Poor\r\n     Supplier Relationships: Difficulties with suppliers can impact your\r\n     ability to obtain necessary materials on time, leading to stockouts or\r\n     delays.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Lack\r\n     of Visibility: Limited visibility into your inventory levels, locations,\r\n     and movements can make it difficult to identify potential problems before\r\n     they become critical.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Inadequate\r\n     Reporting and Analytics: Without proper reporting and analytics\r\n     capabilities, you may not be able to track key performance indicators\r\n     (KPIs) such as inventory turnover, fill rates, and days inventory\r\n     outstanding (DIO).<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Resistance\r\n     to Change: Inflexible thinking or a reluctance to adopt new technologies\r\n     and strategies can hinder efforts to address inventory problems.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Lack\r\n     of Staff Training: Insufficient training for staff members responsible for\r\n     managing inventory can lead to errors and inefficiencies.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Ignoring\r\n     Early Warning Signs: Failure to address early warning signs of inventory\r\n     problems can allow them to escalate into larger issues.<o:p></o:p></span></li>\r\n</ol><p class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\"><b>To diagnose inventory problems, follow these steps:</b><o:p></o:p></span></p><ol style=\"margin-top:0cm\" start=\"1\" type=\"1\">\r\n <li class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Gather\r\n     Data: Collect historical data on inventory levels, movements, and KPIs to\r\n     identify patterns and trends.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Conduct\r\n     Regular Audits: Perform regular physical counts and cycle counting to\r\n     verify inventory accuracy and identify discrepancies.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Use\r\n     Inventory Management Software: Utilize software solutions designed to help\r\n     manage inventory, including tracking, reporting, and alert systems.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Analyze\r\n     Sales Trends: Review sales data to identify seasonal fluctuations, growth\r\n     areas, and areas where demand is declining.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Evaluate\r\n     Your Business Model: Assess whether your business model is optimized for\r\n     efficient inventory management, taking into account factors like\r\n     production schedules, shipping times, and customer expectations.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Consult\r\n     With Experts: Seek advice from supply chain consultants or inventory\r\n     management professionals who can provide objective insights and\r\n     recommendations.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Implement\r\n     Solutions: Based on your analysis, implement inventory optimization\r\n     strategies, such as adjusting safety stock levels, optimizing reorder\r\n     points, or improving forecasting methods.<o:p></o:p></span></li>\r\n</ol><p class=\"MsoNormal\" style=\"text-align: justify; \"><span style=\"font-size:12.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\"><b>Solution options for common inventory problems include:</b><o:p></o:p></span></p><ol style=\"margin-top:0cm\" start=\"1\" type=\"1\">\r\n <li class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Improved\r\n     Forecasting Techniques: Utilize advanced statistical models, machine\r\n     learning algorithms, or expert judgment to develop more accurate forecasts.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Inventory\r\n     Optimization Strategies: Apply techniques such as ABC classification,\r\n     just-in-time (JIT) inventory management, or vendor-managed inventory (VMI)\r\n     to optimize inventory levels and reduce waste.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Streamlined\r\n     Ordering Processes: Automate order processing and fulfillment tasks\r\n     through technology integration or process improvements to minimize delay\r\n     and maximize efficiency.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Enhanced\r\n     Supply Chain Collaboration: Foster closer relationships with suppliers and\r\n     distributors by implementing collaborative planning, forecasting, and\r\n     replenishment (CPFR) practices.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Warehouse\r\n     Organizational Changes: Implement better warehouse layouts, labeling\r\n     schemes, or material handling procedures to improve inventory location and\r\n     access.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Workforce\r\n     Training Programs: Develop training programs tailored to specific roles\r\n     within your organization to enhance inventory management skills and\r\n     knowledge.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align: justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Adoption\r\n     of New Technologies: Explore innovative inventory management tools such as\r\n     robotic picking, autonomous mobile robots (AMRs), or artificial\r\n     intelligence (AI)-powered predictive analytics.<o:p></o:p></span></li>\r\n</ol><p>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n</p><p class=\"MsoNormal\" style=\"text-align: justify; \"><span style=\"font-size:12.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">&nbsp;</span></p>', 'How do I know if I have an inventory problems and\r\ndiagonize inventory problems and find solution to inventory problems. Identifying inventory...', 2, 1, 'published', NULL, '2025-11-08 11:29:11', '2025-11-08 11:42:24', 'Clite Mutale (BBA, MBA, MCIPS)'),
(18, 'Analyze how big data impacts emerging businesses and markets within the procurement and supply function', 'analyze-how-big-data-impacts-emerging-businesses-and-markets-within-the-procurement-and-supply-function', '<p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Big\r\ndata is reshaping procurement and supply functions, especially for emerging\r\nbusinesses and markets, by enabling smarter, faster, and more resilient\r\noperations. Big Data has revolutionized the way organizations operate,\r\nparticularly in the fields of procurement and supply chain management. This\r\ncontext explore how Big Data is transforming procurement and supply chain\r\nmanagement, specifically in emerging businesses and markets. Key impacts area\r\nof Big data in procurement and supply&nbsp;include: efficiency and cost\r\nsavings, decision-making and strategic planning, market responsiveness and\r\ninnovation,<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><u><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Efficiency\r\nand Cost Savings</span></u><span style=\"font-size:12.0pt;line-height:150%;\r\nfont-family:&quot;Times New Roman&quot;,serif\"><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Big\r\nData analytics helps organizations optimize inventory levels, reduce waste, and\r\nstreamline logistics operations, leading to cost savings and improved\r\noperational efficiency.&nbsp;Big data analytics streamlines procurement and\r\nsupply chain processes by providing real-time insights into spending,\r\ninventory, and supplier performance. This leads to improved demand forecasting,\r\noptimized inventory management, and reduced operational costs—key advantages\r\nfor emerging businesses seeking efficiency and competitiveness (Adesola et al.,\r\n2025; Thi, 2025; Hallikas et al., 2021; Rahman &amp; Fahim, 2018; Raman et al.,\r\n2018; Narwane et al., 2021; Usuemerai et al., 2024; Adebayo et al., 2024;\r\nOncioiu et al., 2019; Lee &amp; Mangalaraj, 2022). Predictive analytics and\r\nmachine learning help businesses anticipate market trends and supply chain\r\ndisruptions, allowing for proactive decision-making and resource allocation\r\n(Adesola et al., 2025; Thi, 2025; Hallikas et al., 2021; Raman et al., 2018;\r\nUsuemerai et al., 2024; Lee &amp; Mangalaraj, 2022).<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><u><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Decision-Making\r\nand strategic planning</span></u><span style=\"font-size:12.0pt;line-height:\r\n150%;font-family:&quot;Times New Roman&quot;,serif\"><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Data-driven\r\ndecision-making enables procurement professionals to make informed choices\r\nabout supplier selection, contract negotiations, and risk management. With\r\naccess to real-time data and predictive analytics, businesses can respond\r\nquickly to changes in the market or supply chain. Data-driven decision-making\r\nempowers procurement professionals to make informed choices about supplier\r\nselection, contract negotiation, and risk management. Integrating data from\r\ndiverse sources (e.g., IoT devices, market intelligence) enables more accurate\r\nscenario analysis and strategic planning, which is crucial for businesses\r\noperating in volatile or rapidly growing markets (Thi, 2025; Hallikas et al.,\r\n2021; Usuemerai et al., 2024; Adebayo et al., 2024; Roßmann et al., 2017;\r\nPatrucco et al., 2023; Lee &amp; Mangalaraj, 2022). Digital procurement\r\ncapabilities, when combined with strong data analytics, directly improve supply\r\nchain performance and business success (Hallikas et al., 2021; Narwane et al.,\r\n2021; Adebayo et al., 2024; Patrucco et al., 2023).<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><u><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Market\r\nResponsiveness and Innovation</span></u><span style=\"font-size:12.0pt;\r\nline-height:150%;font-family:&quot;Times New Roman&quot;,serif\"><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Big\r\nData enables businesses to react swiftly to shifting market trends and customer\r\npreferences. By analyzing consumer behavior and sentiment, companies can\r\nidentify new opportunities and develop innovative products and\r\nservices.&nbsp;Big data allows emerging businesses to quickly adapt to changing\r\nmarket demands by identifying consumer trends and optimizing product delivery.\r\nReal-time data processing and analytics facilitate agile responses to\r\nfluctuations, helping businesses maintain customer satisfaction and gain a\r\ncompetitive edge (Thi, 2025; Rahman &amp; Fahim, 2018; Raman et al., 2018;\r\nUsuemerai et al., 2024; Huda et al., 2025; Lee &amp; Mangalaraj, 2022). In\r\nemerging markets, big data supports value creation and capture, enabling firms\r\nto discover new opportunities and innovate within their supply chains (Rahman\r\n&amp; Fahim, 2018; Narwane et al., 2021; Huda et al., 2025).<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><b><i><u><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">How\r\nBig Data is Transforming Procurement and Supply in <a name=\"_Hlk214104918\">Emerging\r\nBusinesses and Markets</a></span></u></i></b><b><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">.</span></b><span style=\"font-size:12.0pt;line-height:\r\n150%;font-family:&quot;Times New Roman&quot;,serif\"><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">How\r\nbig data</span> is <span style=\"font-size:12.0pt;line-height:150%;font-family:\r\n&quot;Times New Roman&quot;,serif\">transforming Procurement and Supply in Emerging\r\nBusinesses and Markets is briefly explained as follows:<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><u><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Optimized\r\ninventory management</span></u><span style=\"font-size:12.0pt;line-height:150%;\r\nfont-family:&quot;Times New Roman&quot;,serif\"><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">By\r\nanalyzing historical sales patterns and real-time demand data, organizations\r\ncan optimize their inventory levels, reducing excess stock and minimizing\r\nwaste.<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><u><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Streamlined\r\nlogistics operations</span></u><span style=\"font-size:12.0pt;line-height:150%;\r\nfont-family:&quot;Times New Roman&quot;,serif\"><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">&nbsp;Big\r\nData analytics helps businesses identify bottlenecks in their logistics\r\noperations and implement improvements to increase efficiency and reduce costs.<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><u><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Improved\r\nrisk management</span></u><span style=\"font-size:12.0pt;line-height:150%;\r\nfont-family:&quot;Times New Roman&quot;,serif\"><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">&nbsp;With\r\naccess to real-time data on supply chain risks, organizations can take\r\nproactive measures to mitigate those risks, ensuring uninterrupted supply chain\r\noperations.<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><u><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">New\r\nbusiness models and competitive advantage:</span></u><span style=\"font-size:\r\n12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\"><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">&nbsp;Big\r\nData enables businesses to discover new revenue streams and create innovative\r\nproducts and services, giving them a competitive advantage in their respective\r\nindustries.<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><b><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Challenges\r\nand Limitations of Big Data in Procurement and Supply</span></b><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\"><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Despite\r\nthe potential benefits of Big Data, there are several implementation challenges\r\nthat need to be addressed, including data quality issues, integration\r\ncomplexities, and cultural resistances to change. The challenge of big data\r\ninclude the following:<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><u><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Data\r\nquality issues</span></u><span style=\"font-size:12.0pt;line-height:150%;\r\nfont-family:&quot;Times New Roman&quot;,serif\"><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Poor\r\ndata quality can lead to inaccurate predictions and flawed decision-making.\r\nEnsuring data accuracy and completeness is essential for effective Big Data\r\nanalysis.<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><u><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Integration\r\ncomplexities</span></u><span style=\"font-size:12.0pt;line-height:150%;\r\nfont-family:&quot;Times New Roman&quot;,serif\"><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Integrating\r\ndata from various sources can be a challenge, particularly if the data is in\r\ndifferent formats or languages. Effective data integration techniques are\r\nnecessary to ensure seamless data flow.<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><u><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Organizational\r\ncultural resistance</span></u><span style=\"font-size:12.0pt;line-height:150%;\r\nfont-family:&quot;Times New Roman&quot;,serif\"><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Some\r\norganizations may resist adopting Big Data technologies due to concerns around\r\nprivacy, security, or job displacement. Addressing these concerns through\r\neducation and training programs can help overcome cultural resistances.<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Overcoming\r\nthese requires robust data governance, scalable technology, and a culture that\r\nvalues analytics (Adesola et al., 2025; Hallikas et al., 2021; For emerging\r\nbusinesses, limited resources and digital infrastructure can be significant\r\nhurdles, but targeted investments in analytics capabilities and digital\r\nplatforms can mitigate these issues (Hallikas et al., 2021; Narwane et al.,\r\n2021; Usuemerai et al., 2024; Handfield et al., 2019).<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><b><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Best\r\nPractices for Leveraging Big Data in Procurement and Supply</span></b><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\"><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">To\r\nmaximize the benefits of Big Data in procurement and supply, organizations\r\nshould follow best practices such as:<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><u><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Building\r\na Culture of Data-Driven Decision-Making</span></u><span style=\"font-size:12.0pt;\r\nline-height:150%;font-family:&quot;Times New Roman&quot;,serif\">:<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Encourage\r\na culture of data-driven decision-making throughout the organization, involving\r\nstakeholders from all departments in the decision-making process.<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><u><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Selecting\r\nthe Right Tools and Technologies:</span></u><span style=\"font-size:12.0pt;\r\nline-height:150%;font-family:&quot;Times New Roman&quot;,serif\"><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Choose\r\nappropriate tools and technologies based on your organization\'s specific needs\r\nand budget constraints. Consider cloud-based solutions that offer flexibility\r\nand scalability.<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><u><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Defining\r\nClear Objectives and Metrics:</span></u><span style=\"font-size:12.0pt;\r\nline-height:150%;font-family:&quot;Times New Roman&quot;,serif\"><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Establish\r\nclear objectives and metrics for measuring the success of your Big Data\r\ninitiatives. Regularly monitoring progress towards these goals can help you\r\nstay focused and adjust your strategy accordingly.<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><b><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Conclusion</span></b><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\"><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Big\r\ndata is a catalyst for operational excellence, strategic agility, and\r\ninnovation in procurement and supply, especially for emerging businesses and\r\nmarkets. Big Data is transforming procurement and supply chain management in\r\nemerging businesses and markets, offering significant efficiencies, cost\r\nsavings, and innovation opportunities. While there are challenges and\r\nlimitations to consider, successful deployment of Big Data technologies can\r\nprovide a competitive advantage in today\'s fast-paced business environment. By\r\nfollowing best practices and addressing implementation challenges,\r\norganizations can leverage the full potential of Big Data to drive growth and\r\nprofitability.<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><b><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">References</span></b><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\"><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Adesola,\r\nO., Taiwo, I., Adeyemi, D., Nwariaku, H., &amp; Abidola, A. (2025). Advancing\r\ndata-driven decision-making processes using big data analytics in procurement,\r\nproduction and distribution networks.&nbsp;<i>World Journal of Advanced\r\nResearch and Reviews</i>.&nbsp;<a href=\"https://doi.org/10.30574/wjarr.2025.25.2.0419\">https://doi.org/10.30574/wjarr.2025.25.2.0419</a><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Thi,\r\nH. (2025). Harnessing the power of Big Data: transforming market prediction and\r\nsupply chain optimization.&nbsp;<i>HPU2 Journal of Science: Natural Sciences\r\nand Technology</i>.&nbsp;<a href=\"https://doi.org/10.56764/hpu2.jos.2025.4.01.71-83\">https://doi.org/10.56764/hpu2.jos.2025.4.01.71-83</a><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Hallikas,\r\nJ., Immonen, M., &amp; Brax, S. (2021). Digitalizing procurement: the impact of\r\ndata analytics on supply chain performance.&nbsp;<i>Supply Chain Management: An\r\nInternational Journal</i>.&nbsp;<a href=\"https://doi.org/10.1108/scm-05-2020-0201\">https://doi.org/10.1108/scm-05-2020-0201</a><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Rahman,\r\nA., &amp; Fahim, A. (2018). An Analysis of the Potential Applications of Big\r\nData Analytics (BDA) in Supply Chain Management: Emerging Market\r\nPerspective.&nbsp;<i>Developing Country Studies</i>, 8, 80-90.<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Raman,\r\nS., Patwa, N., Niranjan, I., Ranjan, U., Moorthy, K., &amp; Mehta, A. (2018).\r\nImpact of big data on supply chain management.&nbsp;<i>International Journal of\r\nLogistics Research and Applications</i>, 21, 579 - 596.&nbsp;<a href=\"https://doi.org/10.1080/13675567.2018.1459523\">https://doi.org/10.1080/13675567.2018.1459523</a><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Narwane,\r\nV., Raut, R., Yadav, V., Cheikhrouhou, N., Narkhede, B., &amp; Priyadarshinee,\r\nP. (2021). The role of big data for Supply Chain 4.0 in manufacturing\r\norganisations of developing countries.&nbsp;<i>J. Enterp. Inf. Manag.</i>, 34,\r\n1452-1480.&nbsp;<a href=\"https://doi.org/10.1108/jeim-11-2020-0463\">https://doi.org/10.1108/jeim-11-2020-0463</a><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Usuemerai,\r\nP., Ibikunle, O., Abass, L., Alemede, V., Nwankwo, E., &amp; Mbata, A. (2024).\r\nAdvanced supply chain optimization for emerging market healthcare\r\nsystems.&nbsp;<i>International Journal of Management &amp; Entrepreneurship\r\nResearch</i>.&nbsp;<a href=\"https://doi.org/10.51594/ijmer.v6i10.1637\">https://doi.org/10.51594/ijmer.v6i10.1637</a><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Adebayo,\r\nV., Paul, P., &amp; Eyo-Udo, N. (2024). The role of data analysis and reporting\r\nin modern procurement: Enhancing decision-making and supplier management.&nbsp;<i>International\r\nJournal of Management &amp; Entrepreneurship Research</i>.&nbsp;<a href=\"https://doi.org/10.51594/ijmer.v6i7.1262\">https://doi.org/10.51594/ijmer.v6i7.1262</a><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Roßmann,\r\nB., Canzaniello, A., Gracht, H., &amp; Hartmann, E. (2017). The future and\r\nsocial impact of Big Data Analytics in Supply Chain Management: Results from a\r\nDelphi study.&nbsp;<i>Technological Forecasting and Social Change</i>, 130,\r\n135-149.&nbsp;<a href=\"https://doi.org/10.1016/j.techfore.2017.10.005\">https://doi.org/10.1016/j.techfore.2017.10.005</a><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Oncioiu,\r\nI., Bunget, O., Türkeș, M., Căpușneanu, S., Topor, D., Tamaș, A., Rakos, I.,\r\n&amp; Hint, M. (2019). The Impact of Big Data Analytics on Company Performance\r\nin Supply Chain Management.&nbsp;<i>Sustainability</i>.&nbsp;<a href=\"https://doi.org/10.3390/su11184864\">https://doi.org/10.3390/su11184864</a><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Kache,\r\nF., &amp; Seuring, S. (2017). Challenges and opportunities of digital\r\ninformation at the intersection of Big Data Analytics and supply chain\r\nmanagement.&nbsp;<i>International Journal of Operations &amp; Production\r\nManagement</i>, 37, 10-36.&nbsp;<a href=\"https://doi.org/10.1108/ijopm-02-2015-0078\">https://doi.org/10.1108/ijopm-02-2015-0078</a><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Patrucco,\r\nA., Marzi, G., &amp; Trabucchi, D. (2023). The role of absorptive capacity and\r\nbig data analytics in strategic purchasing and supply chain management\r\ndecisions.&nbsp;<i>Technovation</i>.&nbsp;<a href=\"https://doi.org/10.1016/j.technovation.2023.102814\">https://doi.org/10.1016/j.technovation.2023.102814</a><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Huda,\r\nM., Rahayu, A., Furqon, C., Sultan, M., Hartati, N., &amp; Sugiana, N. (2025).\r\nImproving Performance with Big Data: Smart Supply Chain and Market Orientation\r\nin SMEs.&nbsp;<i>International Journal of Advanced Computer Science and\r\nApplications</i>.&nbsp;<a href=\"https://doi.org/10.14569/ijacsa.2025.0160280\">https://doi.org/10.14569/ijacsa.2025.0160280</a><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Lee,\r\nI., &amp; Mangalaraj, G. (2022). Big Data Analytics in Supply Chain Management:\r\nA Systematic Literature Review and Research Directions.&nbsp;<i>Big Data Cogn.\r\nComput.</i>, 6, 17.&nbsp;<a href=\"https://doi.org/10.3390/bdcc6010017\">https://doi.org/10.3390/bdcc6010017</a><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">Handfield,\r\nR., Jeong, S., &amp; Choi, T. (2019). Emerging procurement technology: data\r\nanalytics and cognitive analytics.&nbsp;<i>International Journal of Physical\r\nDistribution &amp; Logistics Management</i>, 49, 972-1002.&nbsp;<a href=\"https://doi.org/10.1108/ijpdlm-11-2017-0348\">https://doi.org/10.1108/ijpdlm-11-2017-0348</a><o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">&nbsp;<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"margin-left: 36pt; line-height: 150%;\">\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n</p><p class=\"MsoNormal\" style=\"text-align:justify;line-height:150%\"><span style=\"font-size:12.0pt;line-height:150%;font-family:&quot;Times New Roman&quot;,serif\">&nbsp;</span></p>', 'Big\r\ndata is reshaping procurement and supply functions, especially for emerging\r\nbusinesses and markets, by enabling smarter, faster, and more...', 9, 1, 'published', NULL, '2025-11-09 17:57:02', '2025-11-15 11:22:11', 'Clite Mutale (BBA, MBA, MCIPS)');
INSERT INTO `posts` (`id`, `title`, `slug`, `content`, `excerpt`, `category_id`, `author_id`, `status`, `featured_image`, `created_at`, `updated_at`, `manual_author_name`) VALUES
(19, 'Discuss the impact of big data on the future skills and expectations placed on strategic procurement and supply leaders', 'discuss-the-impact-of-big-data-on-the-future-skills-and-expectations-placed-on-strategic-procurement-and-supply-leaders', '<img src=\"assets/images/6911c613d30af.png\" alt=\"Gemini_Generated_Image_jfs8vqjfs8vqjfs8 (2).png\" style=\"max-width:100%;\"><p><br></p><p class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">Big data is fundamentally reshaping the landscape of\r\nprocurement and supply chain management, driving a shift in the skills and\r\nexpectations required of future leaders in these fields.<o:p></o:p></span></p><p class=\"MsoNormal\"><b><span style=\"font-size:12.0pt;line-height:107%;\r\nfont-family:&quot;Poppins&quot;,serif\">Evolving Skills for Strategic Leaders<o:p></o:p></span></b></p><p class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">Big data analytics demands that procurement and supply leaders\r\ndevelop advanced analytical, technological, and strategic capabilities. Leaders\r\nmust be adept at integrating and interpreting data from diverse\r\nsources—internal systems, supplier databases, and external market\r\nintelligence—to inform high-level decision-making and drive innovation. This\r\nrequires proficiency in data science, predictive analytics, and digital tools,\r\nas well as the ability to translate complex data insights into actionable strategies.<o:p></o:p></span></p><p class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">Critical skills now include:<o:p></o:p></span></p><ul style=\"margin-top:0cm\" type=\"disc\">\r\n <li class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Data-driven\r\n     decision-making and scenario analysis<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Mastery\r\n     of digital procurement platforms and analytics tools<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Agility\r\n     and adaptability to leverage real-time data for rapid response<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Strong\r\n     communication and integration skills to foster cross-functional\r\n     collaboration<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Strategic\r\n     thinking to align data insights with organizational goals<o:p></o:p></span></li>\r\n</ul><p class=\"MsoNormal\"><b><span style=\"font-size:12.0pt;line-height:107%;\r\nfont-family:&quot;Poppins&quot;,serif\">Changing Expectations and Roles<o:p></o:p></span></b></p><p class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">The expectations placed on procurement and supply leaders are\r\nshifting from traditional operational oversight to strategic, value-adding\r\nroles. Leaders are now expected to:<o:p></o:p></span></p><ul style=\"margin-top:0cm\" type=\"disc\">\r\n <li class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Drive\r\n     digital transformation and champion data-driven cultures within their\r\n     organizations<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Exploit\r\n     big data to enhance supplier management, risk mitigation, and cost\r\n     optimization<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Lead\r\n     the adoption of emerging technologies such as AI, blockchain, and\r\n     predictive analytics for greater transparency and efficiency<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Balance\r\n     automation with human judgment, emphasizing intuition, trust, and ethical\r\n     considerations in decision-making<o:p></o:p></span></li>\r\n</ul><p class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">As supply chain processes become increasingly automated,\r\nleaders must focus on higher-order tasks—such as strategic supplier\r\nrelationships, sustainability initiatives, and innovation—while ensuring robust\r\ndata governance and organizational adaptability.<o:p></o:p></span></p><p class=\"MsoNormal\"><b><span style=\"font-size:12.0pt;line-height:107%;\r\nfont-family:&quot;Poppins&quot;,serif\">Implications for the Future<o:p></o:p></span></b></p><p class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">The integration of big data analytics is expected to:<o:p></o:p></span></p><ul style=\"margin-top:0cm\" type=\"disc\">\r\n <li class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Improve\r\n     demand forecasting, inventory control, and supplier performance management<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Enhance\r\n     supply chain agility, resilience, and competitiveness<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Require\r\n     ongoing upskilling and a shift toward continuous learning in digital and\r\n     analytical domains<o:p></o:p></span></li>\r\n</ul><p class=\"MsoNormal\"><b><span style=\"font-size:12.0pt;line-height:107%;\r\nfont-family:&quot;Poppins&quot;,serif\">Key Skills and Expectations for Future Leaders<o:p></o:p></span></b></p><table class=\"MsoNormalTable\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\" width=\"656\" style=\"width: 492.15pt; border: none;\">\r\n <thead>\r\n  <tr style=\"mso-yfti-irow:0;mso-yfti-firstrow:yes;height:22.05pt\">\r\n   <td valign=\"bottom\" style=\"border-width: 1pt; border-color: rgb(228, 228, 231); padding: 0cm 27pt 12pt 0cm; height: 22.05pt;\">\r\n   <p class=\"MsoNormal\"><b><span style=\"font-size:12.0pt;line-height:107%;\r\n   font-family:&quot;Poppins&quot;,serif\">Skill/Expectation<o:p></o:p></span></b></p>\r\n   </td>\r\n   <td valign=\"bottom\" style=\"border-top-width: 1pt; border-right-width: 1pt; border-bottom-width: 1pt; border-top-color: rgb(228, 228, 231); border-right-color: rgb(228, 228, 231); border-bottom-color: rgb(228, 228, 231); border-left: none; padding: 0cm 27pt 12pt 0cm; height: 22.05pt;\">\r\n   <p class=\"MsoNormal\"><b><span style=\"font-size:12.0pt;line-height:107%;\r\n   font-family:&quot;Poppins&quot;,serif\">Description<o:p></o:p></span></b></p>\r\n   </td>\r\n  </tr>\r\n </thead>\r\n <tbody><tr style=\"mso-yfti-irow:1;height:22.8pt\">\r\n  <td valign=\"top\" style=\"border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; border-right-color: rgb(228, 228, 231); border-bottom-color: rgb(228, 228, 231); border-left-color: rgb(228, 228, 231); border-top: none; padding: 6.85pt 27pt 6.85pt 0cm; height: 22.8pt;\">\r\n  <p class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:\r\n  &quot;Poppins&quot;,serif\">Data analytics &amp; digital literacy<o:p></o:p></span></p>\r\n  </td>\r\n  <td valign=\"top\" style=\"border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: rgb(228, 228, 231); border-right-width: 1pt; border-right-color: rgb(228, 228, 231); padding: 6.85pt 27pt 6.85pt 0cm; height: 22.8pt;\">\r\n  <p class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:\r\n  &quot;Poppins&quot;,serif\">Ability to interpret and leverage big data for\r\n  decision-making<o:p></o:p></span></p>\r\n  </td>\r\n </tr>\r\n <tr style=\"mso-yfti-irow:2;height:22.05pt\">\r\n  <td valign=\"top\" style=\"border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; border-right-color: rgb(228, 228, 231); border-bottom-color: rgb(228, 228, 231); border-left-color: rgb(228, 228, 231); border-top: none; padding: 6.85pt 27pt 6.85pt 0cm; height: 22.05pt;\">\r\n  <p class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:\r\n  &quot;Poppins&quot;,serif\">Strategic agility<o:p></o:p></span></p>\r\n  </td>\r\n  <td valign=\"top\" style=\"border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: rgb(228, 228, 231); border-right-width: 1pt; border-right-color: rgb(228, 228, 231); padding: 6.85pt 27pt 6.85pt 0cm; height: 22.05pt;\">\r\n  <p class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:\r\n  &quot;Poppins&quot;,serif\">Rapid adaptation to data-driven insights and market changes<o:p></o:p></span></p>\r\n  </td>\r\n </tr>\r\n <tr style=\"mso-yfti-irow:3;height:22.8pt\">\r\n  <td valign=\"top\" style=\"border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; border-right-color: rgb(228, 228, 231); border-bottom-color: rgb(228, 228, 231); border-left-color: rgb(228, 228, 231); border-top: none; padding: 6.85pt 27pt 6.85pt 0cm; height: 22.8pt;\">\r\n  <p class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:\r\n  &quot;Poppins&quot;,serif\">Cross-functional collaboration<o:p></o:p></span></p>\r\n  </td>\r\n  <td valign=\"top\" style=\"border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: rgb(228, 228, 231); border-right-width: 1pt; border-right-color: rgb(228, 228, 231); padding: 6.85pt 27pt 6.85pt 0cm; height: 22.8pt;\">\r\n  <p class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:\r\n  &quot;Poppins&quot;,serif\">Integrating data across departments and with external\r\n  partners<o:p></o:p></span></p>\r\n  </td>\r\n </tr>\r\n <tr style=\"mso-yfti-irow:4;height:22.8pt\">\r\n  <td valign=\"top\" style=\"border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; border-right-color: rgb(228, 228, 231); border-bottom-color: rgb(228, 228, 231); border-left-color: rgb(228, 228, 231); border-top: none; padding: 6.85pt 27pt 6.85pt 0cm; height: 22.8pt;\">\r\n  <p class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:\r\n  &quot;Poppins&quot;,serif\">Technology adoption leadership<o:p></o:p></span></p>\r\n  </td>\r\n  <td valign=\"top\" style=\"border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: rgb(228, 228, 231); border-right-width: 1pt; border-right-color: rgb(228, 228, 231); padding: 6.85pt 27pt 6.85pt 0cm; height: 22.8pt;\">\r\n  <p class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:\r\n  &quot;Poppins&quot;,serif\">Driving digital transformation and embracing new\r\n  technologies<o:p></o:p></span></p>\r\n  </td>\r\n </tr>\r\n <tr style=\"mso-yfti-irow:5;mso-yfti-lastrow:yes;height:22.8pt\">\r\n  <td valign=\"top\" style=\"border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; border-right-color: rgb(228, 228, 231); border-bottom-color: rgb(228, 228, 231); border-left-color: rgb(228, 228, 231); border-top: none; padding: 6.85pt 27pt 6.85pt 0cm; height: 22.8pt;\">\r\n  <p class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:\r\n  &quot;Poppins&quot;,serif\">Ethical and critical thinking<o:p></o:p></span></p>\r\n  </td>\r\n  <td valign=\"top\" style=\"border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: rgb(228, 228, 231); border-right-width: 1pt; border-right-color: rgb(228, 228, 231); padding: 6.85pt 27pt 6.85pt 0cm; height: 22.8pt;\">\r\n  <p class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:\r\n  &quot;Poppins&quot;,serif\">Balancing automation with human judgment and ethical\r\n  oversight<o:p></o:p></span></p>\r\n  </td>\r\n </tr>\r\n</tbody></table><p class=\"MsoNormal\"><b><span style=\"font-size:12.0pt;line-height:107%;\r\nfont-family:&quot;Poppins&quot;,serif\">Figure&nbsp;1</span></b><span style=\"font-size:\r\n12.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">&nbsp;Table summarizing\r\nfuture skills and expectations for procurement leaders in the era of big data.<o:p></o:p></span></p><p class=\"MsoNormal\"><b><span style=\"font-size:12.0pt;line-height:107%;\r\nfont-family:&quot;Poppins&quot;,serif\">Conclusion<o:p></o:p></span></b></p><p>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n</p><p class=\"MsoNormal\"><span style=\"font-size:12.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">Big data is redefining the competencies and expectations for\r\nstrategic procurement and supply leaders, emphasizing advanced analytics,\r\ndigital fluency, and strategic vision. Leaders who cultivate these skills will\r\nbe best positioned to drive value and innovation in increasingly complex,\r\ndata-driven supply chains.<o:p></o:p></span></p>', 'Big data is fundamentally reshaping the landscape of\r\nprocurement and supply chain management, driving a shift in the skills and\r\nexpectations...', 9, 1, 'published', NULL, '2025-11-10 10:41:05', '2025-11-10 11:15:52', 'Clite Mutale (BBA, MBA, MCIPS)'),
(20, 'Evaluate the future challenges of big data for the procurement and supply profession.', 'evaluate-the-future-challenges-of-big-data-for-the-procurement-and-supply-profession-', '<img src=\"assets/images/6911c95983556.png\" alt=\"Gemini_Generated_Image_jfs8vqjfs8vqjfs8 (2).png\" style=\"max-width:100%;\"><p class=\"MsoNormal\" style=\"text-align:justify\"><br></p><p class=\"MsoNormal\" style=\"text-align:justify\"><span style=\"font-size:12.0pt;\r\nline-height:107%;font-family:&quot;Poppins&quot;,serif\">Big Data has revolutionized\r\nvarious industries, including procurement and supply chain management. However,\r\nas the volume, variety, and velocity of data continue to increase, new\r\nchallenges are emerging that will impact the procurement and supply function in\r\nthe future:<o:p></o:p></span></p><ol style=\"margin-top:0cm\" start=\"1\" type=\"1\">\r\n <li class=\"MsoNormal\" style=\"text-align:justify;mso-list:l0 level1 lfo1;\r\n     tab-stops:list 36.0pt\"><span style=\"font-size:12.0pt;line-height:107%;\r\n     font-family:&quot;Poppins&quot;,serif\">Data Quality Issues: With more data being\r\n     generated from various sources, ensuring data quality becomes increasingly\r\n     important. Poor-quality data can lead to incorrect analysis,\r\n     decision-making, and ultimately, suboptimal business outcomes. Procurement\r\n     and supply teams must invest in data validation, cleansing, and\r\n     standardization processes to maintain high data quality.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align:justify;mso-list:l0 level1 lfo1;\r\n     tab-stops:list 36.0pt\"><span style=\"font-size:12.0pt;line-height:107%;\r\n     font-family:&quot;Poppins&quot;,serif\">Privacy Concerns: As organizations collect\r\n     and analyze larger amounts of personal or sensitive information (e.g.,\r\n     employee data, customer data), they need to ensure compliance with privacy\r\n     regulations like GDPR, CCPA, etc. Failure to do so may result in hefty\r\n     penalties, reputational damage, and loss of trust among stakeholders.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align:justify;mso-list:l0 level1 lfo1;\r\n     tab-stops:list 36.0pt\"><span style=\"font-size:12.0pt;line-height:107%;\r\n     font-family:&quot;Poppins&quot;,serif\">Cybersecurity Threats: The increased reliance\r\n     on digital technologies and data storage systems creates an expanded\r\n     attack surface for cybercriminals. Procurement and supply teams must\r\n     implement robust security measures, such as encryption, access controls,\r\n     and incident response plans, to protect their data against potential\r\n     threats.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align:justify;mso-list:l0 level1 lfo1;\r\n     tab-stops:list 36.0pt\"><span style=\"font-size:12.0pt;line-height:107%;\r\n     font-family:&quot;Poppins&quot;,serif\">Skills Shortages: As the complexity of data\r\n     analytics grows, there is a growing demand for skilled professionals who\r\n     can interpret and act upon insights derived from large datasets. Filling\r\n     these skill gaps through training programs, hiring external experts, or\r\n     partnering with specialist firms will be crucial for companies to remain\r\n     competitive.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align:justify;mso-list:l0 level1 lfo1;\r\n     tab-stops:list 36.0pt\"><span style=\"font-size:12.0pt;line-height:107%;\r\n     font-family:&quot;Poppins&quot;,serif\">Overload of Information: With the sheer\r\n     amount of available data constantly increasing, it\'s becoming harder for\r\n     procurement and supply teams to identify relevant insights and make\r\n     informed decisions. Advanced analytical techniques, such as predictive modeling\r\n     and machine learning, can help sift through the noise and extract valuable\r\n     patterns, but require significant investments in technology and talent.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align:justify;mso-list:l0 level1 lfo1;\r\n     tab-stops:list 36.0pt\"><span style=\"font-size:12.0pt;line-height:107%;\r\n     font-family:&quot;Poppins&quot;,serif\">Integration Challenges: Connecting different\r\n     data sources and systems within an organization remains a challenge,\r\n     particularly when legacy systems are involved. Ensuring seamless\r\n     integration between data sources, tools, and platforms is essential for\r\n     effective data analysis and strategic decision-making.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align:justify;mso-list:l0 level1 lfo1;\r\n     tab-stops:list 36.0pt\"><span style=\"font-size:12.0pt;line-height:107%;\r\n     font-family:&quot;Poppins&quot;,serif\">Ethical Considerations: As AI and machine\r\n     learning become more prevalent in procurement and supply operations,\r\n     ethical concerns arise regarding algorithmic bias, transparency,\r\n     accountability, and fairness. Organizations should establish clear\r\n     guidelines and frameworks to address these issues proactively.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align:justify;mso-list:l0 level1 lfo1;\r\n     tab-stops:list 36.0pt\"><span style=\"font-size:12.0pt;line-height:107%;\r\n     font-family:&quot;Poppins&quot;,serif\">Scalability Limitations: As the size and\r\n     complexity of data sets grow exponentially, traditional processing methods\r\n     might struggle to keep up. New architectures and distributed computing\r\n     approaches, such as cloud-based solutions, will be necessary to handle\r\n     massive volumes of data efficiently.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align:justify;mso-list:l0 level1 lfo1;\r\n     tab-stops:list 36.0pt\"><span style=\"font-size:12.0pt;line-height:107%;\r\n     font-family:&quot;Poppins&quot;,serif\">Regulatory Compliance: Increasing regulatory\r\n     requirements, such as anti-money laundering (AML) and know your supplier\r\n     (KYC) laws, necessitate greater oversight and monitoring capabilities.\r\n     Procurement and supply teams must stay abreast of changing legal landscapes\r\n     and adapt their systems accordingly.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align:justify;mso-list:l0 level1 lfo1;\r\n     tab-stops:list 36.0pt\"><span style=\"font-size:12.0pt;line-height:107%;\r\n     font-family:&quot;Poppins&quot;,serif\">Talent Retention: Attracting and retaining\r\n     top data science talent is critical for long-term success in leveraging\r\n     big data in procurement and supply. Offering competitive compensation\r\n     packages, fostering a collaborative work environment, and providing opportunities\r\n     for professional growth will help organizations build and maintain a\r\n     strong team.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align:justify;mso-list:l0 level1 lfo1;\r\n     tab-stops:list 36.0pt\"><span style=\"font-size:12.0pt;line-height:107%;\r\n     font-family:&quot;Poppins&quot;,serif\">Continuous Learning Culture: The rapid pace\r\n     of technological advancements demands a culture of continuous learning and\r\n     adaptation within procurement and supply organizations. Encouraging\r\n     experimentation, sharing best practices, and investing in upskilling\r\n     initiatives will help teams stay ahead of the curve.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\" style=\"text-align:justify;mso-list:l0 level1 lfo1;\r\n     tab-stops:list 36.0pt\"><span style=\"font-size:12.0pt;line-height:107%;\r\n     font-family:&quot;Poppins&quot;,serif\">Stakeholder Buy-in: Securing buy-in from all\r\n     levels of the organization, including senior leadership and end-users, is\r\n     crucial for successful implementation of big data strategies. Effective\r\n     communication, demonstrating tangible benefits, and involving stakeholders\r\n     throughout the process will help garner support and ensure lasting\r\n     adoption.<o:p></o:p></span></li>\r\n</ol><p class=\"MsoNormal\" style=\"text-align:justify\"><span style=\"font-size:12.0pt;\r\nline-height:107%;font-family:&quot;Poppins&quot;,serif\">By understanding these\r\nchallenges, procurement and supply professionals can better prepare themselves\r\nto tackle the complexities of managing big data and leverage its full potential\r\nto drive innovation, efficiency, and sustainable growth.<o:p></o:p></span></p><p class=\"MsoNormal\" style=\"text-align:justify\"><span style=\"font-size:12.0pt;\r\nline-height:107%;font-family:&quot;Poppins&quot;,serif\">&nbsp;</span></p><p>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n</p><p class=\"MsoNormal\" style=\"text-align:justify\"><span style=\"font-size:12.0pt;\r\nline-height:107%;font-family:&quot;Poppins&quot;,serif\">&nbsp;</span></p>', 'Big Data has revolutionized\r\nvarious industries, including procurement and supply chain management. However,\r\nas the volume, variety, and velocity of...', 9, 1, 'published', NULL, '2025-11-10 11:15:37', '2025-11-10 11:15:37', 'Clite Mutale (BBA, MBA, MCIPS)'),
(21, 'Animal Food Safety and Hygiene Management', 'animal-food-safety-and-hygiene-management', '<p><br></p><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">This lesson focuses on ensuring safe food handling and\r\nmaintaining strict hygiene standards. The lesson objective include to\r\nunderstand: <o:p></o:p></span></p><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">•&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Principles of\r\nfood safety and hygiene <o:p></o:p></span></p><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">•&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Food handling\r\nprocedures <o:p></o:p></span></p><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">•&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Hygiene\r\nstandards and regulations <o:p></o:p></span></p><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">•&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HACCP (Hazard\r\nAnalysis and Critical Control Points) <o:p></o:p></span></p><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">•&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Personal\r\nhygiene for staff <o:p></o:p></span></p><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n</span></p><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">•&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Cleaning and\r\nsanitation protocols<o:p></o:p></span></p><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">Ensuring the safety and hygiene of crocodile feed is a\r\ncritical component of effective animal care, particularly in farming or\r\ncommercial settings. This process involves systematic approaches to mitigate\r\nbiological, physical, and chemical hazards, aligning with internationally\r\nrecognized food safety protocols like Hazard Analysis and Critical Control\r\nPoints (HACCP). Below is a detailed analysis of key aspects related to\r\ncrocodile feed safety and hygiene management:<o:p></o:p></span></p><p class=\"MsoNormal\"><b><span style=\"font-size:10.0pt;line-height:107%;\r\nfont-family:&quot;Poppins&quot;,serif\">Principles of Food Safety and Hygiene<o:p></o:p></span></b></p><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">Food safety and hygiene for crocodile feed emphasize\r\nsystematic control of contamination risks to protect both animal health and\r\nproduct integrity. Key principles include:<o:p></o:p></span></p><ol style=\"margin-top:0cm\" start=\"1\" type=\"1\">\r\n <li class=\"MsoNormal\"><b><span style=\"font-size:\r\n     10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Preventing\r\n     Contamination:</span></b><span style=\"font-size:10.0pt;line-height:107%;\r\n     font-family:&quot;Poppins&quot;,serif\"> This involves identifying potential sources\r\n     of biological (e.g., pathogens), chemical (e.g., pesticide residues), and\r\n     physical hazards (e.g., foreign objects).<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><b><span style=\"font-size:\r\n     10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Cross-Contamination\r\n     Prevention: </span></b><span style=\"font-size:10.0pt;line-height:107%;\r\n     font-family:&quot;Poppins&quot;,serif\">Ensuring raw and processed materials are kept\r\n     separate during storage and preparation.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><b><span style=\"font-size:\r\n     10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Temperature Control:</span></b><span style=\"font-size:10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">\r\n     Maintaining appropriate temperatures during storage, transportation, and\r\n     feed preparation minimizes microorganism proliferation.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><b><span style=\"font-size:\r\n     10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Traceability:</span></b><span style=\"font-size:10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">\r\n     Employing robust tracking mechanisms to monitor the sourcing and\r\n     distribution of feed ingredients. Advanced techniques, like DNA-based\r\n     traceability markers used in cattle (Zhao et al., 2018), can be adapted\r\n     for reptilian feed systems.<o:p></o:p></span></li>\r\n</ol><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">&nbsp;</span></p><p class=\"MsoNormal\"><b><span style=\"font-size:10.0pt;line-height:107%;\r\nfont-family:&quot;Poppins&quot;,serif\">Food Handling Procedures<o:p></o:p></span></b></p><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">Proper food handling procedures are vital to minimize risks.\r\nSpecific protocols include:<o:p></o:p></span></p><ol style=\"margin-top:0cm\" start=\"1\" type=\"1\">\r\n <li class=\"MsoNormal\"><b><span style=\"font-size:\r\n     10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Raw Material\r\n     Selection</span></b><span style=\"font-size:10.0pt;line-height:107%;\r\n     font-family:&quot;Poppins&quot;,serif\">: Sources must be verified to be free from\r\n     contaminants like mycotoxins or harmful bacteria often associated with\r\n     feed ingredients (Paramithiotis et al., 2009)(Ghaemmaghami, 2024).<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><b><span style=\"font-size:\r\n     10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Storage Requirements</span></b><span style=\"font-size:10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">:\r\n     Feed must be stored in cool, dry environments to reduce spoilage risks,\r\n     with humidity monitored using tools like microfluidics-based detection\r\n     systems (Jyothish et al., 2024).<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><b><span style=\"font-size:\r\n     10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Preparation Practices</span></b><span style=\"font-size:10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">: Processing\r\n     (e.g., grinding, mixing) should follow procedures designed to avoid\r\n     contamination. For instance, ultrasound cleaning and other advanced\r\n     techniques can be applied to sterilize preparation devices (Chemat &amp;\r\n     Hoarau, 2004).<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><b><span style=\"font-size:\r\n     10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Employee Training:</span></b><span style=\"font-size:10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\"> Staff\r\n     should be properly trained in techniques such as avoiding bare-hand\r\n     contact with feed and using sanitized tools.<o:p></o:p></span></li>\r\n</ol><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">&nbsp;</span></p><p class=\"MsoNormal\"><b><span style=\"font-size:10.0pt;line-height:107%;\r\nfont-family:&quot;Poppins&quot;,serif\">Hygiene Standards and Regulations<o:p></o:p></span></b></p><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">Regulations for crocodile feed safety often align with global\r\nframeworks governing animal feed. These include:<o:p></o:p></span></p><ol style=\"margin-top:0cm\" start=\"1\" type=\"1\">\r\n <li class=\"MsoNormal\"><span style=\"font-size:\r\n     10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Good Manufacturing\r\n     Practices (GMP):** Ensures that all processes, from sourcing to final\r\n     preparation, meet predefined quality and safety benchmarks (Laktičová et\r\n     al., 2020).<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:\r\n     10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">**ISO 22000:** A\r\n     standard for food safety management systems applicable to feed production,\r\n     including the establishment of critical control points (Nguyen et al.,\r\n     2024).<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:\r\n     10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Specific Animal Feed\r\n     Legislation:** In some jurisdictions, specialized rules ensure feed\r\n     formulations are toxin- and pathogen-free to avoid bioaccumulation in\r\n     crocodilian meat.<o:p></o:p></span></li>\r\n</ol><p class=\"MsoNormal\" style=\"margin-left:36.0pt\"><span style=\"font-size:10.0pt;\r\nline-height:107%;font-family:&quot;Poppins&quot;,serif\">Government inspection routines\r\nand international harmonization of standards play crucial roles in enforcing\r\ncompliance and ensuring feed safety across global trade chains.<o:p></o:p></span></p><p class=\"MsoNormal\"><b><span style=\"font-size:10.0pt;line-height:107%;\r\nfont-family:&quot;Poppins&quot;,serif\">HACCP (Hazard Analysis and Critical Control\r\nPoints)<o:p></o:p></span></b></p><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">The HACCP system provides a structured framework to identify\r\nand control hazards in crocodile feed production. Applying HACCP involves:<o:p></o:p></span></p><ol style=\"margin-top:0cm\" start=\"1\" type=\"1\">\r\n <li class=\"MsoNormal\"><span style=\"font-size:\r\n     10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Hazard Analysis:\r\n     Identifying potential risks, such as Salmonella or aflatoxin contamination\r\n     (Zhang, 2012)(Ngure et al., 2024).<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:\r\n     10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Critical Control\r\n     Points (CCPs): These include storage conditions or blending practices,\r\n     where contamination risks are highest and must be controlled effectively.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:\r\n     10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Monitoring\r\n     Procedures: For example, checking aflatoxin levels in feedstock and\r\n     maintaining real-time temperature logs during feed storage (Ngure et al.,\r\n     2024).<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:\r\n     10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Corrective Actions:\r\n     Establishing guidelines for handling non-compliance, such as rejecting\r\n     contaminated batches or re-processing feed.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:\r\n     10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Documentation:\r\n     Keeping detailed records for audits and traceability.<o:p></o:p></span></li>\r\n</ol><p class=\"MsoNormal\"><b><span style=\"font-size:10.0pt;line-height:107%;\r\nfont-family:&quot;Poppins&quot;,serif\">&nbsp;Personal\r\nHygiene for Staff<o:p></o:p></span></b></p><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">Staff adherence to strict hygiene protocols ensures that\r\nhandlers do not inadvertently introduce contaminants into the feed. Key\r\nmeasures include:<o:p></o:p></span></p><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">&nbsp;</span></p><ol style=\"margin-top:0cm\" start=\"1\" type=\"1\">\r\n <li class=\"MsoNormal\"><span style=\"font-size:\r\n     10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Handwashing: Using\r\n     antimicrobial soaps before and after handling feed materials reduces risks\r\n     of contamination.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:\r\n     10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Protective Clothing:\r\n     Such as gloves, aprons, and masks to prevent direct contact with feed.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:\r\n     10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Health Screening:\r\n     Regular checks of staff health, with exclusion of workers displaying\r\n     symptoms of infection or illness.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:\r\n     10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Training Programs:\r\n     Frequent educational modules on best practices in feed hygiene and\r\n     contamination prevention reinforce adherence.<o:p></o:p></span></li>\r\n</ol><p class=\"MsoNormal\"><b><span style=\"font-size:10.0pt;line-height:107%;\r\nfont-family:&quot;Poppins&quot;,serif\">Cleaning and Sanitation Protocols<o:p></o:p></span></b></p><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">Routine cleaning and sanitation measures are crucial for\r\nmaintaining hygienic environments during feed preparation and storage.\r\nEffective strategies include:<o:p></o:p></span></p><ol style=\"margin-top:0cm\" start=\"1\" type=\"1\">\r\n <li class=\"MsoNormal\"><span style=\"font-size:\r\n     10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Daily Cleaning\r\n     Routines: Food contact surfaces, preparation areas, and utensils should be\r\n     disinfected daily using safe, highly effective agents that do not leave\r\n     residues harmful to reptiles or feed integrity.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:\r\n     10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Deep Cleaning Cycles:\r\n     Periodic thorough cleaning of storage areas, vehicles, and processing\r\n     equipment minimizes long-term accumulation of pathogens.<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:\r\n     10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Design of Facilities:\r\n     Smooth, non-porous food-contact surfaces reduce microbial adherence and\r\n     simplify cleaning efforts. Employing smart sensors or HACCP-integrated\r\n     monitoring tools can further ensure sanitation effectiveness (Wallace,\r\n     2024)(Beumer et al., 1994).<o:p></o:p></span></li>\r\n <li class=\"MsoNormal\"><span style=\"font-size:\r\n     10.0pt;line-height:107%;font-family:&quot;Poppins&quot;,serif\">Biofilm Management:\r\n     Since biofilms can harbor resistant pathogens, advanced cleaning methods\r\n     (e.g., enzymatic cleaners or phage-based treatments) should be\r\n     incorporated where necessary (Ranveer et al., 2024).<o:p></o:p></span></li>\r\n</ol><p class=\"MsoNormal\"><b><span style=\"font-size:10.0pt;line-height:107%;\r\nfont-family:&quot;Poppins&quot;,serif\">Conclusion<o:p></o:p></span></b></p><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">Comprehensive management of crocodile feed safety and hygiene\r\ndemands the implementation of structured protocols such as HACCP and adherence\r\nto international best practices. Additional attention to staff training,\r\ncleaning processes, and regulatory compliance will further reduce risks,\r\npromote animal health, and ensure the sustainable production of crocodile\r\nproducts.<o:p></o:p></span></p><p class=\"MsoNormal\"><b><span style=\"font-size:10.0pt;line-height:107%;\r\nfont-family:&quot;Poppins&quot;,serif\">References <o:p></o:p></span></b></p><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">Zhao, J., Li, T., Xu, Z., Wang, Z., Yang, S., &amp; Chen, A.\r\n(2018). AFLP markers for meat traceability of cattle in the Chinese\r\nmarket.&nbsp;<i>Food Control</i>,&nbsp;<i>91</i>, 421–426. <a href=\"https://doi.org/10.1016/j.foodcont.2018.04.022\">https://doi.org/10.1016/j.foodcont.2018.04.022</a><o:p></o:p></span></p><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">Paramithiotis, S., Pappa, A. M., Drosinos, E. H., &amp;\r\nZoiopoulos, P. E. (2009). Microbiological, physico-chemical and safety\r\nparameters of cereal-based animal diets.&nbsp;<i>Quality Assurance and Safety\r\nof Crops &amp;amp; Foods</i>,&nbsp;<i>1</i>(3), 170–178. <a href=\"https://doi.org/10.1111/j.1757-837x.2009.00028.x\">https://doi.org/10.1111/j.1757-837x.2009.00028.x</a><o:p></o:p></span></p><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">Ghaemmaghami, S. S. (2024). A glance of feed hygiene and\r\nimportance of mycotoxins in poultry feedstuffs.&nbsp;<i>World’s Poultry Science\r\nJournal</i>,&nbsp;<i>80</i>(4), 1009–1015. <a href=\"https://doi.org/10.1080/00439339.2024.2384866\">https://doi.org/10.1080/00439339.2024.2384866</a><o:p></o:p></span></p><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">Jyothish, L., Kazi, S., &amp; Gokhale, J. S. (2024).\r\nMicrofluidics for detection of food pathogens: recent trends and\r\nopportunities.&nbsp;<i>Journal of Food Science and Technology</i>,&nbsp;<i>61</i>(12),\r\n2243–2262. <a href=\"https://doi.org/10.1007/s13197-024-06058-1\">https://doi.org/10.1007/s13197-024-06058-1</a><o:p></o:p></span></p><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">Chemat, F., &amp; Hoarau, N. (2004). Hazard analysis and\r\ncritical control point (HACCP) for an ultrasound food processing\r\noperation.&nbsp;<i>Ultrasonics Sonochemistry</i>,&nbsp;<i>11</i>(3–4), 257–260.\r\n<a href=\"https://doi.org/10.1016/j.ultsonch.2004.01.016\">https://doi.org/10.1016/j.ultsonch.2004.01.016</a><o:p></o:p></span></p><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">Veszelits Laktičová, K., Vargová, M., Sasáková, N., &amp; Zigo,\r\nF. (2020). Assessment of the Hygiene Level in the Dairy Processing Plant.&nbsp;<i>Asian\r\nJournal of Agriculture and Food Sciences</i>,&nbsp;<i>8</i>(6). <a href=\"https://doi.org/10.24203/ajafs.v8i6.6438\">https://doi.org/10.24203/ajafs.v8i6.6438</a><o:p></o:p></span></p><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">Zhang, W. (2012).&nbsp;<i>Application of HACCP in the Food\r\nSafety System During Important Missions for the Armed Police Forces</i>.<o:p></o:p></span></p><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">Wallace, C. A. (2024). Food Safety Assurance Systems Hazard\r\nAnalysis and Critical Control Point System (HACCP): Principles and Practice.\r\nIn&nbsp;<i>Encyclopedia of Food Safety</i>&nbsp;(pp. 91–108). Elsevier. <a href=\"https://doi.org/10.1016/b978-0-12-822521-9.00226-4\">https://doi.org/10.1016/b978-0-12-822521-9.00226-4</a><o:p></o:p></span></p><p>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n</p><p class=\"MsoNormal\"><span style=\"font-size:10.0pt;line-height:107%;font-family:\r\n&quot;Poppins&quot;,serif\">&nbsp;</span></p>', 'This lesson focuses on ensuring safe food handling and\r\nmaintaining strict hygiene standards. The lesson objective include to\r\nunderstand: •&nbsp;&n...', 6, 1, 'published', NULL, '2025-11-12 00:01:27', '2026-03-16 14:37:09', 'Clite Mutale (BBA, MBA, MCIPS)');

-- --------------------------------------------------------

--
-- Table structure for table `questions`
--

CREATE TABLE `questions` (
  `id` int(11) NOT NULL,
  `title` varchar(500) NOT NULL,
  `content` longtext NOT NULL,
  `question_type` enum('mcq_single','mcq_multiple','true_false','essay','short_answer','matching','code','fill_blanks') NOT NULL,
  `difficulty` enum('easy','medium','hard') DEFAULT 'medium',
  `points` decimal(5,2) DEFAULT 1.00,
  `time_limit` int(11) DEFAULT NULL,
  `category_id` int(11) DEFAULT NULL,
  `course_id` int(11) DEFAULT NULL,
  `instructor_id` int(11) NOT NULL,
  `tags` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`tags`)),
  `explanation` text DEFAULT NULL,
  `hints` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`hints`)),
  `metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`metadata`)),
  `status` enum('draft','pending_review','approved','rejected','archived') DEFAULT 'draft',
  `review_status` enum('not_submitted','pending','approved','needs_revision') DEFAULT 'not_submitted',
  `usage_count` int(11) DEFAULT 0,
  `success_rate` decimal(5,2) DEFAULT 0.00,
  `is_shared` tinyint(1) DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `questions`
--

INSERT INTO `questions` (`id`, `title`, `content`, `question_type`, `difficulty`, `points`, `time_limit`, `category_id`, `course_id`, `instructor_id`, `tags`, `explanation`, `hints`, `metadata`, `status`, `review_status`, `usage_count`, `success_rate`, `is_shared`, `created_at`, `updated_at`) VALUES
(4, 'CIPS L4M4', '\"Supply chains can be found within three main industry sectors. Describe each of these sectors, provide examples of the activities within them, and explain how they work together to form a complete supply chain.\"', 'short_answer', 'medium', 25.00, NULL, 1, NULL, 5, NULL, 'Paris is the capital and most populous city of France', '[\"European country\",\"Famous landmarks\"]', '[]', 'draft', 'not_submitted', 0, 0.00, 1, '2025-11-29 16:36:37', '2025-12-01 23:53:25'),
(29, 'What is the supply chain management', 'what is', 'essay', 'medium', 1.00, NULL, 9, NULL, 5, '[]', '', '[]', '[]', 'approved', 'approved', 0, 0.00, 1, '2025-11-30 04:21:13', '2025-12-01 23:53:25'),
(30, 'What is PHP?', 'PHP is a server-side scripting language used for web development.', 'mcq_single', 'easy', 1.00, NULL, 7, NULL, 1, NULL, 'PHP stands for PHP: Hypertext Preprocessor', '[\"Server-side\",\"Scripting\",\"Web development\"]', NULL, 'approved', 'approved', 0, 0.00, 1, '2025-12-01 14:44:22', '2025-12-01 15:21:37'),
(31, 'What does HTML stand for?', 'HTML stands for [blank].', 'fill_blanks', 'easy', 1.00, NULL, 8, NULL, 1, NULL, 'HyperText Markup Language', '[\"HyperText\",\"Markup\",\"Language\"]', NULL, 'approved', 'approved', 0, 0.00, 1, '2025-12-01 14:44:23', '2025-12-01 15:21:37'),
(32, 'What is clite', 'Select all that apply:', 'mcq_multiple', 'medium', 2.00, NULL, 7, NULL, 1, NULL, 'Multiple programming languages were listed', '[\"Look for languages used for software development\"]', '{\"options\":[\"Python\",\"JavaScript\",\"HTML\",\"CSS\",\"Java\"],\"correct_options\":[\"0\",\"4\"]}', 'approved', 'approved', 0, 0.00, 1, '2025-12-01 14:44:23', '2025-12-28 01:50:50'),
(33, 'What is the capital of France?', 'What is the capital city of France?', 'short_answer', 'easy', 1.00, NULL, 9, NULL, 1, NULL, 'Paris is the capital and most populous city of France', '[\"European country\",\"Famous landmarks\"]', NULL, 'approved', 'approved', 0, 0.00, 1, '2025-12-01 14:44:23', '2025-12-01 15:21:37'),
(34, 'Match the HTTP status codes:', 'Match the status codes with their meanings:', 'matching', 'medium', 3.00, NULL, 8, NULL, 1, NULL, 'HTTP status codes indicate the result of an HTTP request', '[\"200 OK\",\"404 Not Found\",\"500 Internal Server Error\"]', NULL, 'approved', 'approved', 0, 0.00, 1, '2025-12-01 14:44:23', '2025-12-01 15:21:37'),
(35, 'Write a function to calculate factorial', 'Write a recursive function in JavaScript that calculates the factorial of a number.', 'code', 'hard', 5.00, NULL, 7, NULL, 1, NULL, 'Factorial of n is n * (n-1) * ... * 1', '[\"Recursion\",\"Base case\",\"Mathematical function\"]', NULL, 'approved', 'approved', 0, 0.00, 1, '2025-12-01 14:44:23', '2025-12-01 15:21:37'),
(36, 'Is PHP case-sensitive?', 'True or False: PHP is a case-sensitive programming language.', 'true_false', 'medium', 1.00, NULL, 7, NULL, 1, NULL, 'PHP is not case-sensitive for variable names but is for function names', '[\"Variable names\",\"Function names\",\"Case sensitivity\"]', NULL, 'approved', 'approved', 0, 0.00, 1, '2025-12-01 14:44:23', '2025-12-01 15:21:37'),
(37, 'Identify one inventory risk', 'Identify one inventory risk', 'mcq_single', 'medium', 1.00, NULL, 8, NULL, 5, '[]', '', '[]', '{\"options\":[\"Theft\",\"House\",\"rest\",\"human\"],\"correct_options\":[\"0\"]}', 'approved', 'approved', 0, 0.00, 0, '2025-12-11 10:26:43', '2025-12-11 10:34:50'),
(38, 'Which of the following are characteristics of a warehouse?', 'Which of the following are characteristics of a warehouse?', 'mcq_multiple', 'medium', 1.00, NULL, 7, NULL, 5, '[]', '', '[]', '{\"options\":[\"1\",\"2\",\"3\",\"mic\"],\"correct_options\":[\"0\",\"1\"]}', 'approved', 'approved', 0, 0.00, 0, '2025-12-11 10:29:06', '2025-12-28 01:56:15'),
(39, 'What is Nash', 'Which of the following are characteristics of a warehouse?\r\n1. A local storage facility for serving immediate requirements\r\n2. Small in size\r\n3. Not connected to manufacturing or retailing \r\n4. A large scale storage facility', 'matching', 'medium', 1.00, NULL, 7, NULL, 5, '[]', '', '[]', '{\"matching_pairs\":{\"Theft\":\"Avoid\",\"Fire\":\"Transfer\",\"loss\":\"mitigate\"}}', 'approved', 'approved', 0, 0.00, 1, '2025-12-11 10:32:18', '2025-12-28 03:03:59'),
(40, 'Which of the following are programming languages?', 'Select all that apply:', 'mcq_multiple', 'medium', 2.00, NULL, 7, NULL, 1, NULL, 'Multiple programming languages were listed', '[\"Look for languages used for software development\"]', NULL, 'approved', 'approved', 0, 0.00, 1, '2026-01-03 02:50:01', '2026-01-03 02:50:01'),
(41, 'Analyse the key factors that influence the individual behaviour.', '<p>use the relevant examples</p>', 'essay', 'medium', 25.00, NULL, 7, NULL, 5, '[]', '', '[]', '[]', 'draft', 'not_submitted', 0, 0.00, 0, '2026-02-27 18:01:53', '2026-02-27 18:02:46'),
(42, 'What is the strategic supply chain managemeny', '<p>use practical examples</p>', 'essay', 'medium', 25.00, NULL, 7, NULL, 5, '[]', '', '[]', '[]', 'draft', 'not_submitted', 0, 0.00, 0, '2026-03-01 04:08:12', '2026-03-01 05:20:52'),
(43, 'What is logistical efficiency', '<p>explain using examples</p>', 'essay', 'medium', 25.00, NULL, 7, NULL, 5, '[]', '', '[]', '[]', 'draft', 'not_submitted', 0, 0.00, 0, '2026-03-01 13:59:40', '2026-03-01 13:59:40');

-- --------------------------------------------------------

--
-- Table structure for table `question_analytics`
--

CREATE TABLE `question_analytics` (
  `id` int(11) NOT NULL,
  `question_id` int(11) NOT NULL,
  `exam_id` int(11) DEFAULT NULL,
  `course_id` int(11) DEFAULT NULL,
  `date` date NOT NULL,
  `times_used` int(11) DEFAULT 0,
  `correct_answers` int(11) DEFAULT 0,
  `incorrect_answers` int(11) DEFAULT 0,
  `average_time` int(11) DEFAULT 0,
  `difficulty_rating` decimal(3,2) DEFAULT 0.00,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `question_analytics`
--

INSERT INTO `question_analytics` (`id`, `question_id`, `exam_id`, `course_id`, `date`, `times_used`, `correct_answers`, `incorrect_answers`, `average_time`, `difficulty_rating`, `created_at`) VALUES
(1, 4, 11, NULL, '2026-01-05', 2, 0, 2, 0, 0.00, '2026-01-05 00:09:05'),
(2, 29, 11, NULL, '2026-01-05', 2, 0, 2, 0, 0.00, '2026-01-05 00:09:05'),
(3, 33, 11, NULL, '2026-01-05', 2, 0, 2, 0, 0.00, '2026-01-05 00:09:05'),
(15, 37, 2, NULL, '2026-01-07', 1, 0, 1, 0, 0.00, '2026-01-07 14:02:45'),
(16, 38, 2, NULL, '2026-01-07', 1, 0, 1, 0, 0.00, '2026-01-07 14:02:45'),
(17, 39, 2, NULL, '2026-01-07', 1, 0, 1, 0, 0.00, '2026-01-07 14:02:45'),
(18, 29, 13, NULL, '2026-03-01', 2, 0, 2, 0, 0.00, '2026-03-01 14:41:55'),
(19, 41, 13, NULL, '2026-03-01', 2, 0, 2, 0, 0.00, '2026-03-01 14:41:55'),
(20, 42, 13, NULL, '2026-03-01', 2, 0, 2, 0, 0.00, '2026-03-01 14:41:55'),
(21, 43, 13, NULL, '2026-03-01', 2, 0, 2, 0, 0.00, '2026-03-01 14:41:55'),
(26, 37, 2, NULL, '2026-03-01', 1, 0, 1, 0, 0.00, '2026-03-01 18:02:09'),
(27, 38, 2, NULL, '2026-03-01', 1, 0, 1, 0, 0.00, '2026-03-01 18:02:09'),
(28, 39, 2, NULL, '2026-03-01', 1, 0, 1, 0, 0.00, '2026-03-01 18:02:09'),
(29, 41, 12, NULL, '2026-03-04', 1, 0, 1, 0, 0.00, '2026-03-03 22:30:01'),
(30, 42, 12, NULL, '2026-03-04', 1, 0, 1, 0, 0.00, '2026-03-03 22:30:01'),
(31, 37, 2, NULL, '2026-03-04', 2, 0, 2, 0, 0.00, '2026-03-03 22:36:49'),
(32, 38, 2, NULL, '2026-03-04', 2, 0, 2, 0, 0.00, '2026-03-03 22:36:49'),
(33, 39, 2, NULL, '2026-03-04', 2, 0, 2, 0, 0.00, '2026-03-03 22:36:49'),
(37, 29, 13, NULL, '2026-03-06', 2, 0, 2, 0, 0.00, '2026-03-05 22:16:07'),
(38, 41, 13, NULL, '2026-03-06', 2, 0, 2, 0, 0.00, '2026-03-05 22:16:07'),
(39, 42, 13, NULL, '2026-03-06', 2, 0, 2, 0, 0.00, '2026-03-05 22:16:07'),
(40, 43, 13, NULL, '2026-03-06', 2, 0, 2, 0, 0.00, '2026-03-05 22:16:07'),
(45, 29, 13, NULL, '2026-03-07', 11, 0, 11, 0, 0.00, '2026-03-07 03:12:32'),
(46, 41, 13, NULL, '2026-03-07', 11, 0, 11, 0, 0.00, '2026-03-07 03:12:32'),
(47, 42, 13, NULL, '2026-03-07', 11, 0, 11, 0, 0.00, '2026-03-07 03:12:32'),
(48, 43, 13, NULL, '2026-03-07', 11, 0, 11, 0, 0.00, '2026-03-07 03:12:32'),
(85, 41, 12, NULL, '2026-03-07', 1, 0, 1, 0, 0.00, '2026-03-07 12:11:37'),
(86, 42, 12, NULL, '2026-03-07', 1, 0, 1, 0, 0.00, '2026-03-07 12:11:37'),
(91, 41, 14, NULL, '2026-03-07', 6, 0, 6, 0, 0.00, '2026-03-07 12:48:02'),
(92, 42, 14, NULL, '2026-03-07', 6, 0, 6, 0, 0.00, '2026-03-07 12:48:02'),
(93, 43, 14, NULL, '2026-03-07', 6, 0, 6, 0, 0.00, '2026-03-07 12:48:02'),
(109, 41, 14, NULL, '2026-03-09', 3, 0, 3, 0, 0.00, '2026-03-09 00:07:46'),
(110, 42, 14, NULL, '2026-03-09', 3, 0, 3, 0, 0.00, '2026-03-09 00:07:46'),
(111, 43, 14, NULL, '2026-03-09', 3, 0, 3, 0, 0.00, '2026-03-09 00:07:46'),
(118, 37, 2, NULL, '2026-03-09', 1, 1, 0, 0, 0.00, '2026-03-09 05:23:11'),
(119, 38, 2, NULL, '2026-03-09', 1, 0, 1, 0, 0.00, '2026-03-09 05:23:11'),
(120, 39, 2, NULL, '2026-03-09', 1, 0, 1, 0, 0.00, '2026-03-09 05:23:11'),
(121, 41, 12, NULL, '2026-03-09', 1, 0, 1, 0, 0.00, '2026-03-09 05:26:33'),
(122, 42, 12, NULL, '2026-03-09', 1, 0, 1, 0, 0.00, '2026-03-09 05:26:33'),
(123, 41, 14, NULL, '2026-03-10', 1, 0, 1, 0, 0.00, '2026-03-10 03:51:13'),
(124, 42, 14, NULL, '2026-03-10', 1, 0, 1, 0, 0.00, '2026-03-10 03:51:13'),
(125, 43, 14, NULL, '2026-03-10', 1, 0, 1, 0, 0.00, '2026-03-10 03:51:13');

-- --------------------------------------------------------

--
-- Table structure for table `question_categories`
--

CREATE TABLE `question_categories` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `slug` varchar(100) NOT NULL,
  `description` text DEFAULT NULL,
  `parent_id` int(11) DEFAULT NULL,
  `color` varchar(20) DEFAULT '#007bff',
  `is_active` tinyint(1) DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `question_categories`
--

INSERT INTO `question_categories` (`id`, `name`, `slug`, `description`, `parent_id`, `color`, `is_active`, `created_at`, `updated_at`) VALUES
(1, 'LO 4.1.1', 'lo-411', NULL, NULL, '#007bff', 1, '2025-11-29 16:36:37', '2025-11-29 16:36:37'),
(2, 'LO 4.1.2', 'lo-412', NULL, NULL, '#007bff', 1, '2025-11-29 16:36:37', '2025-11-29 16:36:37'),
(3, 'LO 4.1.3', 'lo-413', NULL, NULL, '#007bff', 1, '2025-11-29 16:36:37', '2025-11-29 16:36:37'),
(4, 'LO 4.1.4', 'lo-414', NULL, NULL, '#007bff', 1, '2025-11-29 16:36:37', '2025-11-29 16:36:37'),
(5, 'LO: 4.1.5', 'lo-415', NULL, NULL, '#007bff', 1, '2025-11-29 16:36:37', '2025-11-29 16:36:37'),
(6, 'LO: 4.1.6', 'lo-416', NULL, NULL, '#007bff', 1, '2025-11-29 16:36:37', '2025-11-29 16:36:37'),
(7, 'Programming', 'programming', NULL, NULL, '#007bff', 1, '2025-11-29 17:50:36', '2025-11-29 17:50:36'),
(8, 'Web Development', 'web-development', NULL, NULL, '#007bff', 1, '2025-11-29 17:50:36', '2025-11-29 17:50:36'),
(9, 'Geography', 'geography', NULL, NULL, '#007bff', 1, '2025-11-29 17:50:36', '2025-11-29 17:50:36');

-- --------------------------------------------------------

--
-- Table structure for table `question_options`
--

CREATE TABLE `question_options` (
  `id` int(11) NOT NULL,
  `question_id` int(11) NOT NULL,
  `option_text` longtext NOT NULL,
  `option_value` varchar(255) DEFAULT NULL,
  `match_value` varchar(255) DEFAULT NULL,
  `is_correct` tinyint(1) DEFAULT 0,
  `sort_order` int(11) DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `question_options`
--

INSERT INTO `question_options` (`id`, `question_id`, `option_text`, `option_value`, `match_value`, `is_correct`, `sort_order`, `created_at`) VALUES
(1, 30, 'PHP: Hypertext Preprocessor', NULL, NULL, 1, 0, '2025-12-01 14:44:22'),
(2, 30, 'Personal Home Page', NULL, NULL, 0, 1, '2025-12-01 14:44:22'),
(3, 30, 'Pre-Hypertext Processor', NULL, NULL, 0, 2, '2025-12-01 14:44:22'),
(4, 30, 'Public HTML Page', NULL, NULL, 0, 3, '2025-12-01 14:44:23'),
(10, 34, '200', 'OK', NULL, 0, 0, '2025-12-01 14:44:23'),
(11, 34, '404', 'Not Found', NULL, 0, 1, '2025-12-01 14:44:23'),
(12, 34, '500', 'Internal Server Error', NULL, 0, 2, '2025-12-01 14:44:23'),
(13, 36, 'True', NULL, NULL, 0, 0, '2025-12-01 14:44:23'),
(14, 36, 'False', NULL, NULL, 1, 1, '2025-12-01 14:44:23'),
(15, 37, 'Theft', NULL, NULL, 1, 0, '2025-12-11 10:26:43'),
(16, 37, 'House', NULL, NULL, 0, 1, '2025-12-11 10:26:43'),
(17, 37, 'rest', NULL, NULL, 0, 2, '2025-12-11 10:26:43'),
(18, 37, 'human', NULL, NULL, 0, 3, '2025-12-11 10:26:43'),
(32, 32, 'Python', NULL, NULL, 1, 0, '2025-12-28 01:50:50'),
(33, 32, 'JavaScript', NULL, NULL, 0, 1, '2025-12-28 01:50:50'),
(34, 32, 'HTML', NULL, NULL, 0, 2, '2025-12-28 01:50:50'),
(35, 32, 'CSS', NULL, NULL, 0, 3, '2025-12-28 01:50:50'),
(36, 32, 'Java', NULL, NULL, 1, 4, '2025-12-28 01:50:50'),
(44, 38, '1', NULL, NULL, 1, 0, '2025-12-28 01:56:15'),
(45, 38, '2', NULL, NULL, 1, 1, '2025-12-28 01:56:15'),
(46, 38, '3', NULL, NULL, 0, 2, '2025-12-28 01:56:15'),
(47, 38, 'mic', NULL, NULL, 0, 3, '2025-12-28 01:56:15'),
(48, 39, 'Theft', 'Avoid', NULL, 0, 0, '2025-12-28 03:04:00'),
(49, 39, 'Fire', 'Transfer', NULL, 0, 1, '2025-12-28 03:04:00'),
(50, 39, 'loss', 'mitigate', NULL, 0, 2, '2025-12-28 03:04:00'),
(51, 40, 'Python', NULL, NULL, 1, 0, '2026-01-03 02:50:01'),
(52, 40, 'JavaScript', NULL, NULL, 1, 1, '2026-01-03 02:50:01'),
(53, 40, 'HTML', NULL, NULL, 0, 2, '2026-01-03 02:50:01'),
(54, 40, 'CSS', NULL, NULL, 0, 3, '2026-01-03 02:50:01'),
(55, 40, 'Java', NULL, NULL, 1, 4, '2026-01-03 02:50:01');

-- --------------------------------------------------------

--
-- Table structure for table `question_reviews`
--

CREATE TABLE `question_reviews` (
  `id` int(11) NOT NULL,
  `question_id` int(11) NOT NULL,
  `reviewer_id` int(11) NOT NULL,
  `review_status` enum('approved','needs_revision','rejected') NOT NULL,
  `comments` text DEFAULT NULL,
  `reviewed_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `question_tags`
--

CREATE TABLE `question_tags` (
  `id` int(11) NOT NULL,
  `name` varchar(50) NOT NULL,
  `slug` varchar(50) NOT NULL,
  `color` varchar(20) DEFAULT '#6c757d',
  `description` text DEFAULT NULL,
  `usage_count` int(11) DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `question_tag_assignments`
--

CREATE TABLE `question_tag_assignments` (
  `question_id` int(11) NOT NULL,
  `tag_id` int(11) NOT NULL,
  `assigned_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `scorm_packages`
--

CREATE TABLE `scorm_packages` (
  `id` int(11) NOT NULL,
  `course_id` int(11) NOT NULL,
  `lesson_id` int(11) DEFAULT NULL,
  `package_name` varchar(255) NOT NULL,
  `package_path` varchar(500) NOT NULL,
  `manifest_path` varchar(500) DEFAULT NULL,
  `version` varchar(20) DEFAULT '1.2',
  `launch_url` varchar(500) DEFAULT NULL,
  `mastery_score` decimal(5,2) DEFAULT NULL,
  `max_time_allowed` int(11) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT 1,
  `created_by` int(11) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `site_settings`
--

CREATE TABLE `site_settings` (
  `id` int(11) NOT NULL,
  `setting_key` varchar(50) NOT NULL,
  `setting_value` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `site_settings`
--

INSERT INTO `site_settings` (`id`, `setting_key`, `setting_value`, `created_at`, `updated_at`) VALUES
(1, 'site_logo', 'assets/images/logo_1757657555.jpg', '2025-09-12 00:25:26', '2025-09-12 06:12:35'),
(2, 'site_name', 'Mutalex Academy', '2025-09-12 00:25:26', '2025-09-12 00:25:26'),
(8, 'slideshow_images', '[{\"url\":\"assets\\/images\\/slideshow\\/slide_1763200464_6576.png\",\"title\":\"\",\"description\":\"\",\"source\":\"upload\"}]', '2025-11-05 17:10:05', '2025-11-15 09:54:24'),
(25, 'welcome_title', 'Welcome to Mutalex Academy', '2026-03-20 04:30:38', '2026-03-20 04:30:38'),
(26, 'welcome_description', 'your premier hub for staying ahead in the professional world. We provide a curated blend of deep-dive articles,  scholarly journals tailored for a wide range of academic and professional courses.', '2026-03-20 04:30:38', '2026-03-20 04:30:38'),
(27, 'available_exams_title', 'Available Exams', '2026-03-20 05:04:28', '2026-03-20 05:04:28'),
(28, 'available_exams_subtitle', 'Test your knowledge with our comprehensive mock exam collection to assess your performance.', '2026-03-20 05:04:28', '2026-03-20 05:04:28'),
(29, 'knowledge_insight_title', 'Knowledge & Insight', '2026-03-20 05:04:28', '2026-03-20 05:04:28'),
(30, 'knowledge_insight_subtitle', 'Stay informed with our latest industrial news and articles', '2026-03-20 05:04:28', '2026-03-20 05:04:28');

-- --------------------------------------------------------

--
-- Table structure for table `student_answer`
--

CREATE TABLE `student_answer` (
  `answer_id` int(11) NOT NULL COMMENT 'Unique identifier for each answer',
  `student_id` int(11) NOT NULL COMMENT 'Foreign key to users table (students)',
  `exam_id` int(11) NOT NULL COMMENT 'Foreign key to exams table',
  `question_id` int(11) NOT NULL COMMENT 'Foreign key to questions table',
  `graded_by` int(11) DEFAULT NULL COMMENT 'Foreign key to users table (instructor who graded)',
  `answer_text` text DEFAULT NULL COMMENT 'Student written response for essay/short answer questions',
  `answer_choice` varchar(255) DEFAULT NULL COMMENT 'Selected choice for multiple choice questions',
  `is_correct` tinyint(1) DEFAULT NULL COMMENT 'Flag indicating if answer is correct',
  `score` decimal(10,2) DEFAULT NULL COMMENT 'Points earned for this answer',
  `feedback` text DEFAULT NULL COMMENT 'Instructor comments and feedback',
  `submitted_at` timestamp NULL DEFAULT NULL COMMENT 'When the answer was submitted',
  `graded_at` timestamp NULL DEFAULT NULL COMMENT 'When the answer was graded',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'Record creation timestamp',
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'Last update timestamp',
  `attempt_number` int(11) NOT NULL DEFAULT 1 COMMENT 'Which attempt this is for the student on this question',
  `time_spent_seconds` int(11) DEFAULT NULL COMMENT 'How long the student took to answer (in seconds)',
  `ip_address` varchar(45) DEFAULT NULL COMMENT 'IP address of the submission device',
  `status` enum('pending','in_progress','submitted','graded','needs_review','auto_graded','manually_graded','partially_graded','regraded','archived') NOT NULL DEFAULT 'pending' COMMENT 'Grading status: pending, in_progress, submitted, graded, needs_review'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Stores student submitted answers for exam questions with grading tracking';

--
-- Dumping data for table `student_answer`
--

INSERT INTO `student_answer` (`answer_id`, `student_id`, `exam_id`, `question_id`, `graded_by`, `answer_text`, `answer_choice`, `is_correct`, `score`, `feedback`, `submitted_at`, `graded_at`, `created_at`, `updated_at`, `attempt_number`, `time_spent_seconds`, `ip_address`, `status`) VALUES
(1, 4, 13, 29, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-03-13 01:44:43', '2026-03-13 01:44:43', 1, 0, '::1', 'in_progress'),
(2, 4, 13, 41, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-03-13 01:44:43', '2026-03-13 01:44:43', 1, 0, '::1', 'in_progress'),
(3, 4, 13, 42, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-03-13 01:44:43', '2026-03-13 01:44:43', 1, 0, '::1', 'in_progress'),
(4, 4, 13, 43, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-03-13 01:44:43', '2026-03-13 01:44:43', 1, 0, '::1', 'in_progress'),
(8, 4, 14, 41, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-03-13 02:19:12', '2026-03-13 02:19:12', 5, 0, '::1', 'in_progress'),
(9, 4, 14, 42, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-03-13 02:19:12', '2026-03-13 02:19:12', 5, 0, '::1', 'in_progress'),
(10, 4, 14, 43, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-03-13 02:19:12', '2026-03-13 02:19:12', 5, 0, '::1', 'in_progress');

--
-- Triggers `student_answer`
--
DELIMITER $$
CREATE TRIGGER `trg_student_answer_after_insert` AFTER INSERT ON `student_answer` FOR EACH ROW BEGIN
            IF NEW.submitted_at IS NULL AND NEW.status IN ('submitted', 'graded') THEN
                UPDATE student_answer
                SET submitted_at = NOW()
                WHERE answer_id = NEW.answer_id;
            END IF;
        END
$$
DELIMITER ;

-- --------------------------------------------------------

--
-- Table structure for table `student_answers`
--

CREATE TABLE `student_answers` (
  `id` int(11) NOT NULL,
  `exam_id` int(11) NOT NULL,
  `attempt_id` int(11) DEFAULT NULL,
  `student_id` int(11) NOT NULL,
  `question_id` int(11) NOT NULL,
  `answer_content` longtext NOT NULL,
  `answer_type` enum('text','json','numeric','boolean') DEFAULT 'text',
  `is_correct` tinyint(1) DEFAULT NULL,
  `score` decimal(10,2) DEFAULT NULL,
  `max_score` decimal(10,2) DEFAULT 0.00,
  `feedback` text DEFAULT NULL,
  `is_graded` tinyint(1) DEFAULT 0,
  `graded_by` int(11) DEFAULT NULL,
  `graded_at` timestamp NULL DEFAULT NULL,
  `grading_method` enum('auto','manual','ai') DEFAULT 'auto',
  `version_number` int(11) DEFAULT 1,
  `previous_answer_id` int(11) DEFAULT NULL,
  `time_spent_seconds` int(11) DEFAULT 0,
  `ip_address` varchar(45) DEFAULT NULL,
  `browser_info` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`browser_info`)),
  `started_at` timestamp NULL DEFAULT NULL,
  `submitted_at` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp(),
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `status` enum('in_progress','saved','submitted','graded','reviewed','pending_manual_review') DEFAULT 'in_progress',
  `is_draft` tinyint(1) DEFAULT 1,
  `is_final` tinyint(1) DEFAULT 0,
  `answer_hash` varchar(64) DEFAULT NULL,
  `answer_length` int(11) DEFAULT 0,
  `word_count` int(11) DEFAULT 0,
  `char_count` int(11) DEFAULT 0,
  `first_save_at` timestamp NULL DEFAULT NULL,
  `last_save_at` timestamp NULL DEFAULT NULL,
  `save_count` int(11) DEFAULT 0,
  `is_flagged` tinyint(1) DEFAULT 0,
  `flagged_at` timestamp NULL DEFAULT NULL,
  `needs_review` tinyint(1) DEFAULT 0,
  `source` enum('web','mobile','api','import') DEFAULT 'web',
  `session_id` varchar(100) DEFAULT NULL,
  `device_info` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`device_info`)),
  `client_timezone` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `student_answers`
--

INSERT INTO `student_answers` (`id`, `exam_id`, `attempt_id`, `student_id`, `question_id`, `answer_content`, `answer_type`, `is_correct`, `score`, `max_score`, `feedback`, `is_graded`, `graded_by`, `graded_at`, `grading_method`, `version_number`, `previous_answer_id`, `time_spent_seconds`, `ip_address`, `browser_info`, `started_at`, `submitted_at`, `created_at`, `updated_at`, `status`, `is_draft`, `is_final`, `answer_hash`, `answer_length`, `word_count`, `char_count`, `first_save_at`, `last_save_at`, `save_count`, `is_flagged`, `flagged_at`, `needs_review`, `source`, `session_id`, `device_info`, `client_timezone`) VALUES
(15, 2, 10, 4, 37, '15', 'numeric', 1, 1.00, 1.00, NULL, 1, NULL, NULL, 'auto', 1, NULL, 27, NULL, NULL, NULL, '2026-03-09 05:23:11', '2026-03-09 05:12:53', '2026-03-09 05:23:11', 'submitted', 1, 1, NULL, 0, 0, 0, NULL, NULL, 0, 0, NULL, 0, 'web', NULL, NULL, NULL),
(16, 2, 10, 4, 38, '', 'text', 0, 0.00, 1.00, NULL, 1, NULL, NULL, 'auto', 1, NULL, 27, NULL, NULL, NULL, '2026-03-09 05:23:11', '2026-03-09 05:12:53', '2026-03-09 05:23:11', 'submitted', 1, 1, 'd41d8cd98f00b204e9800998ecf8427e', 0, 0, 0, NULL, NULL, 0, 0, NULL, 0, 'web', NULL, NULL, NULL),
(17, 2, 10, 4, 39, '{\"48\":\"48\",\"49\":\"48\",\"50\":\"50\"}', 'json', 0, 0.00, 1.00, NULL, 1, NULL, NULL, 'auto', 1, NULL, 27, NULL, NULL, NULL, '2026-03-09 05:23:11', '2026-03-09 05:12:53', '2026-03-09 05:23:11', 'submitted', 1, 1, '5c64fd0a2998d47db4c25d06b9d154d0', 31, 0, 0, NULL, NULL, 0, 0, NULL, 0, 'web', NULL, NULL, NULL),
(18, 2, 12, 4, 37, '15', 'text', NULL, NULL, 0.00, NULL, 0, NULL, NULL, 'auto', 1, NULL, 0, '127.0.0.1', '{\"user_agent\":\"Test Browser\"}', NULL, NULL, '2026-03-09 05:13:39', '2026-03-09 05:13:39', 'saved', 1, 0, NULL, 0, 0, 0, NULL, NULL, 0, 0, NULL, 0, 'web', NULL, NULL, NULL),
(19, 2, 12, 4, 38, 'Test answer', 'text', NULL, NULL, 0.00, NULL, 0, NULL, NULL, 'auto', 1, NULL, 0, '127.0.0.1', '{\"user_agent\":\"Test Browser\"}', NULL, NULL, '2026-03-09 05:13:39', '2026-03-09 05:13:39', 'saved', 1, 0, NULL, 0, 0, 0, NULL, NULL, 0, 0, NULL, 0, 'web', NULL, NULL, NULL),
(20, 2, 12, 4, 39, 'Test answer', 'text', NULL, NULL, 0.00, NULL, 0, NULL, NULL, 'auto', 1, NULL, 0, '127.0.0.1', '{\"user_agent\":\"Test Browser\"}', NULL, NULL, '2026-03-09 05:13:39', '2026-03-09 05:13:39', 'saved', 1, 0, NULL, 0, 0, 0, NULL, NULL, 0, 0, NULL, 0, 'web', NULL, NULL, NULL),
(21, 14, 3, 4, 43, '<p>great</p>', 'text', NULL, 0.00, 25.00, NULL, 0, NULL, NULL, 'manual', 1, NULL, 1324, '::1', '{\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/145.0.0.0 Safari\\/537.36\",\"accept_language\":\"en-US,en;q=0.9\"}', '2026-03-09 05:17:32', '2026-03-09 05:17:32', '2026-03-09 05:17:32', '2026-03-09 05:17:32', 'pending_manual_review', 0, 1, NULL, 0, 0, 0, NULL, NULL, 0, 0, NULL, 0, 'web', NULL, NULL, NULL),
(22, 14, 3, 4, 42, '<p>good gret</p>', 'text', NULL, 0.00, 25.00, NULL, 0, NULL, NULL, 'manual', 1, NULL, 1324, '::1', '{\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/145.0.0.0 Safari\\/537.36\",\"accept_language\":\"en-US,en;q=0.9\"}', '2026-03-09 05:17:32', '2026-03-09 05:17:32', '2026-03-09 05:17:32', '2026-03-09 05:17:32', 'pending_manual_review', 0, 1, NULL, 0, 0, 0, NULL, NULL, 0, 0, NULL, 0, 'web', NULL, NULL, NULL),
(23, 14, 3, 4, 41, '', 'text', 0, 0.00, 25.00, NULL, 1, NULL, NULL, 'auto', 1, NULL, 1324, '::1', '{\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/145.0.0.0 Safari\\/537.36\",\"accept_language\":\"en-US,en;q=0.9\"}', '2026-03-09 05:17:32', '2026-03-09 05:17:32', '2026-03-09 05:17:32', '2026-03-09 05:17:32', 'submitted', 0, 1, NULL, 0, 0, 0, NULL, NULL, 0, 0, NULL, 0, 'web', NULL, NULL, NULL),
(27, 12, 13, 4, 41, '<p>the issues of life</p>', 'text', NULL, 0.00, 25.00, NULL, 0, NULL, NULL, 'manual', 1, NULL, 34, '::1', '{\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/145.0.0.0 Safari\\/537.36\",\"accept_language\":\"en-US,en;q=0.9\"}', '2026-03-09 05:26:33', '2026-03-09 05:26:33', '2026-03-09 05:26:33', '2026-03-09 05:26:33', 'pending_manual_review', 0, 1, NULL, 0, 0, 0, NULL, NULL, 0, 0, NULL, 0, 'web', NULL, NULL, NULL),
(28, 12, 13, 4, 42, '', 'text', 0, 0.00, 25.00, NULL, 1, NULL, NULL, 'auto', 1, NULL, 34, '::1', '{\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/145.0.0.0 Safari\\/537.36\",\"accept_language\":\"en-US,en;q=0.9\"}', '2026-03-09 05:26:33', '2026-03-09 05:26:33', '2026-03-09 05:26:33', '2026-03-09 05:26:33', 'submitted', 0, 1, NULL, 0, 0, 0, NULL, NULL, 0, 0, NULL, 0, 'web', NULL, NULL, NULL),
(29, 14, 14, 4, 43, '<p>great news&nbsp;</p>', 'text', NULL, 0.00, 25.00, NULL, 0, NULL, NULL, 'manual', 1, NULL, 43, '::1', '{\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/145.0.0.0 Safari\\/537.36\",\"accept_language\":\"en-US,en;q=0.9\"}', '2026-03-10 03:51:13', '2026-03-10 03:51:13', '2026-03-10 03:51:13', '2026-03-10 03:51:13', 'pending_manual_review', 0, 1, NULL, 0, 0, 0, NULL, NULL, 0, 0, NULL, 0, 'web', NULL, NULL, NULL),
(30, 14, 14, 4, 42, '<p>welcoming&nbsp;</p>', 'text', NULL, 0.00, 25.00, NULL, 0, NULL, NULL, 'manual', 1, NULL, 43, '::1', '{\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/145.0.0.0 Safari\\/537.36\",\"accept_language\":\"en-US,en;q=0.9\"}', '2026-03-10 03:51:13', '2026-03-10 03:51:13', '2026-03-10 03:51:13', '2026-03-10 03:51:13', 'pending_manual_review', 0, 1, NULL, 0, 0, 0, NULL, NULL, 0, 0, NULL, 0, 'web', NULL, NULL, NULL),
(31, 14, 14, 4, 41, '', 'text', 0, 0.00, 25.00, NULL, 1, NULL, NULL, 'auto', 1, NULL, 43, '::1', '{\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/145.0.0.0 Safari\\/537.36\",\"accept_language\":\"en-US,en;q=0.9\"}', '2026-03-10 03:51:13', '2026-03-10 03:51:13', '2026-03-10 03:51:13', '2026-03-10 03:51:13', 'submitted', 0, 1, NULL, 0, 0, 0, NULL, NULL, 0, 0, NULL, 0, 'web', NULL, NULL, NULL);

--
-- Triggers `student_answers`
--
DELIMITER $$
CREATE TRIGGER `trg_before_answer_delete` BEFORE DELETE ON `student_answers` FOR EACH ROW BEGIN
                INSERT INTO student_answer_sync_log (answer_id, attempt_id, action, old_values, sync_status, synced_at)
                VALUES (
                    OLD.id, 
                    OLD.attempt_id, 
                    'delete',
                    JSON_OBJECT('exam_id', OLD.exam_id, 'question_id', OLD.question_id, 'student_id', OLD.student_id),
                    'completed',
                    NOW()
                );
            END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `trg_before_answer_update` BEFORE UPDATE ON `student_answers` FOR EACH ROW BEGIN
                IF OLD.answer_content != NEW.answer_content OR OLD.status != NEW.status THEN
                    INSERT INTO student_answer_sync_log (answer_id, attempt_id, action, old_values, new_values, sync_status, synced_at)
                    VALUES (
                        NEW.id, 
                        NEW.attempt_id, 
                        'update',
                        JSON_OBJECT('answer_content', LEFT(OLD.answer_content, 1000), 'status', OLD.status),
                        JSON_OBJECT('answer_content', LEFT(NEW.answer_content, 1000), 'status', NEW.status),
                        'completed',
                        NOW()
                    );
                END IF;
                
                IF OLD.answer_content != NEW.answer_content THEN
                    SET NEW.answer_hash = MD5(NEW.answer_content);
                    SET NEW.answer_length = CHAR_LENGTH(NEW.answer_content);
                END IF;
            END
$$
DELIMITER ;

-- --------------------------------------------------------

--
-- Table structure for table `student_answer_sync_log`
--

CREATE TABLE `student_answer_sync_log` (
  `id` int(11) NOT NULL,
  `answer_id` int(11) NOT NULL,
  `attempt_id` int(11) NOT NULL,
  `action` enum('create','update','delete','sync') NOT NULL,
  `old_values` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`old_values`)),
  `new_values` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`new_values`)),
  `sync_status` enum('pending','completed','failed') DEFAULT 'pending',
  `error_message` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `synced_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `student_answer_sync_log`
--

INSERT INTO `student_answer_sync_log` (`id`, `answer_id`, `attempt_id`, `action`, `old_values`, `new_values`, `sync_status`, `error_message`, `created_at`, `synced_at`) VALUES
(1, 1, 4, 'delete', '{\"exam_id\": 2, \"question_id\": 37, \"student_id\": 4}', NULL, 'completed', NULL, '2026-03-09 05:04:17', '2026-03-09 05:04:17'),
(2, 2, 4, 'delete', '{\"exam_id\": 2, \"question_id\": 38, \"student_id\": 4}', NULL, 'completed', NULL, '2026-03-09 05:04:17', '2026-03-09 05:04:17'),
(3, 3, 4, 'delete', '{\"exam_id\": 2, \"question_id\": 39, \"student_id\": 4}', NULL, 'completed', NULL, '2026-03-09 05:04:17', '2026-03-09 05:04:17'),
(4, 4, 5, 'delete', '{\"exam_id\": 2, \"question_id\": 37, \"student_id\": 4}', NULL, 'completed', NULL, '2026-03-09 05:04:44', '2026-03-09 05:04:44'),
(5, 5, 5, 'delete', '{\"exam_id\": 2, \"question_id\": 38, \"student_id\": 4}', NULL, 'completed', NULL, '2026-03-09 05:04:44', '2026-03-09 05:04:44'),
(6, 6, 5, 'delete', '{\"exam_id\": 2, \"question_id\": 39, \"student_id\": 4}', NULL, 'completed', NULL, '2026-03-09 05:04:44', '2026-03-09 05:04:44'),
(7, 7, 6, 'delete', '{\"exam_id\": 2, \"question_id\": 37, \"student_id\": 4}', NULL, 'completed', NULL, '2026-03-09 05:09:27', '2026-03-09 05:09:27'),
(8, 8, 6, 'delete', '{\"exam_id\": 2, \"question_id\": 38, \"student_id\": 4}', NULL, 'completed', NULL, '2026-03-09 05:09:27', '2026-03-09 05:09:27'),
(9, 9, 6, 'delete', '{\"exam_id\": 2, \"question_id\": 39, \"student_id\": 4}', NULL, 'completed', NULL, '2026-03-09 05:09:27', '2026-03-09 05:09:27'),
(10, 10, 7, 'delete', '{\"exam_id\": 2, \"question_id\": 37, \"student_id\": 4}', NULL, 'completed', NULL, '2026-03-09 05:10:46', '2026-03-09 05:10:46'),
(11, 11, 7, 'delete', '{\"exam_id\": 2, \"question_id\": 38, \"student_id\": 4}', NULL, 'completed', NULL, '2026-03-09 05:10:46', '2026-03-09 05:10:46'),
(12, 12, 7, 'delete', '{\"exam_id\": 2, \"question_id\": 39, \"student_id\": 4}', NULL, 'completed', NULL, '2026-03-09 05:10:46', '2026-03-09 05:10:46'),
(13, 13, 8, 'delete', '{\"exam_id\": 2, \"question_id\": 37, \"student_id\": 4}', NULL, 'completed', NULL, '2026-03-09 05:12:00', '2026-03-09 05:12:00'),
(14, 14, 9, 'delete', '{\"exam_id\": 2, \"question_id\": 37, \"student_id\": 4}', NULL, 'completed', NULL, '2026-03-09 05:12:53', '2026-03-09 05:12:53'),
(15, 17, 10, 'update', '{\"answer_content\": \"Test answer 39\", \"status\": \"saved\"}', '{\"answer_content\": \"{\\\"48\\\":\\\"48\\\",\\\"49\\\":\\\"48\\\",\\\"50\\\":\\\"50\\\"}\", \"status\": \"submitted\"}', 'completed', NULL, '2026-03-09 05:23:11', '2026-03-09 05:23:11'),
(16, 15, 10, 'update', '{\"answer_content\": \"15\", \"status\": \"saved\"}', '{\"answer_content\": \"15\", \"status\": \"submitted\"}', 'completed', NULL, '2026-03-09 05:23:11', '2026-03-09 05:23:11'),
(17, 16, 10, 'update', '{\"answer_content\": \"Test answer 38\", \"status\": \"saved\"}', '{\"answer_content\": \"\", \"status\": \"submitted\"}', 'completed', NULL, '2026-03-09 05:23:11', '2026-03-09 05:23:11');

-- --------------------------------------------------------

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `username` varchar(50) NOT NULL,
  `email` varchar(100) NOT NULL,
  `password` varchar(255) NOT NULL,
  `role` enum('admin','instructor','student','guest') DEFAULT 'student',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `email_verified` tinyint(1) DEFAULT 0,
  `email_verification_token` varchar(255) DEFAULT NULL,
  `password_reset_token` varchar(255) DEFAULT NULL,
  `password_reset_expires` timestamp NULL DEFAULT NULL,
  `last_login` timestamp NULL DEFAULT NULL,
  `failed_login_attempts` int(11) DEFAULT 0,
  `account_locked_until` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `username`, `email`, `password`, `role`, `created_at`, `email_verified`, `email_verification_token`, `password_reset_token`, `password_reset_expires`, `last_login`, `failed_login_attempts`, `account_locked_until`, `updated_at`) VALUES
(1, 'admin', 'admin@blog.com', '$2y$10$77V/RbCDGLWQtFDi30FYQ.i6aEh2Ed01EU.el8A7Mk6Vcia8IKTvS', 'admin', '2025-09-10 03:45:35', 0, NULL, NULL, NULL, NULL, 0, NULL, '2025-11-24 22:50:14'),
(4, 'Clarice', 'mutalexzw@gmail.com', '$2y$10$LvXsunDDQyyCt8MIXcJEq.oSlkDNYoZIqwbv2bUMtfvCLdg2zjJLu', 'student', '2025-11-24 22:48:51', 0, NULL, NULL, NULL, NULL, 0, NULL, '2025-11-24 22:50:14'),
(5, 'Instructor', 'admin@example.com', '$2y$10$XUAHYnK5cObmuywJ2HYExOsy31WK2SZln6a75aVdNvtWKtmJofx76', 'instructor', '2025-11-24 22:52:57', 0, NULL, NULL, NULL, NULL, 0, NULL, '2025-11-24 22:52:57'),
(6, 'Chipo', 'clitemuta@gmail.com', '$2y$10$ITk5XetN7Eay4wD9.zqwn.tecAkgrznC52Q/M/1V.JyFWtImx97Ie', 'student', '2025-11-25 13:56:16', 0, NULL, NULL, NULL, NULL, 0, NULL, '2025-11-25 13:56:16'),
(7, 'Clite', 'counter@example.com', '$2y$10$VbXiFtmifeLtqAsxLlGU/u4XJU7lVKoFiEi36cmV.SqLmcBXZTEH.', 'student', '2025-11-28 13:59:35', 0, NULL, NULL, NULL, NULL, 0, NULL, '2025-11-28 13:59:35'),
(8, 'Desire', 'admin@karibaoutlet.co.zw', '$2y$10$COmM2KXo5WMn3G0LRo6yt.xyfTacbIbcglcrpwKkScGjaOCFTp/t6', 'student', '2025-11-28 14:31:37', 0, NULL, NULL, NULL, NULL, 0, NULL, '2025-11-28 14:31:37');

-- --------------------------------------------------------

--
-- Table structure for table `user_achievements`
--

CREATE TABLE `user_achievements` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `achievement_type` varchar(50) NOT NULL,
  `title` varchar(100) NOT NULL,
  `description` text DEFAULT NULL,
  `icon` varchar(50) DEFAULT NULL,
  `earned_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `user_achievements`
--

INSERT INTO `user_achievements` (`id`, `user_id`, `achievement_type`, `title`, `description`, `icon`, `earned_at`) VALUES
(1, 1, 'first_login', 'Welcome!', 'First time logging in', 'fas fa-star', '2025-11-25 11:53:24'),
(2, 1, 'profile_complete', 'Profile Master', 'Completed profile information', 'fas fa-user-check', '2025-11-25 11:53:24');

-- --------------------------------------------------------

--
-- Table structure for table `user_activities`
--

CREATE TABLE `user_activities` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `action_type` varchar(50) NOT NULL,
  `action_description` text DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`metadata`)),
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `user_activities`
--

INSERT INTO `user_activities` (`id`, `user_id`, `action_type`, `action_description`, `ip_address`, `user_agent`, `metadata`, `created_at`) VALUES
(1, 5, 'exam_deleted', 'Deleted exam: CIPS L3', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36', NULL, '2026-01-31 00:40:38');

-- --------------------------------------------------------

--
-- Table structure for table `user_payment_methods`
--

CREATE TABLE `user_payment_methods` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `gateway_name` varchar(50) NOT NULL,
  `payment_method_id` varchar(255) NOT NULL,
  `payment_type` varchar(50) NOT NULL,
  `last_four` varchar(4) DEFAULT NULL,
  `expiry_month` int(11) DEFAULT NULL,
  `expiry_year` int(11) DEFAULT NULL,
  `card_brand` varchar(50) DEFAULT NULL,
  `billing_address` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`billing_address`)),
  `is_default` tinyint(1) DEFAULT 0,
  `is_active` tinyint(1) DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `user_profiles`
--

CREATE TABLE `user_profiles` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `first_name` varchar(50) DEFAULT NULL,
  `last_name` varchar(50) DEFAULT NULL,
  `bio` text DEFAULT NULL,
  `avatar` varchar(255) DEFAULT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `date_of_birth` date DEFAULT NULL,
  `gender` enum('male','female','other','prefer_not_to_say') DEFAULT NULL,
  `website` varchar(255) DEFAULT NULL,
  `social_links` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`social_links`)),
  `preferences` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`preferences`)),
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `user_sessions`
--

CREATE TABLE `user_sessions` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `session_token` varchar(255) NOT NULL,
  `expires_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Stand-in structure for view `v_pending_grades`
-- (See below for the actual view)
--
CREATE TABLE `v_pending_grades` (
`answer_id` int(11)
,`exam_id` int(11)
,`exam_title` varchar(255)
,`attempt_id` int(11)
,`attempt_number` int(11)
,`student_id` int(11)
,`username` varchar(50)
,`email` varchar(100)
,`question_id` int(11)
,`question_type` enum('mcq_single','mcq_multiple','true_false','essay','short_answer','matching','code','fill_blanks')
,`question_content` longtext
,`answer_content` longtext
,`max_score` decimal(10,2)
,`status` enum('in_progress','saved','submitted','graded','reviewed','pending_manual_review')
,`is_flagged` tinyint(1)
,`submitted_at` timestamp
,`hours_pending` bigint(21)
);

-- --------------------------------------------------------

--
-- Stand-in structure for view `v_student_answers_overview`
-- (See below for the actual view)
--
CREATE TABLE `v_student_answers_overview` (
`id` int(11)
,`exam_id` int(11)
,`exam_title` varchar(255)
,`attempt_id` int(11)
,`student_id` int(11)
,`username` varchar(50)
,`email` varchar(100)
,`question_id` int(11)
,`question_content` longtext
,`question_type` enum('mcq_single','mcq_multiple','true_false','essay','short_answer','matching','code','fill_blanks')
,`answer_content` longtext
,`answer_type` enum('text','json','numeric','boolean')
,`is_correct` tinyint(1)
,`score` decimal(10,2)
,`max_score` decimal(10,2)
,`feedback` text
,`is_graded` tinyint(1)
,`graded_by` int(11)
,`graded_by_username` varchar(50)
,`graded_at` timestamp
,`grading_method` enum('auto','manual','ai')
,`status` enum('in_progress','saved','submitted','graded','reviewed','pending_manual_review')
,`is_flagged` tinyint(1)
,`time_spent_seconds` int(11)
,`submitted_at` timestamp
,`created_at` timestamp
);

-- --------------------------------------------------------

--
-- Structure for view `v_pending_grades`
--
DROP TABLE IF EXISTS `v_pending_grades`;

CREATE ALGORITHM=UNDEFINED VIEW `v_pending_grades`  AS SELECT `sa`.`id` AS `answer_id`, `sa`.`exam_id` AS `exam_id`, `e`.`title` AS `exam_title`, `sa`.`attempt_id` AS `attempt_id`, `ea`.`attempt_number` AS `attempt_number`, `sa`.`student_id` AS `student_id`, `u`.`username` AS `username`, `u`.`email` AS `email`, `sa`.`question_id` AS `question_id`, `q`.`question_type` AS `question_type`, `q`.`content` AS `question_content`, `sa`.`answer_content` AS `answer_content`, `sa`.`max_score` AS `max_score`, `sa`.`status` AS `status`, `sa`.`is_flagged` AS `is_flagged`, `sa`.`submitted_at` AS `submitted_at`, timestampdiff(HOUR,`sa`.`submitted_at`,current_timestamp()) AS `hours_pending` FROM ((((`student_answers` `sa` left join `exams` `e` on(`sa`.`exam_id` = `e`.`id`)) left join `exam_attempts` `ea` on(`sa`.`attempt_id` = `ea`.`id`)) left join `users` `u` on(`sa`.`student_id` = `u`.`id`)) left join `questions` `q` on(`sa`.`question_id` = `q`.`id`)) WHERE `sa`.`is_graded` = 0 AND `sa`.`status` in ('submitted','reviewed') AND `sa`.`answer_content` is not null AND `sa`.`answer_content` <> '' ORDER BY `sa`.`submitted_at` ASC ;

-- --------------------------------------------------------

--
-- Structure for view `v_student_answers_overview`
--
DROP TABLE IF EXISTS `v_student_answers_overview`;

CREATE ALGORITHM=UNDEFINED VIEW `v_student_answers_overview`  AS SELECT `sa`.`id` AS `id`, `sa`.`exam_id` AS `exam_id`, `e`.`title` AS `exam_title`, `sa`.`attempt_id` AS `attempt_id`, `sa`.`student_id` AS `student_id`, `u`.`username` AS `username`, `u`.`email` AS `email`, `sa`.`question_id` AS `question_id`, `q`.`content` AS `question_content`, `q`.`question_type` AS `question_type`, `sa`.`answer_content` AS `answer_content`, `sa`.`answer_type` AS `answer_type`, `sa`.`is_correct` AS `is_correct`, `sa`.`score` AS `score`, `sa`.`max_score` AS `max_score`, `sa`.`feedback` AS `feedback`, `sa`.`is_graded` AS `is_graded`, `sa`.`graded_by` AS `graded_by`, `u2`.`username` AS `graded_by_username`, `sa`.`graded_at` AS `graded_at`, `sa`.`grading_method` AS `grading_method`, `sa`.`status` AS `status`, `sa`.`is_flagged` AS `is_flagged`, `sa`.`time_spent_seconds` AS `time_spent_seconds`, `sa`.`submitted_at` AS `submitted_at`, `sa`.`created_at` AS `created_at` FROM ((((`student_answers` `sa` left join `exams` `e` on(`sa`.`exam_id` = `e`.`id`)) left join `users` `u` on(`sa`.`student_id` = `u`.`id`)) left join `questions` `q` on(`sa`.`question_id` = `q`.`id`)) left join `users` `u2` on(`sa`.`graded_by` = `u2`.`id`)) ;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `announcements`
--
ALTER TABLE `announcements`
  ADD PRIMARY KEY (`id`),
  ADD KEY `created_by` (`created_by`);

--
-- Indexes for table `assignment_submissions`
--
ALTER TABLE `assignment_submissions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_submission` (`enrollment_id`,`lesson_id`),
  ADD KEY `idx_enrollment` (`enrollment_id`),
  ADD KEY `idx_lesson` (`lesson_id`),
  ADD KEY `idx_status` (`status`);

--
-- Indexes for table `calendar_events`
--
ALTER TABLE `calendar_events`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_event_date` (`event_date`),
  ADD KEY `idx_creator` (`creator_id`);

--
-- Indexes for table `cart_items`
--
ALTER TABLE `cart_items`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_cart_item` (`user_id`,`item_type`,`item_id`),
  ADD KEY `idx_cart_user_type` (`user_id`,`item_type`),
  ADD KEY `idx_cart_created` (`created_at`);

--
-- Indexes for table `categories`
--
ALTER TABLE `categories`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `name` (`name`),
  ADD UNIQUE KEY `slug` (`slug`);

--
-- Indexes for table `content_analytics`
--
ALTER TABLE `content_analytics`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_analytics` (`content_type`,`content_id`,`date`),
  ADD KEY `idx_content` (`content_type`,`content_id`),
  ADD KEY `idx_course` (`course_id`),
  ADD KEY `idx_date` (`date`);

--
-- Indexes for table `courses`
--
ALTER TABLE `courses`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `slug` (`slug`),
  ADD KEY `idx_instructor` (`instructor_id`),
  ADD KEY `idx_category` (`category_id`),
  ADD KEY `idx_status` (`status`),
  ADD KEY `idx_featured` (`is_featured`),
  ADD KEY `idx_slug` (`slug`);

--
-- Indexes for table `course_analytics`
--
ALTER TABLE `course_analytics`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_analytics` (`course_id`,`date`),
  ADD KEY `idx_course` (`course_id`),
  ADD KEY `idx_date` (`date`),
  ADD KEY `idx_course_analytics_course_date` (`course_id`,`date`);

--
-- Indexes for table `course_categories`
--
ALTER TABLE `course_categories`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `slug` (`slug`),
  ADD KEY `idx_slug` (`slug`),
  ADD KEY `idx_parent` (`parent_id`),
  ADD KEY `idx_active` (`is_active`);

--
-- Indexes for table `course_enrollments`
--
ALTER TABLE `course_enrollments`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_enrollment` (`course_id`,`student_id`),
  ADD KEY `idx_student` (`student_id`),
  ADD KEY `idx_status` (`status`),
  ADD KEY `idx_enrollment_date` (`enrollment_date`),
  ADD KEY `idx_course_enrollments_course_student` (`course_id`,`student_id`);

--
-- Indexes for table `course_lessons`
--
ALTER TABLE `course_lessons`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_lesson_slug` (`course_id`,`slug`),
  ADD KEY `idx_course` (`course_id`),
  ADD KEY `idx_sort_order` (`sort_order`),
  ADD KEY `idx_type` (`lesson_type`),
  ADD KEY `idx_module` (`module_id`),
  ADD KEY `idx_course_lessons_course_order` (`course_id`,`sort_order`),
  ADD KEY `idx_lessons_topic` (`topic_id`),
  ADD KEY `idx_topic` (`topic_id`);

--
-- Indexes for table `course_lesson_progress`
--
ALTER TABLE `course_lesson_progress`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_progress` (`enrollment_id`,`lesson_id`),
  ADD KEY `lesson_id` (`lesson_id`),
  ADD KEY `idx_enrollment` (`enrollment_id`),
  ADD KEY `idx_status` (`status`);

--
-- Indexes for table `course_modules`
--
ALTER TABLE `course_modules`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_module_slug` (`course_id`,`slug`),
  ADD KEY `idx_course` (`course_id`),
  ADD KEY `idx_sort_order` (`sort_order`),
  ADD KEY `idx_modules_course` (`course_id`),
  ADD KEY `idx_modules_sort_order` (`sort_order`);

--
-- Indexes for table `course_resources`
--
ALTER TABLE `course_resources`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_resource_slug` (`course_id`,`slug`),
  ADD KEY `created_by` (`created_by`),
  ADD KEY `idx_course` (`course_id`),
  ADD KEY `idx_module` (`module_id`),
  ADD KEY `idx_lesson` (`lesson_id`),
  ADD KEY `idx_type` (`resource_type`),
  ADD KEY `idx_category` (`category`),
  ADD KEY `idx_active` (`is_active`),
  ADD KEY `idx_shared` (`is_shared`);

--
-- Indexes for table `course_reviews`
--
ALTER TABLE `course_reviews`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_review` (`course_id`,`student_id`),
  ADD KEY `idx_course` (`course_id`),
  ADD KEY `idx_student` (`student_id`),
  ADD KEY `idx_rating` (`rating`),
  ADD KEY `idx_status` (`status`),
  ADD KEY `idx_course_reviews_course_rating` (`course_id`,`rating`);

--
-- Indexes for table `course_topics`
--
ALTER TABLE `course_topics`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_topic_slug` (`module_id`,`slug`),
  ADD KEY `idx_topics_module` (`module_id`),
  ADD KEY `idx_topics_sort_order` (`sort_order`);

--
-- Indexes for table `discount_codes`
--
ALTER TABLE `discount_codes`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `code` (`code`),
  ADD KEY `created_by` (`created_by`),
  ADD KEY `idx_code` (`code`),
  ADD KEY `idx_active` (`is_active`),
  ADD KEY `idx_valid_dates` (`valid_from`,`valid_until`),
  ADD KEY `idx_discount_codes_usage` (`usage_count`,`usage_limit`);

--
-- Indexes for table `exams`
--
ALTER TABLE `exams`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `slug` (`slug`),
  ADD KEY `idx_course` (`course_id`),
  ADD KEY `idx_instructor` (`instructor_id`),
  ADD KEY `idx_type` (`exam_type`),
  ADD KEY `idx_status` (`status`),
  ADD KEY `idx_template` (`is_template`),
  ADD KEY `idx_exams_course_instructor` (`course_id`,`instructor_id`),
  ADD KEY `idx_exams_price` (`price`),
  ADD KEY `idx_exams_free` (`is_free`);

--
-- Indexes for table `exam_access`
--
ALTER TABLE `exam_access`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_exam_student` (`exam_id`,`student_id`),
  ADD KEY `idx_exam_access_student` (`student_id`),
  ADD KEY `idx_exam_access_exam` (`exam_id`),
  ADD KEY `idx_exam_access_payment` (`payment_status`);

--
-- Indexes for table `exam_attempts`
--
ALTER TABLE `exam_attempts`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_exam_student_attempt` (`exam_id`,`student_id`,`attempt_number`),
  ADD KEY `graded_by` (`graded_by`),
  ADD KEY `idx_exam_student_status` (`exam_id`,`student_id`,`status`),
  ADD KEY `idx_student_exam` (`student_id`,`exam_id`),
  ADD KEY `idx_status_started` (`status`,`started_at`),
  ADD KEY `idx_expires` (`expires_at`),
  ADD KEY `idx_time_expired` (`is_time_expired`,`status`),
  ADD KEY `idx_pending_grading` (`status`,`created_at`),
  ADD KEY `idx_score` (`score`),
  ADD KEY `idx_grade` (`grade`),
  ADD KEY `idx_status` (`status`),
  ADD KEY `idx_student_status` (`student_id`,`status`),
  ADD KEY `idx_exam_status` (`exam_id`,`status`),
  ADD KEY `idx_started_at` (`started_at`),
  ADD KEY `idx_ended_at` (`ended_at`),
  ADD KEY `idx_deleted` (`is_deleted`);

--
-- Indexes for table `exam_questions`
--
ALTER TABLE `exam_questions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_exam_question` (`exam_id`,`question_id`),
  ADD KEY `idx_exam` (`exam_id`),
  ADD KEY `idx_question` (`question_id`),
  ADD KEY `idx_sort_order` (`sort_order`),
  ADD KEY `idx_section` (`section_name`),
  ADD KEY `idx_exam_questions_exam_order` (`exam_id`,`sort_order`);

--
-- Indexes for table `exam_question_grades`
--
ALTER TABLE `exam_question_grades`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_attempt_question` (`attempt_id`,`question_id`),
  ADD KEY `idx_attempt` (`attempt_id`),
  ADD KEY `idx_question` (`question_id`),
  ADD KEY `idx_graded_by` (`graded_by`),
  ADD KEY `idx_graded_at` (`graded_at`);

--
-- Indexes for table `exam_reviews`
--
ALTER TABLE `exam_reviews`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_exam_student` (`exam_id`,`student_id`),
  ADD KEY `idx_exam_id` (`exam_id`),
  ADD KEY `idx_student_id` (`student_id`),
  ADD KEY `idx_status` (`status`);

--
-- Indexes for table `grade_scale`
--
ALTER TABLE `grade_scale`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `grade_letter` (`grade_letter`),
  ADD KEY `idx_grade_points` (`grade_points`),
  ADD KEY `idx_percentage_range` (`min_percentage`,`max_percentage`);

--
-- Indexes for table `lesson_resources`
--
ALTER TABLE `lesson_resources`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_lesson_resource` (`lesson_id`,`resource_id`),
  ADD KEY `idx_lesson_resources_lesson` (`lesson_id`),
  ADD KEY `idx_lesson_resources_resource` (`resource_id`);

--
-- Indexes for table `lesson_versions`
--
ALTER TABLE `lesson_versions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_version` (`lesson_id`,`version_number`),
  ADD KEY `idx_lesson` (`lesson_id`),
  ADD KEY `idx_published` (`is_published`),
  ADD KEY `idx_created_by` (`created_by`);

--
-- Indexes for table `payment_analytics`
--
ALTER TABLE `payment_analytics`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_analytics` (`date`,`gateway_name`,`currency`),
  ADD KEY `idx_date` (`date`),
  ADD KEY `idx_gateway` (`gateway_name`);

--
-- Indexes for table `payment_gateway_settings`
--
ALTER TABLE `payment_gateway_settings`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_gateway_type` (`gateway_name`,`gateway_type`),
  ADD KEY `idx_gateway_active` (`gateway_name`,`is_active`);

--
-- Indexes for table `payment_logs`
--
ALTER TABLE `payment_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_transaction` (`transaction_id`),
  ADD KEY `idx_user` (`user_id`),
  ADD KEY `idx_action` (`action`),
  ADD KEY `idx_level` (`level`),
  ADD KEY `idx_created_at` (`created_at`),
  ADD KEY `idx_payment_logs_action_created` (`action`,`created_at`);

--
-- Indexes for table `payment_refunds`
--
ALTER TABLE `payment_refunds`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `reference_number` (`reference_number`),
  ADD UNIQUE KEY `refund_transaction_id` (`refund_transaction_id`),
  ADD KEY `processed_by` (`processed_by`),
  ADD KEY `idx_transaction` (`transaction_id`),
  ADD KEY `idx_status` (`status`),
  ADD KEY `idx_processed_at` (`processed_at`),
  ADD KEY `idx_payment_refunds_reference` (`reference_number`);

--
-- Indexes for table `payment_transactions`
--
ALTER TABLE `payment_transactions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `transaction_id` (`transaction_id`),
  ADD UNIQUE KEY `reference_number` (`reference_number`),
  ADD KEY `discount_code` (`discount_code`),
  ADD KEY `idx_user` (`user_id`),
  ADD KEY `idx_item` (`item_type`,`item_id`),
  ADD KEY `idx_status` (`status`),
  ADD KEY `idx_gateway` (`gateway_name`,`gateway_type`),
  ADD KEY `idx_created_at` (`created_at`),
  ADD KEY `idx_payment_transactions_reference` (`reference_number`),
  ADD KEY `idx_payment_transactions_created_status` (`created_at`,`status`);

--
-- Indexes for table `posts`
--
ALTER TABLE `posts`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `slug` (`slug`),
  ADD KEY `category_id` (`category_id`),
  ADD KEY `author_id` (`author_id`);

--
-- Indexes for table `questions`
--
ALTER TABLE `questions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_type` (`question_type`),
  ADD KEY `idx_difficulty` (`difficulty`),
  ADD KEY `idx_category` (`category_id`),
  ADD KEY `idx_course` (`course_id`),
  ADD KEY `idx_instructor` (`instructor_id`),
  ADD KEY `idx_status` (`status`),
  ADD KEY `idx_review_status` (`review_status`),
  ADD KEY `idx_shared` (`is_shared`),
  ADD KEY `idx_questions_course_instructor` (`course_id`,`instructor_id`);

--
-- Indexes for table `question_analytics`
--
ALTER TABLE `question_analytics`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_analytics` (`question_id`,`exam_id`,`date`),
  ADD KEY `idx_question` (`question_id`),
  ADD KEY `idx_exam` (`exam_id`),
  ADD KEY `idx_course` (`course_id`),
  ADD KEY `idx_date` (`date`),
  ADD KEY `idx_question_analytics_question_date` (`question_id`,`date`);

--
-- Indexes for table `question_categories`
--
ALTER TABLE `question_categories`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `slug` (`slug`),
  ADD KEY `idx_slug` (`slug`),
  ADD KEY `idx_parent` (`parent_id`),
  ADD KEY `idx_active` (`is_active`);

--
-- Indexes for table `question_options`
--
ALTER TABLE `question_options`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_question` (`question_id`),
  ADD KEY `idx_sort_order` (`sort_order`),
  ADD KEY `idx_correct` (`is_correct`);

--
-- Indexes for table `question_reviews`
--
ALTER TABLE `question_reviews`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_question` (`question_id`),
  ADD KEY `idx_reviewer` (`reviewer_id`),
  ADD KEY `idx_status` (`review_status`),
  ADD KEY `idx_reviewed_at` (`reviewed_at`);

--
-- Indexes for table `question_tags`
--
ALTER TABLE `question_tags`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `name` (`name`),
  ADD UNIQUE KEY `slug` (`slug`),
  ADD KEY `idx_slug` (`slug`);

--
-- Indexes for table `question_tag_assignments`
--
ALTER TABLE `question_tag_assignments`
  ADD PRIMARY KEY (`question_id`,`tag_id`),
  ADD KEY `idx_question` (`question_id`),
  ADD KEY `idx_tag` (`tag_id`);

--
-- Indexes for table `scorm_packages`
--
ALTER TABLE `scorm_packages`
  ADD PRIMARY KEY (`id`),
  ADD KEY `created_by` (`created_by`),
  ADD KEY `idx_course` (`course_id`),
  ADD KEY `idx_lesson` (`lesson_id`),
  ADD KEY `idx_active` (`is_active`);

--
-- Indexes for table `site_settings`
--
ALTER TABLE `site_settings`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `setting_key` (`setting_key`);

--
-- Indexes for table `student_answer`
--
ALTER TABLE `student_answer`
  ADD PRIMARY KEY (`answer_id`),
  ADD UNIQUE KEY `uk_student_exam_question` (`student_id`,`exam_id`,`question_id`),
  ADD KEY `idx_is_correct` (`is_correct`),
  ADD KEY `idx_submitted_at` (`submitted_at`),
  ADD KEY `idx_status` (`status`),
  ADD KEY `idx_exam_answers` (`exam_id`,`question_id`),
  ADD KEY `idx_student_exam` (`student_id`,`exam_id`),
  ADD KEY `idx_grading_queue` (`status`,`graded_at`),
  ADD KEY `idx_graded_by` (`graded_by`),
  ADD KEY `fk_student_answer_question` (`question_id`);

--
-- Indexes for table `student_answers`
--
ALTER TABLE `student_answers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_student_question_exam` (`student_id`,`question_id`,`exam_id`,`attempt_id`),
  ADD KEY `previous_answer_id` (`previous_answer_id`),
  ADD KEY `idx_exam` (`exam_id`),
  ADD KEY `idx_student` (`student_id`),
  ADD KEY `idx_question` (`question_id`),
  ADD KEY `idx_attempt` (`attempt_id`),
  ADD KEY `idx_status` (`status`),
  ADD KEY `idx_is_graded` (`is_graded`),
  ADD KEY `idx_is_flagged` (`is_flagged`),
  ADD KEY `idx_exam_status` (`exam_id`,`status`),
  ADD KEY `idx_student_exam_status` (`student_id`,`exam_id`,`status`),
  ADD KEY `idx_question_graded` (`question_id`,`is_graded`),
  ADD KEY `idx_attempt_question` (`attempt_id`,`question_id`),
  ADD KEY `idx_student_graded` (`student_id`,`is_graded`),
  ADD KEY `idx_exam_graded` (`exam_id`,`is_graded`),
  ADD KEY `idx_submitted_at` (`submitted_at`),
  ADD KEY `idx_answer_hash` (`answer_hash`),
  ADD KEY `idx_graded_by_date` (`graded_by`,`graded_at`);

--
-- Indexes for table `student_answer_sync_log`
--
ALTER TABLE `student_answer_sync_log`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_answer` (`answer_id`),
  ADD KEY `idx_attempt` (`attempt_id`),
  ADD KEY `idx_sync_status` (`sync_status`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `username` (`username`),
  ADD UNIQUE KEY `email` (`email`);

--
-- Indexes for table `user_achievements`
--
ALTER TABLE `user_achievements`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_user_achievement` (`user_id`,`achievement_type`),
  ADD KEY `idx_user_achievements_user_type` (`user_id`,`achievement_type`);

--
-- Indexes for table `user_activities`
--
ALTER TABLE `user_activities`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_user_action` (`user_id`,`action_type`),
  ADD KEY `idx_created_at` (`created_at`),
  ADD KEY `idx_user_activities_user_action` (`user_id`,`action_type`,`created_at`);

--
-- Indexes for table `user_payment_methods`
--
ALTER TABLE `user_payment_methods`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_gateway_method` (`user_id`,`gateway_name`,`payment_method_id`),
  ADD KEY `idx_user` (`user_id`),
  ADD KEY `idx_default` (`user_id`,`is_default`);

--
-- Indexes for table `user_profiles`
--
ALTER TABLE `user_profiles`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_user_profile` (`user_id`),
  ADD KEY `idx_user_profiles_user_id` (`user_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `announcements`
--
ALTER TABLE `announcements`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `assignment_submissions`
--
ALTER TABLE `assignment_submissions`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `calendar_events`
--
ALTER TABLE `calendar_events`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `cart_items`
--
ALTER TABLE `cart_items`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=61;

--
-- AUTO_INCREMENT for table `categories`
--
ALTER TABLE `categories`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT for table `content_analytics`
--
ALTER TABLE `content_analytics`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `courses`
--
ALTER TABLE `courses`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `course_analytics`
--
ALTER TABLE `course_analytics`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `course_categories`
--
ALTER TABLE `course_categories`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT for table `course_enrollments`
--
ALTER TABLE `course_enrollments`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;

--
-- AUTO_INCREMENT for table `course_lessons`
--
ALTER TABLE `course_lessons`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=87;

--
-- AUTO_INCREMENT for table `course_lesson_progress`
--
ALTER TABLE `course_lesson_progress`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=297;

--
-- AUTO_INCREMENT for table `course_modules`
--
ALTER TABLE `course_modules`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=47;

--
-- AUTO_INCREMENT for table `course_resources`
--
ALTER TABLE `course_resources`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `course_reviews`
--
ALTER TABLE `course_reviews`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `course_topics`
--
ALTER TABLE `course_topics`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=27;

--
-- AUTO_INCREMENT for table `discount_codes`
--
ALTER TABLE `discount_codes`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `exams`
--
ALTER TABLE `exams`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT for table `exam_access`
--
ALTER TABLE `exam_access`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT for table `exam_attempts`
--
ALTER TABLE `exam_attempts`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;

--
-- AUTO_INCREMENT for table `exam_questions`
--
ALTER TABLE `exam_questions`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=144;

--
-- AUTO_INCREMENT for table `exam_question_grades`
--
ALTER TABLE `exam_question_grades`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=36;

--
-- AUTO_INCREMENT for table `exam_reviews`
--
ALTER TABLE `exam_reviews`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `grade_scale`
--
ALTER TABLE `grade_scale`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;

--
-- AUTO_INCREMENT for table `lesson_resources`
--
ALTER TABLE `lesson_resources`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `lesson_versions`
--
ALTER TABLE `lesson_versions`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `payment_analytics`
--
ALTER TABLE `payment_analytics`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `payment_gateway_settings`
--
ALTER TABLE `payment_gateway_settings`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT for table `payment_logs`
--
ALTER TABLE `payment_logs`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `payment_refunds`
--
ALTER TABLE `payment_refunds`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `payment_transactions`
--
ALTER TABLE `payment_transactions`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `posts`
--
ALTER TABLE `posts`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;

--
-- AUTO_INCREMENT for table `questions`
--
ALTER TABLE `questions`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=44;

--
-- AUTO_INCREMENT for table `question_analytics`
--
ALTER TABLE `question_analytics`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=126;

--
-- AUTO_INCREMENT for table `question_categories`
--
ALTER TABLE `question_categories`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `question_options`
--
ALTER TABLE `question_options`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=56;

--
-- AUTO_INCREMENT for table `question_reviews`
--
ALTER TABLE `question_reviews`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `question_tags`
--
ALTER TABLE `question_tags`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `scorm_packages`
--
ALTER TABLE `scorm_packages`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `site_settings`
--
ALTER TABLE `site_settings`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31;

--
-- AUTO_INCREMENT for table `student_answer`
--
ALTER TABLE `student_answer`
  MODIFY `answer_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Unique identifier for each answer', AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT for table `student_answers`
--
ALTER TABLE `student_answers`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32;

--
-- AUTO_INCREMENT for table `student_answer_sync_log`
--
ALTER TABLE `student_answer_sync_log`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `user_achievements`
--
ALTER TABLE `user_achievements`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `user_activities`
--
ALTER TABLE `user_activities`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `user_payment_methods`
--
ALTER TABLE `user_payment_methods`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `user_profiles`
--
ALTER TABLE `user_profiles`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `announcements`
--
ALTER TABLE `announcements`
  ADD CONSTRAINT `announcements_ibfk_1` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `assignment_submissions`
--
ALTER TABLE `assignment_submissions`
  ADD CONSTRAINT `assignment_submissions_ibfk_1` FOREIGN KEY (`enrollment_id`) REFERENCES `course_enrollments` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `assignment_submissions_ibfk_2` FOREIGN KEY (`lesson_id`) REFERENCES `course_lessons` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `calendar_events`
--
ALTER TABLE `calendar_events`
  ADD CONSTRAINT `calendar_events_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `cart_items`
--
ALTER TABLE `cart_items`
  ADD CONSTRAINT `cart_items_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `courses`
--
ALTER TABLE `courses`
  ADD CONSTRAINT `courses_ibfk_1` FOREIGN KEY (`instructor_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `courses_ibfk_2` FOREIGN KEY (`category_id`) REFERENCES `course_categories` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `course_analytics`
--
ALTER TABLE `course_analytics`
  ADD CONSTRAINT `course_analytics_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `course_categories`
--
ALTER TABLE `course_categories`
  ADD CONSTRAINT `course_categories_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `course_categories` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `course_enrollments`
--
ALTER TABLE `course_enrollments`
  ADD CONSTRAINT `course_enrollments_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `course_enrollments_ibfk_2` FOREIGN KEY (`student_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `course_lessons`
--
ALTER TABLE `course_lessons`
  ADD CONSTRAINT `course_lessons_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `course_lessons_ibfk_2` FOREIGN KEY (`module_id`) REFERENCES `course_modules` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `course_lessons_ibfk_3` FOREIGN KEY (`topic_id`) REFERENCES `course_topics` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `course_lessons_ibfk_4` FOREIGN KEY (`module_id`) REFERENCES `course_modules` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `course_lessons_ibfk_5` FOREIGN KEY (`module_id`) REFERENCES `course_modules` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `course_lessons_ibfk_6` FOREIGN KEY (`module_id`) REFERENCES `course_modules` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `course_lessons_ibfk_7` FOREIGN KEY (`topic_id`) REFERENCES `course_topics` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `course_lessons_ibfk_8` FOREIGN KEY (`module_id`) REFERENCES `course_modules` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `course_lessons_ibfk_9` FOREIGN KEY (`topic_id`) REFERENCES `course_topics` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `course_lesson_progress`
--
ALTER TABLE `course_lesson_progress`
  ADD CONSTRAINT `course_lesson_progress_ibfk_1` FOREIGN KEY (`enrollment_id`) REFERENCES `course_enrollments` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `course_lesson_progress_ibfk_2` FOREIGN KEY (`lesson_id`) REFERENCES `course_lessons` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `course_modules`
--
ALTER TABLE `course_modules`
  ADD CONSTRAINT `course_modules_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `course_resources`
--
ALTER TABLE `course_resources`
  ADD CONSTRAINT `course_resources_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `course_resources_ibfk_2` FOREIGN KEY (`module_id`) REFERENCES `course_modules` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `course_resources_ibfk_3` FOREIGN KEY (`lesson_id`) REFERENCES `course_lessons` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `course_resources_ibfk_4` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `course_reviews`
--
ALTER TABLE `course_reviews`
  ADD CONSTRAINT `course_reviews_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `course_reviews_ibfk_2` FOREIGN KEY (`student_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `course_topics`
--
ALTER TABLE `course_topics`
  ADD CONSTRAINT `course_topics_ibfk_1` FOREIGN KEY (`module_id`) REFERENCES `course_modules` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `discount_codes`
--
ALTER TABLE `discount_codes`
  ADD CONSTRAINT `discount_codes_ibfk_1` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `exams`
--
ALTER TABLE `exams`
  ADD CONSTRAINT `exams_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `exams_ibfk_2` FOREIGN KEY (`instructor_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `exam_access`
--
ALTER TABLE `exam_access`
  ADD CONSTRAINT `exam_access_ibfk_1` FOREIGN KEY (`exam_id`) REFERENCES `exams` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `exam_access_ibfk_2` FOREIGN KEY (`student_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `exam_attempts`
--
ALTER TABLE `exam_attempts`
  ADD CONSTRAINT `exam_attempts_ibfk_1` FOREIGN KEY (`student_id`) REFERENCES `users` (`id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `exam_attempts_ibfk_2` FOREIGN KEY (`exam_id`) REFERENCES `exams` (`id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `exam_attempts_ibfk_3` FOREIGN KEY (`graded_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `exam_questions`
--
ALTER TABLE `exam_questions`
  ADD CONSTRAINT `exam_questions_ibfk_1` FOREIGN KEY (`exam_id`) REFERENCES `exams` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `exam_questions_ibfk_2` FOREIGN KEY (`question_id`) REFERENCES `questions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `exam_question_grades`
--
ALTER TABLE `exam_question_grades`
  ADD CONSTRAINT `exam_question_grades_ibfk_1` FOREIGN KEY (`attempt_id`) REFERENCES `exam_attempts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `exam_question_grades_ibfk_2` FOREIGN KEY (`question_id`) REFERENCES `questions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `exam_question_grades_ibfk_3` FOREIGN KEY (`graded_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `exam_reviews`
--
ALTER TABLE `exam_reviews`
  ADD CONSTRAINT `exam_reviews_ibfk_1` FOREIGN KEY (`exam_id`) REFERENCES `exams` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `exam_reviews_ibfk_2` FOREIGN KEY (`student_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `lesson_resources`
--
ALTER TABLE `lesson_resources`
  ADD CONSTRAINT `lesson_resources_ibfk_1` FOREIGN KEY (`lesson_id`) REFERENCES `course_lessons` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `lesson_resources_ibfk_2` FOREIGN KEY (`resource_id`) REFERENCES `course_resources` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `lesson_versions`
--
ALTER TABLE `lesson_versions`
  ADD CONSTRAINT `lesson_versions_ibfk_1` FOREIGN KEY (`lesson_id`) REFERENCES `course_lessons` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `lesson_versions_ibfk_2` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `payment_logs`
--
ALTER TABLE `payment_logs`
  ADD CONSTRAINT `payment_logs_ibfk_1` FOREIGN KEY (`transaction_id`) REFERENCES `payment_transactions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `payment_logs_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `payment_refunds`
--
ALTER TABLE `payment_refunds`
  ADD CONSTRAINT `payment_refunds_ibfk_1` FOREIGN KEY (`transaction_id`) REFERENCES `payment_transactions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `payment_refunds_ibfk_2` FOREIGN KEY (`processed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `payment_transactions`
--
ALTER TABLE `payment_transactions`
  ADD CONSTRAINT `payment_transactions_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `payment_transactions_ibfk_2` FOREIGN KEY (`discount_code`) REFERENCES `discount_codes` (`code`) ON DELETE SET NULL;

--
-- Constraints for table `posts`
--
ALTER TABLE `posts`
  ADD CONSTRAINT `posts_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `posts_ibfk_2` FOREIGN KEY (`author_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `questions`
--
ALTER TABLE `questions`
  ADD CONSTRAINT `questions_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `question_categories` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `questions_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `questions_ibfk_3` FOREIGN KEY (`instructor_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `question_analytics`
--
ALTER TABLE `question_analytics`
  ADD CONSTRAINT `question_analytics_ibfk_1` FOREIGN KEY (`question_id`) REFERENCES `questions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `question_analytics_ibfk_2` FOREIGN KEY (`exam_id`) REFERENCES `exams` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `question_analytics_ibfk_3` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `question_categories`
--
ALTER TABLE `question_categories`
  ADD CONSTRAINT `question_categories_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `question_categories` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `question_options`
--
ALTER TABLE `question_options`
  ADD CONSTRAINT `question_options_ibfk_1` FOREIGN KEY (`question_id`) REFERENCES `questions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `question_reviews`
--
ALTER TABLE `question_reviews`
  ADD CONSTRAINT `question_reviews_ibfk_1` FOREIGN KEY (`question_id`) REFERENCES `questions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `question_reviews_ibfk_2` FOREIGN KEY (`reviewer_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `question_tag_assignments`
--
ALTER TABLE `question_tag_assignments`
  ADD CONSTRAINT `question_tag_assignments_ibfk_1` FOREIGN KEY (`question_id`) REFERENCES `questions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `question_tag_assignments_ibfk_2` FOREIGN KEY (`tag_id`) REFERENCES `question_tags` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `scorm_packages`
--
ALTER TABLE `scorm_packages`
  ADD CONSTRAINT `scorm_packages_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `scorm_packages_ibfk_2` FOREIGN KEY (`lesson_id`) REFERENCES `course_lessons` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `scorm_packages_ibfk_3` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `student_answer`
--
ALTER TABLE `student_answer`
  ADD CONSTRAINT `fk_student_answer_exam` FOREIGN KEY (`exam_id`) REFERENCES `exams` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_student_answer_instructor` FOREIGN KEY (`graded_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_student_answer_question` FOREIGN KEY (`question_id`) REFERENCES `questions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_student_answer_student` FOREIGN KEY (`student_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `student_answers`
--
ALTER TABLE `student_answers`
  ADD CONSTRAINT `student_answers_ibfk_1` FOREIGN KEY (`exam_id`) REFERENCES `exams` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `student_answers_ibfk_2` FOREIGN KEY (`attempt_id`) REFERENCES `exam_attempts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `student_answers_ibfk_3` FOREIGN KEY (`student_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `student_answers_ibfk_4` FOREIGN KEY (`question_id`) REFERENCES `questions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `student_answers_ibfk_5` FOREIGN KEY (`graded_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `student_answers_ibfk_6` FOREIGN KEY (`previous_answer_id`) REFERENCES `student_answers` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `user_achievements`
--
ALTER TABLE `user_achievements`
  ADD CONSTRAINT `user_achievements_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `user_activities`
--
ALTER TABLE `user_activities`
  ADD CONSTRAINT `user_activities_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `user_payment_methods`
--
ALTER TABLE `user_payment_methods`
  ADD CONSTRAINT `user_payment_methods_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `user_profiles`
--
ALTER TABLE `user_profiles`
  ADD CONSTRAINT `user_profiles_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
