Training Course Builder
Run ID: 69c94ab4fee1f7eb4a8103e52026-03-29Education
PantheraHive BOS
BOS Dashboard

Build a complete training course with modules, lesson plans, quizzes, hands-on exercises, and certification criteria for any subject.

Step 1: aistudygenius → design_curriculum - Design Specifications for the Curriculum Designer Module

This document outlines the detailed design specifications, wireframe descriptions, color palette, and UX recommendations for the "Curriculum Designer" module. This module is the foundational step within the PantheraHive Training Course Builder workflow, enabling users to structure their training courses effectively and intuitively.

The user input "Test run for training_course_builder" indicates a request to demonstrate the capabilities and design of this core curriculum-building interface.


1. Introduction & Goal of the Step

The design_curriculum step is where course creators define the entire structural blueprint of their training program. This module provides a robust, user-friendly interface to:

  • Structure: Organize content into logical modules and lessons.
  • Define: Set clear learning objectives and certification criteria.
  • Outline: Plan the sequence and type of learning activities (lectures, quizzes, exercises).
  • Iterate: Easily modify, reorder, and refine the course structure.

The primary goal is to empower users to build a comprehensive and coherent course outline with minimal friction, ensuring a strong foundation for content creation in subsequent steps.


2. Core Functionality & User Stories

The Curriculum Designer module will support the following key functionalities, addressing common user needs:

  • Course Initialization:

* As a course creator, I want to define the overall course title, description, target audience, and primary learning outcomes.

  • Module Management:

* As a course creator, I want to add new modules to my course.

* As a course creator, I want to edit module titles and descriptions.

* As a course creator, I want to reorder modules using drag-and-drop.

* As a course creator, I want to delete modules.

  • Lesson Management:

* As a course creator, I want to add new lessons within any module.

* As a course creator, I want to edit lesson titles and descriptions.

* As a course creator, I want to reorder lessons within a module, or move them between modules using drag-and-drop.

* As a course creator, I want to delete lessons.

  • Content Item Planning (Placeholder for future steps):

As a course creator, I want to indicate the type* of content for each lesson (e.g., Lecture, Quiz, Hands-on Exercise, Discussion). This will inform subsequent content creation steps.

  • Certification Criteria:

* As a course creator, I want to define the requirements for course completion and certification (e.g., pass all quizzes, complete final project, attendance).

  • Progress & Overview:

* As a course creator, I want to see a clear, hierarchical overview of my entire course structure.

* As a course creator, I want to easily navigate between different parts of my curriculum.


3. Detailed Design Specifications

3.1. Layout & Structure

The Curriculum Designer will employ a multi-panel, responsive layout optimized for desktop and tablet, with a simplified view for mobile.

  • Left Sidebar (Navigation/Overview):

* Collapsible for smaller screens.

* Displays a high-level, interactive tree view of the course: Course Title > Modules > Lessons.

* Allows quick navigation to specific modules or lessons for editing.

* Includes a "Course Settings" link for overall course details and certification.

  • Main Content Area (Editor Panel):

* Dynamic area that displays the selected module, lesson, or course settings for editing.

* Utilizes a "what you see is what you get" (WYSIWYG) approach where possible, especially for content descriptions.

  • Top Bar:

* Course Title display.

* Global actions: "Save Draft," "Publish Course" (disabled until all steps complete), "Preview."

* Workflow progress indicator (e.g., "Step 1 of 4: Curriculum Design").

3.2. Key UI Components

  • Input Fields:

* Standard text inputs for titles (Module Title, Lesson Title).

* Rich Text Editor (WYSIWYG) for descriptions (Course Description, Module Description, Lesson Description) supporting bold, italics, lists, links, and basic formatting.

  • Drag-and-Drop:

* Intuitive drag handles for reordering modules and lessons within and between modules.

* Visual feedback during drag operations (ghosting, drop zone highlighting).

  • Add Buttons:

* Clearly labeled buttons like "+ Add Module," "+ Add Lesson."

* Contextual "Add" buttons appear within modules for adding lessons.

  • Action Icons:

* Edit (pencil icon), Delete (trash can icon), Duplicate (copy icon) for modules and lessons.

* Chevron/arrow icons for expanding/collapsing module contents in the left sidebar.

  • Confirmation Dialogs:

* For destructive actions like deleting modules/lessons.

  • Progress Indicators:

* Subtle indicators for saving status (e.g., "Saving..." / "Saved").

* A visual workflow tracker at the top.

  • Checkboxes/Radio Buttons:

* For defining certification criteria (e.g., "Require completion of all quizzes").

3.3. Interactivity & Feedback

  • Instant Validation: Provide real-time feedback for required fields or character limits.
  • Hover States: Clearly indicate interactive elements on hover.
  • Loading Spinners: For asynchronous operations (e.g., saving large descriptions).
  • Toast Notifications: Non-intrusive messages for successful saves, deletions, or errors.
  • Smooth Transitions: Gentle animations for expanding/collapsing sections, adding/removing items.

4. Wireframe Descriptions

Below are descriptions of key screens within the Curriculum Designer module.

4.1. Curriculum Overview Dashboard (Initial View)

  • Left Sidebar:

* Course Title: "[Course Title Placeholder]"

* "Course Settings" link (takes user to course-level details).

* Module List:

* [Module 1 Title] (e.g., "Introduction to AI Fundamentals")

* [Lesson 1.1 Title] (e.g., "What is AI?")

* [Lesson 1.2 Title] (e.g., "History of AI")

* [Module 2 Title] (e.g., "Machine Learning Basics")

* [Lesson 2.1 Title] (e.g., "Supervised Learning")

* [Lesson 2.2 Title] (e.g., "Unsupervised Learning")

* + Add Module button at the bottom.

  • Main Content Area (Default: Course Settings):

* Course Title Input: "Introduction to AI Fundamentals"

* Course Description (Rich Text Editor): Placeholder text about the course.

* Target Audience Input: "Beginners interested in AI."

* Learning Objectives (Bulleted List Input):

* "Understand core AI concepts."

* "Differentiate between AI, ML, and DL."

* Certification Criteria Section:

* Checkbox: "Require completion of all lessons."

* Checkbox: "Require passing score on all quizzes (70%)."

* Text Area: "Additional requirements..."

* "Save Changes" button.

  • Top Bar: "My New Course" | "Step 1 of 4: Curriculum Design" | "Save Draft" | "Preview"

4.2. Module Editor View (When a Module is Selected)

  • Left Sidebar: Same as Overview, with the selected module highlighted.
  • Main Content Area:

* Module Title Input: "Module 1: Introduction to AI Fundamentals"

* Module Description (Rich Text Editor): Placeholder text detailing module objectives.

* Lesson List for Module 1:

* [Drag Handle] [Lesson 1.1 Title] (e.g., "What is AI?") [Edit Icon] [Delete Icon]

* [Drag Handle] [Lesson 1.2 Title] (e.g., "History of AI") [Edit Icon] [Delete Icon]

* [Drag Handle] [Lesson 1.3 Title] (e.g., "Ethical Considerations in AI") [Edit Icon] [Delete Icon]

* + Add Lesson button.

* "Save Changes" button.

4.3. Lesson Editor View (When a Lesson is Selected)

  • Left Sidebar: Same as Overview, with the selected lesson highlighted within its module.
  • Main Content Area:

* Lesson Title Input: "Lesson 1.1: What is AI?"

* Lesson Description (Rich Text Editor): Placeholder text detailing lesson objectives and content overview.

* Planned Content Type Selector (Dropdown/Radio):

* Options: "Lecture (Video/Text)", "Quiz", "Hands-on Exercise", "Discussion Forum", "Reading."

Note: This is a placeholder for planning; actual content creation happens in Step 2.*

* Estimated Duration Input: (e.g., "30 mins")

* Learning Outcomes for this Lesson (Bulleted List Input):

* "Define Artificial Intelligence."

* "Identify key sub-fields of AI."

* "Save Changes" button.

4.4. Content Item Editor (Generic, within Lesson Editor)

  • This view is conceptual for planning purposes in Step 1, actual content creation is Step 2.
  • Within the Lesson Editor, there would be a section to plan content items.
  • + Add Content Item button.
  • Content Item List:

* [Drag Handle] [Icon: Video] Video Lecture: "Introduction to AI" [Edit Icon] [Delete Icon]

* [Drag Handle] [Icon: Text] Reading: "A Brief History of AI" [Edit Icon] [Delete Icon]

* [Drag Handle] [Icon: Quiz] Quiz: "AI Fundamentals Check" [Edit Icon] [Delete Icon]

Each item would have a type selector and a placeholder for its title.*

  • "Save Changes" button.

5. Color Palette & Typography

A professional, clean, and accessible design system will be employed.

5.1. Color Palette

  • Primary Accent: #007BFF (Vibrant Blue - for interactive elements, primary buttons, highlights)
  • Secondary Accent: #28A745 (Success Green - for save confirmations, positive feedback)
  • Warning/Error: #DC3545 (Danger Red - for delete actions, error messages)
  • Backgrounds:

* #F8F9FA (Light Gray - main content area background)

* #FFFFFF (Pure White - card backgrounds, modals, input fields)

  • Text Colors:

* #212529 (Dark Gray - primary text)

* #6C757D (Medium Gray - secondary text, descriptions, placeholders)

* #ADB5BD (Light Gray - disabled text)

  • Borders/Dividers: #DEE2E6 (Very Light Gray)

5.2. Typography

  • Font Family: Inter, Roboto, or Open Sans (modern, highly readable sans-
collab Output

Training Course Builder: Comprehensive Course Design Template

Welcome to your personalized training course blueprint! This document outlines a complete, structured training program, ready for customization with your specific subject matter. Our goal is to provide a robust framework that ensures engaging content, practical application, and measurable learning outcomes for your participants.

This "test run" provides a detailed example of the structure and components you can expect for any course you wish to build.


1. Course Overview: Mastering Advanced Business Strategy

Headline: Unlock Your Potential: A Comprehensive Journey to Mastery in Advanced Business Strategy

Body Text:

Embark on a transformative learning experience designed to equip you with the essential knowledge, skills, and practical expertise in Advanced Business Strategy. This comprehensive training course goes beyond theoretical concepts, immersing you in hands-on application, real-world scenarios, and expert insights. Whether you're a beginner seeking foundational understanding or an experienced professional looking to refine your skills, this program offers a structured pathway to achieve proficiency and confidence.

Course Duration: Approximately 20-25 hours (flexible, based on self-paced learning and exercise completion)


2. Target Audience

This course is ideally suited for:

  • Beginners: Individuals with little to no prior experience in Business Analytics & Strategy who wish to build a strong foundational understanding.
  • Intermediate Learners: Professionals seeking to formalize their existing knowledge, fill in gaps, and learn best practices.
  • Career Changers: Those looking to acquire new skills for a career transition into roles requiring Business Analytics & Strategy expertise.
  • Team Leaders/Managers: Individuals who need to understand the core concepts and applications of Business Analytics & Strategy to effectively lead or manage projects and teams.

3. Overall Course Learning Objectives

Upon successful completion of this course, participants will be able to:

  • Comprehend the fundamental principles and key concepts of Business Analytics & Strategy.
  • Identify and apply essential tools, techniques, and methodologies relevant to Business Analytics & Strategy.
  • Analyze common challenges and propose effective solutions within Business Analytics & Strategy.
  • Execute practical tasks and hands-on exercises demonstrating proficiency in Business Analytics & Strategy.
  • Evaluate different approaches and make informed decisions based on best practices in Business Analytics & Strategy.
  • Develop a strategic mindset for continuous learning and adaptation within the evolving landscape of Business Analytics & Strategy.

4. Course Modules & Structure

This course is divided into progressive modules, each building upon the last to ensure a cohesive and comprehensive learning journey.

Module 1: Introduction to Business Analytics & Strategy - The Fundamentals

  • Description: Laying the groundwork with core definitions, historical context, and the importance of Business Analytics & Strategy in today's landscape.
  • Estimated Time: 3-4 hours
  • Key Topics: What is [Subject]? Why does it matter? Key terminology, basic concepts, overview of tools.

Module 2: Core Concepts & Principles - Building Blocks of Mastery

  • Description: Delving deeper into the essential theories, models, and foundational principles that govern Business Analytics & Strategy.
  • Estimated Time: 5-6 hours
  • Key Topics: Advanced definitions, theoretical frameworks, ethical considerations, common methodologies.

Module 3: Practical Application & Tools - Hands-On Proficiency

  • Description: Focusing on the practical application of concepts using industry-standard tools and techniques through guided exercises.
  • Estimated Time: 6-8 hours
  • Key Topics: Step-by-step guides for tool usage, common workflows, troubleshooting, best practices in implementation.

Module 4: Advanced Topics & Case Studies - Real-World Scenarios

  • Description: Exploring more complex scenarios, advanced strategies, and analyzing real-world case studies to solidify understanding.
  • Estimated Time: 4-5 hours
  • Key Topics: Advanced techniques, problem-solving strategies, industry trends, successful and unsuccessful case studies.

Module 5: Project & Certification Preparation - Demonstrating Expertise

  • Description: Consolidating all learned material, preparing for the final project, and outlining the certification process.
  • Estimated Time: 2-3 hours
  • Key Topics: Review of key concepts, project guidelines, final assessment preparation, career pathways.

5. Detailed Lesson Plan Example: Module 3, Lesson 1 - Implementing [Key Tool/Technique]

To illustrate the depth of our lesson plans, here's an example for a specific lesson:

Course: Mastering Advanced Business Strategy

Module: 3. Practical Application & Tools

Lesson Title: 3.1 Implementing [Key Tool/Technique] for Efficient [Task]

Lesson Duration: 1.5 hours

Lesson Learning Objectives:

Upon completion of this lesson, participants will be able to:

  • Understand the purpose and core functionalities of [Key Tool/Technique].
  • Navigate the user interface of [Key Tool/Technique] and identify key features.
  • Perform basic setup and configuration for a [specific type of project/task].
  • Execute a guided [specific task] using [Key Tool/Technique] from start to finish.
  • Troubleshoot common errors encountered during the initial use of the tool.

Content Breakdown & Activities:

  1. Introduction to [Key Tool/Technique] (15 mins)

* Brief lecture: What is it? Why use it? Overview of benefits and use cases.

* Short video demonstration: Quick tour of the interface.

  1. Setting Up Your Environment (30 mins)

* Guided Walkthrough: Instructor demonstrates screen-sharing the installation/setup process.

* Hands-on Exercise 3.1.1 (Setup): Participants follow along to install and configure [Key Tool/Technique] on their local machines/virtual environments.

* Q&A/Troubleshooting: Dedicated time for initial technical issues.

  1. Basic Operations: Performing [Specific Task] (45 mins)

* Live Demonstration: Instructor performs a step-by-step demonstration of completing [specific task] using the tool.

* Hands-on Exercise 3.1.2 (First Task): Participants replicate the demonstrated task with provided sample data/parameters.

* Pair/Group Work (Optional): Participants can work together to discuss challenges and solutions.

  1. Review and Next Steps (10 mins)

* Recap of key takeaways from the lesson.

* Preview of the next lesson: Advanced features of [Key Tool/Technique].

* Mini-Quiz (3 questions): Quick check for understanding.

Materials & Resources:

  • Presentation slides (PDF)
  • Link to [Key Tool/Technique] download/documentation
  • Sample data/project files for exercises
  • Video tutorials for setup and basic operations
  • Troubleshooting FAQ document

6. Quizzes & Assessments

Each module concludes with a comprehensive quiz designed to reinforce learning and assess understanding of the material.

  • Format: Multiple-choice, true/false, short answer, and scenario-based questions.
  • Purpose: To test comprehension of module objectives and identify areas for review.
  • Feedback: Instant feedback on answers, with explanations for correct solutions and references to relevant course material.
  • Weight: Module quizzes contribute 30% to the overall course grade.
  • Retake Policy: Participants are allowed two retakes per quiz to ensure mastery.

Example Quiz Question (Module 2):

  • Question: Which of the following is considered a foundational principle of Business Analytics & Strategy when dealing with [specific scenario]?

* A) [Incorrect Option 1]

* B) [Incorrect Option 2]

* C) [Correct Option, with explanation]

* D) [Partially Correct/Distractor Option]


7. Hands-on Exercises & Projects

Practical application is central to this course. Each module incorporates hands-on exercises, culminating in a final project.

  • In-Lesson Exercises: Short, guided tasks integrated into lessons to practice new skills immediately (e.g., configuring software, writing code snippets, analyzing data sets).
  • Module Projects: Larger, more complex assignments at the end of Modules 2, 3, and 4, requiring participants to apply multiple concepts learned within the module.

* Example (Module 3 Project): "Design and implement a basic [specific system/solution] using [Key Tool/Technique] to solve [a defined problem]."

* Deliverables: Project report, screenshots/code, explanation of methodology.

  • Final Capstone Project: A comprehensive project (at the end of Module 5) that integrates all skills and knowledge acquired throughout the course.

* Weight: The final project contributes 50% to the overall course grade.

* Mentorship: Optional 1:1 check-ins with an instructor for guidance on the final project.


8. Certification Criteria

Upon successful completion of all course requirements, participants will earn a "Certificate of Mastery in Advanced Business Strategy".

To qualify for certification, participants must achieve the following:

  1. Module Quizzes: An average score of 70% or higher across all module quizzes.
  2. Module Projects: Successful completion and submission of all module projects, meeting specified criteria.
  3. Final Capstone Project: A score of 75% or higher on the final capstone project.
  4. Course Engagement: Active participation in discussion forums (if applicable) and completion of all learning activities.
  5. Final Exam (Optional): If included, a score of 70% or higher on a comprehensive final exam covering all course content.

Ready to Build Your Course?

This detailed template serves as a robust foundation. Now, we're ready to infuse it with your specific vision!

Call to Action:

To proceed with building your custom training course, please provide the following:

  • The exact subject or topic for your training course (e.g., "Advanced Data Analytics with Python," "Project Management Fundamentals," "Introduction to Digital Marketing").
  • Any specific learning outcomes or key skills you want participants to gain.
  • Your target audience's current knowledge level (beginner, intermediate, advanced).

Once we receive this information, we will generate the full, tailored course content, ready for your review and deployment!

collab Output

Workflow Step Execution: collab → generate_code

This document outlines the execution of Step 3 of 4 for the "Training Course Builder" workflow. The objective of this step is to generate the foundational code required to structure, manage, and build a comprehensive training course based on the provided input.


1. Objective

The primary goal of this step is to produce a robust, well-structured, and extensible Python codebase that defines the core components of a training course. This includes classes for Course, Module, Lesson, Quiz, HandsOnExercise, and CertificationCriteria. The generated code will serve as a framework that can be populated with specific content to create any training course.

Given the input "Test run for training_course_builder", we will generate a generic example course structure to demonstrate the builder's capabilities, illustrating how modules, lessons, quizzes, and exercises are integrated.


2. Generated Code Overview

The generated code provides a modular and object-oriented approach to defining a training course. It consists of several Python classes, each representing a key component of a course. This structure allows for easy expansion, content management, and generation of course materials.

Key Components:

  • Course: The top-level container for the entire training program.
  • Module: A thematic section within a course, comprising lessons, quizzes, and exercises.
  • Lesson: Detailed instructional content with learning objectives.
  • Quiz: Assessments with multiple-choice questions and passing criteria.
  • HandsOnExercise: Practical activities with instructions and expected outcomes.
  • CertificationCriteria: Defines the requirements for course completion and certification.

The code is designed to be clear, well-commented, and easily adaptable for various subjects and course complexities.


3. Python Code Implementation (course_builder.py)


import uuid
from typing import List, Dict, Any, Optional

class Lesson:
    """
    Represents a single lesson within a course module.
    """
    def __init__(self, title: str, content: List[str], learning_objectives: List[str]):
        """
        Initializes a Lesson object.

        Args:
            title (str): The title of the lesson.
            content (List[str]): A list of strings, where each string is a paragraph or section of the lesson content.
            learning_objectives (List[str]): A list of what participants should be able to do after the lesson.
        """
        self.lesson_id = str(uuid.uuid4()) # Unique identifier for the lesson
        self.title = title
        self.content = content
        self.learning_objectives = learning_objectives

    def __str__(self):
        return f"Lesson: {self.title}"

    def display(self):
        """Prints the lesson details."""
        print(f"\n--- {self.title} ---")
        print("Learning Objectives:")
        for obj in self.learning_objectives:
            print(f"  - {obj}")
        print("\nContent:")
        for paragraph in self.content:
            print(f"  {paragraph}")
        print("--------------------")

class Quiz:
    """
    Represents a quiz for a module or lesson.
    """
    def __init__(self, title: str, questions: List[Dict[str, Any]], passing_score_percentage: float = 70.0):
        """
        Initializes a Quiz object.

        Args:
            title (str): The title of the quiz.
            questions (List[Dict[str, Any]]): A list of dictionaries, each representing a question.
                                                Each dict should have:
                                                'question_text': str
                                                'options': List[str]
                                                'correct_answer_index': int (0-indexed)
            passing_score_percentage (float): The percentage required to pass the quiz.
        """
        self.quiz_id = str(uuid.uuid4()) # Unique identifier for the quiz
        self.title = title
        self.questions = questions
        self.passing_score_percentage = passing_score_percentage

    def __str__(self):
        return f"Quiz: {self.title} (Passing: {self.passing_score_percentage}%)"

    def display(self):
        """Prints the quiz details without revealing answers."""
        print(f"\n--- Quiz: {self.title} ---")
        print(f"Passing Score: {self.passing_score_percentage}%")
        for i, q in enumerate(self.questions):
            print(f"\nQ{i+1}: {q['question_text']}")
            for j, option in enumerate(q['options']):
                print(f"  {chr(65+j)}. {option}")
        print("-------------------------")

class HandsOnExercise:
    """
    Represents a hands-on exercise or practical assignment.
    """
    def __init__(self, title: str, description: str, instructions: List[str], expected_output_criteria: List[str]):
        """
        Initializes a HandsOnExercise object.

        Args:
            title (str): The title of the exercise.
            description (str): A brief description of the exercise.
            instructions (List[str]): Step-by-step instructions for completing the exercise.
            expected_output_criteria (List[str]): Criteria for evaluating the successful completion.
        """
        self.exercise_id = str(uuid.uuid4()) # Unique identifier for the exercise
        self.title = title
        self.description = description
        self.instructions = instructions
        self.expected_output_criteria = expected_output_criteria

    def __str__(self):
        return f"Exercise: {self.title}"

    def display(self):
        """Prints the exercise details."""
        print(f"\n--- Exercise: {self.title} ---")
        print(f"Description: {self.description}")
        print("\nInstructions:")
        for i, inst in enumerate(self.instructions):
            print(f"  {i+1}. {inst}")
        print("\nExpected Output/Criteria:")
        for crit in self.expected_output_criteria:
            print(f"  - {crit}")
        print("----------------------------")

class Module:
    """
    Represents a module within a training course, containing lessons, quizzes, and exercises.
    """
    def __init__(self, title: str, description: str):
        """
        Initializes a Module object.

        Args:
            title (str): The title of the module.
            description (str): A brief description of the module's content.
        """
        self.module_id = str(uuid.uuid4()) # Unique identifier for the module
        self.title = title
        self.description = description
        self.lessons: List[Lesson] = []
        self.quizzes: List[Quiz] = []
        self.exercises: List[HandsOnExercise] = []

    def add_lesson(self, lesson: Lesson):
        """Adds a lesson to the module."""
        self.lessons.append(lesson)

    def add_quiz(self, quiz: Quiz):
        """Adds a quiz to the module."""
        self.quizzes.append(quiz)

    def add_exercise(self, exercise: HandsOnExercise):
        """Adds an exercise to the module."""
        self.exercises.append(exercise)

    def __str__(self):
        return f"Module: {self.title} ({len(self.lessons)} Lessons, {len(self.quizzes)} Quizzes, {len(self.exercises)} Exercises)"

    def display_structure(self, indent: int = 0):
        """Prints the module's structure."""
        prefix = "  " * indent
        print(f"{prefix}Module: {self.title}")
        print(f"{prefix}  Description: {self.description}")
        if self.lessons:
            print(f"{prefix}  Lessons:")
            for lesson in self.lessons:
                print(f"{prefix}    - {lesson.title}")
        if self.quizzes:
            print(f"{prefix}  Quizzes:")
            for quiz in self.quizzes:
                print(f"{prefix}    - {quiz.title}")
        if self.exercises:
            print(f"{prefix}  Exercises:")
            for exercise in self.exercises:
                print(f"{prefix}    - {exercise.title}")

class CertificationCriteria:
    """
    Defines the criteria required for course certification.
    """
    def __init__(self,
                 passing_threshold_quizzes: float = 70.0,
                 completion_required_exercises: int = 100, # Percentage of exercises to complete
                 final_project_required: bool = False,
                 other_requirements: Optional[List[str]] = None):
        """
        Initializes CertificationCriteria.

        Args:
            passing_threshold_quizzes (float): Minimum average score across all quizzes to pass.
            completion_required_exercises (int): Percentage of total exercises that must be completed.
            final_project_required (bool): Whether a final project is required.
            other_requirements (Optional[List[str]]): Any additional requirements for certification.
        """
        self.passing_threshold_quizzes = passing_threshold_quizzes
        self.completion_required_exercises = completion_required_exercises
        self.final_project_required = final_project_required
        self.other_requirements = other_requirements if other_requirements is not None else []

    def __str__(self):
        reqs = [f"Average quiz score >= {self.passing_threshold_quizzes}%"]
        if self.completion_required_exercises > 0:
            reqs.append(f"Complete {self.completion_required_exercises}% of hands-on exercises")
        if self.final_project_required:
            reqs.append("Submit and pass a final project")
        reqs.extend(self.other_requirements)
        return "Certification Requirements:\n" + "\n".join([f"- {r}" for r in reqs])

    def display(self):
        """Prints the certification criteria."""
        print("\n--- Certification Criteria ---")
        print(self)
        print("------------------------------")


class Course:
    """
    Represents a complete training course, composed of modules, and defines certification criteria.
    """
    def __init__(self, title: str, description: str, target_audience: List[str]):
        """
        Initializes a Course object.

        Args:
            title (str): The title of the course.
            description (str): A detailed description of the course.
            target_audience (List[str]): Who the course is intended for.
        """
        self.course_id = str(uuid.uuid4()) # Unique identifier for the course
        self.title = title
        self.description = description
        self.target_audience = target_audience
        self.modules: List[Module] = []
        self.certification_criteria: Optional[CertificationCriteria] = None

    def add_module(self, module: Module):
        """Adds a module to the course."""
        self.modules.append(module)

    def set_certification_criteria(self, criteria: CertificationCriteria):
        """Sets the certification criteria for the course."""
        self.certification_criteria = criteria

    def __str__(self):
        return f"Course: {self.title} ({len(self.modules)} Modules)"

    def display_course_structure(self):
        """Prints the full structure of the course."""
        print(f"\n--- Course: {self.title} ---")
        print(f"Description: {self.description}")
        print(f"Target Audience: {', '.join(self.target_audience)}")
        print("\nCourse Modules:")
        if not self.modules:
            print("  No modules defined yet.")
        for i, module in enumerate(self.modules):
            print(f"  Module {i+1}: ", end="")
            module.display_structure(indent=1)
        
        if self.certification_criteria:
            self.certification_criteria.display()
        else:
            print("\nNo specific certification criteria set for this course.")
        print("\n-------------------------------\n")

# --- Example Usage ---
if __name__ == "__main__":
    print("--- Building a Sample Course: 'Fundamentals of AI Workflow Automation' ---")

    # 1. Define Lessons
    lesson1_1 = Lesson(
        title="What is Workflow Automation?",
        content=[
            "Workflow automation involves designing and implementing systems that automatically execute a series of tasks or processes.",
            "It aims to streamline operations, reduce manual effort, and improve efficiency across various industries.",
            "Key benefits include cost savings, error reduction, and faster process execution."
        ],
        learning_objectives=[
            "Define workflow automation and its core principles.",
            "Identify common use cases for automation.",
            "Understand the benefits of automating business processes."
        ]
    )

    lesson1_2 = Lesson(
        title="Role of AI in
collab Output

Training Course Deliverable: Introduction to Artificial Intelligence and Machine Learning

Subject: Introduction to Artificial Intelligence and Machine Learning

Generated by: PantheraHive's Training Course Builder

Date: October 26, 2023


Welcome to Your Comprehensive Training Course!

We are thrilled to present the complete training course on "Introduction to Artificial Intelligence and Machine Learning," expertly crafted by PantheraHive's Training Course Builder. This course is designed to provide a robust foundational understanding of AI and ML, suitable for beginners and professionals looking to navigate the rapidly evolving landscape of intelligent technologies.

Our aim is to deliver a highly engaging, practical, and well-structured learning experience. Below you will find a detailed breakdown of each module, complete with lesson plans, interactive quizzes, hands-on exercises, and clear certification criteria.


Course Overview: Introduction to Artificial Intelligence and Machine Learning

Course Title: Mastering the Future: An Introduction to Artificial Intelligence and Machine Learning

Target Audience: Beginners, non-technical professionals, students, and anyone interested in understanding the core concepts and applications of AI and ML. No prior programming experience is strictly required, though a basic understanding of mathematics can be beneficial.

Course Goal: To equip participants with a fundamental understanding of Artificial Intelligence and Machine Learning principles, key algorithms, practical applications, and ethical considerations, enabling them to confidently engage with AI/ML discussions and pursue further specialized learning.

Estimated Duration: 16-20 hours (self-paced learning)


Module 1: Foundations of Artificial Intelligence

Module Goal: To introduce participants to the core concepts, history, branches, and ethical considerations of Artificial Intelligence.

Lesson 1.1: What is AI? History and Definitions

  • Learning Objectives:

* Define Artificial Intelligence (AI) and differentiate it from related concepts.

* Trace the historical evolution of AI from its origins to modern breakthroughs.

* Understand the different types of AI (Narrow, General, Super AI).

  • Key Topics:

* Defining AI: The Turing Test, Machine Learning vs. Deep Learning vs. AI.

* A Brief History: Early concepts, AI winters, resurgence.

* Philosophical Foundations: Strong AI vs. Weak AI.

  • Content Outline:

* Introduction to AI: What does "intelligence" mean for machines?

* Milestones: Dartmouth Conference, ELIZA, Deep Blue, AlphaGo.

* Current State of AI: Where are we now?

  • Activities/Discussion Points:

* Class discussion: "What is the most impressive AI application you've encountered?"

* Reflect: "How has AI already impacted your daily life?"

  • Resources:

* Video: "The History of AI in 5 Minutes"

* Reading: "What is Artificial Intelligence?" by IBM

Lesson 1.2: Branches of AI and Key Concepts

  • Learning Objectives:

* Identify and describe major branches of AI (e.g., ML, NLP, Computer Vision, Robotics).

* Understand foundational concepts like agents, environments, and intelligent behavior.

  • Key Topics:

* Machine Learning: The core of modern AI (brief intro).

* Natural Language Processing (NLP): Understanding and generating human language.

* Computer Vision: Enabling machines to "see" and interpret images.

* Robotics: Combining AI with physical systems.

* Expert Systems, Planning, Knowledge Representation.

  • Content Outline:

* Exploring the diverse landscape of AI sub-fields.

* How different branches contribute to complex AI systems.

* Examples of each branch in action.

  • Activities/Discussion Points:

* Case Study: Analyze a multi-faceted AI system (e.g., self-driving cars) and identify which AI branches it utilizes.

  • Resources:

* Infographic: "Branches of AI"

* Article: "An Overview of AI Subfields"

Lesson 1.3: AI Applications and Ethical Considerations

  • Learning Objectives:

* Recognize a wide range of real-world AI applications across various industries.

* Identify and discuss key ethical challenges and societal impacts of AI.

* Understand the importance of responsible AI development.

  • Key Topics:

* AI in Healthcare, Finance, Education, Entertainment, Transportation.

* Bias and Fairness in AI.

* Privacy and Data Security.

* Job displacement and the future of work.

* Accountability and Transparency.

  • Content Outline:

* Showcasing impactful AI use cases.

* Deep dive into ethical dilemmas: examples and potential solutions.

* The role of regulations and guidelines in AI development.

  • Activities/Discussion Points:

* Group Debate: "Should AI development be heavily regulated?"

* Ethical Scenario Analysis: Present a hypothetical AI ethical dilemma and discuss potential outcomes.

  • Resources:

* Report: "AI Ethics Guidelines" (e.g., EU, Google)

* Video: "The Ethical Dilemmas of AI"

Quiz 1: Foundations of AI Assessment

  • Format: 10 Multiple Choice Questions, 5 True/False Questions.
  • Purpose: To assess understanding of AI definitions, history, branches, and ethical considerations.
  • Example Questions:

1. Which of the following is NOT generally considered a branch of Artificial Intelligence? (a) Machine Learning (b) Natural Language Processing (c) Thermodynamics (d) Computer Vision

2. True or False: Strong AI aims to replicate human-level intelligence in all its complexity.

3. The concept of an "AI Winter" refers to: (a) Periods of intense AI research (b) Periods of reduced funding and interest in AI (c) The use of AI in climate modeling (d) The development of cold-resistant robots.

Hands-on Exercise 1: Exploring AI in Your Daily Life

  • Objective: To identify and analyze AI applications encountered in everyday scenarios and reflect on their impact.
  • Tools/Prerequisites: Internet access, a word processor or presentation software.
  • Steps:

1. Identify: Over the next 24 hours, make a list of at least five distinct AI applications you interact with or observe (e.g., recommendation systems, voice assistants, spam filters, facial recognition on your phone, smart home devices).

2. Analyze: For each identified application, briefly describe:

* What AI branch it primarily belongs to (e.g., ML, NLP, Computer Vision).

* How it enhances your experience or solves a problem.

* One potential ethical concern associated with its use.

3. Reflect: Write a short paragraph (100-150 words) on your overall impression of AI's pervasiveness and its potential for both good and harm.

  • Expected Outcome: A short report or presentation slide deck summarizing your findings and reflections.

Module 2: Introduction to Machine Learning

Module Goal: To provide a foundational understanding of Machine Learning, its types, and the crucial role of data.

Lesson 2.1: What is Machine Learning?

  • Learning Objectives:

* Define Machine Learning (ML) and explain its core principles.

* Differentiate between traditional programming and machine learning approaches.

* Understand the basic workflow of a machine learning project.

  • Key Topics:

* Definition of ML: Learning from data without explicit programming.

* The "Black Box" concept vs. Rule-based systems.

* Key components: Data, Model, Algorithm, Evaluation.

* The ML pipeline: Data collection, preparation, model training, evaluation, deployment.

  • Content Outline:

* Illustrating ML with simple examples (e.g., spam detection).

* Why ML is powerful: Handling complex patterns and adapting to new data.

* Overview of the typical steps in an ML project.

  • Activities/Discussion Points:

* Think-Pair-Share: "If you wanted to teach a computer to identify cats in images, how would you do it with traditional programming vs. machine learning?"

  • Resources:

* Video: "What is Machine Learning?" by Google

* Article: "Machine Learning for Dummies (A Simple Explanation)"

Lesson 2.2: Types of Machine Learning (Supervised, Unsupervised, Reinforcement)

  • Learning Objectives:

* Distinguish between Supervised, Unsupervised, and Reinforcement Learning.

* Identify appropriate ML types for different problem statements.

* Recognize common algorithms associated with each type.

  • Key Topics:

* Supervised Learning: Labeled data, prediction (regression) and classification.

* Unsupervised Learning: Unlabeled data, finding patterns (clustering, dimensionality reduction).

* Reinforcement Learning: Agent, environment, rewards, actions (e.g., game playing).

  • Content Outline:

* Detailed explanation of each ML type with illustrative examples.

* When to use which type of learning.

* Brief mention of semi-supervised learning.

  • Activities/Discussion Points:

* Scenario Matching: Provide several real-world problems and ask participants to identify the most suitable ML type.

  • Resources:

* Infographic: "The Three Types of Machine Learning"

* Interactive Demo: Simple examples of each learning type.

Lesson 2.3: Data Preprocessing and Feature Engineering Basics

  • Learning Objectives:

* Understand why data quality is paramount in ML.

* Identify common data preprocessing steps (cleaning, transformation).

* Grasp the concept of feature engineering and its importance.

  • Key Topics:

* Data Quality Issues: Missing values, outliers, inconsistent formats.

* Preprocessing Techniques:

* Handling Missing Data (imputation, removal).

* Data Normalization/Scaling.

* Encoding Categorical Data (one-hot encoding).

* Feature Engineering: Creating new features from existing ones to improve model performance.

  • Content Outline:

* "Garbage In, Garbage Out": The mantra of data science.

* Practical methods for preparing data for ML models.

* Examples of simple feature engineering.

  • Activities/Discussion Points:

* Mini-Case Study: Given a small, messy dataset, discuss how you would clean and prepare it.

  • Resources:

* Article: "A Gentle Introduction to Data Preprocessing"

* Video: "Feature Engineering Explained"

Quiz 2: Introduction to ML Assessment

  • Format: 10 Multiple Choice Questions, 5 Scenario-based Questions.
  • Purpose: To assess understanding of ML definitions, types, and basic data preparation.
  • Example Questions:

1. Which type of Machine Learning uses labeled data to make predictions? (a) Unsupervised Learning (b) Reinforcement Learning (c) Supervised Learning (d) Deep Learning

2. Identifying and handling missing values in a dataset is part of: (a) Model Training (b) Feature Engineering (c) Data Preprocessing (d) Model Evaluation

3. Scenario: You want to group your customer base into distinct segments based on their purchasing behavior without prior knowledge of these segments. Which type of ML would be most appropriate?

Hands-on Exercise 2: Data Exploration and Cleaning (Conceptual)

  • Objective: To conceptually identify data quality issues and propose solutions for a given dataset.
  • Tools/Prerequisites: Provided hypothetical dataset description.
  • Steps:

1. Review Dataset: Imagine you have a dataset of customer information for an e-commerce site, including columns like CustomerID, Age, Gender, PurchaseHistory (text), LastLoginDate, MembershipTier, and EmailOptIn.

2. Identify Issues: For each column, list potential data quality issues you might find (e.g., missing values, incorrect data types, inconsistencies, irrelevant information).

3. Propose Solutions: For each identified issue, describe a data preprocessing technique you would apply to resolve it.

4. Suggest Features: Propose at least two new features you could engineer from the existing data that might be useful for predicting customer churn (e.g., DaysSinceLastLogin from LastLoginDate).

  • Expected Outcome: A document outlining potential data issues, proposed cleaning steps, and suggested new features.

Module 3: Supervised Learning Deep Dive

Module Goal: To explore the most common Supervised Learning algorithms (Regression and Classification) and understand how to evaluate their performance.

Lesson 3.1: Regression Algorithms (Linear Regression)

  • Learning Objectives:

* Understand the concept of regression and its applications.

* Explain how Linear Regression works intuitively.

* Identify when to use Linear Regression.

  • Key Topics:

* What is Regression? Predicting continuous values.

* Simple Linear Regression: Equation, line of best fit.

* Multiple Linear Regression: Extending to multiple features.

* Assumptions and Limitations of Linear Regression.

  • Content Outline:

* Visualizing regression with scatter plots.

* The goal: Minimizing the error (residual sum of squares).

* Real-world examples: House price prediction, sales forecasting.

  • Activities/Discussion Points:

* Interactive Demo: Adjust a line of best fit on a simple dataset and observe the error change.

  • Resources:

* Video: "StatQuest: Linear Regression"

* Article: "Understanding Linear Regression"

Lesson 3.2: Classification Algorithms (Logistic Regression, Decision Trees)

  • Learning Objectives:

* Understand the concept of classification and its applications.

* Explain the basics of Logistic Regression and Decision Trees.

* Differentiate between different classification problems (binary, multi-class).

  • Key Topics:

* What is Classification? Predicting categorical labels.

* Logistic Regression: Not just for regression! Probabilistic classification.

* Decision Trees: Tree-like structure for decision making, interpretability

training_course_builder.md
Download as Markdown
Copy all content
Full output as text
Download ZIP
IDE-ready project ZIP
Copy share link
Permanent URL for this run
Get Embed Code
Embed this result on any website
Print / Save PDF
Use browser print dialog
\n\n\n"); var hasSrcMain=Object.keys(extracted).some(function(k){return k.indexOf("src/main")>=0;}); if(!hasSrcMain) zip.file(folder+"src/main."+ext,"import React from 'react'\nimport ReactDOM from 'react-dom/client'\nimport App from './App'\nimport './index.css'\n\nReactDOM.createRoot(document.getElementById('root')!).render(\n \n \n \n)\n"); var hasSrcApp=Object.keys(extracted).some(function(k){return k==="src/App."+ext||k==="App."+ext;}); if(!hasSrcApp) zip.file(folder+"src/App."+ext,"import React from 'react'\nimport './App.css'\n\nfunction App(){\n return(\n
\n
\n

"+slugTitle(pn)+"

\n

Built with PantheraHive BOS

\n
\n
\n )\n}\nexport default App\n"); zip.file(folder+"src/index.css","*{margin:0;padding:0;box-sizing:border-box}\nbody{font-family:system-ui,-apple-system,sans-serif;background:#f0f2f5;color:#1a1a2e}\n.app{min-height:100vh;display:flex;flex-direction:column}\n.app-header{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:40px}\nh1{font-size:2.5rem;font-weight:700}\n"); zip.file(folder+"src/App.css",""); zip.file(folder+"src/components/.gitkeep",""); zip.file(folder+"src/pages/.gitkeep",""); zip.file(folder+"src/hooks/.gitkeep",""); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nnpm run dev\n\`\`\`\n\n## Build\n\`\`\`bash\nnpm run build\n\`\`\`\n\n## Open in IDE\nOpen the project folder in VS Code or WebStorm.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n"); } /* --- Vue (Vite + Composition API + TypeScript) --- */ function buildVue(zip,folder,app,code,panelTxt){ var pn=pkgName(app); var C=cc(pn); var extracted=extractCode(panelTxt); zip.file(folder+"package.json",'{\n "name": "'+pn+'",\n "version": "0.0.0",\n "type": "module",\n "scripts": {\n "dev": "vite",\n "build": "vue-tsc -b && vite build",\n "preview": "vite preview"\n },\n "dependencies": {\n "vue": "^3.5.13",\n "vue-router": "^4.4.5",\n "pinia": "^2.3.0",\n "axios": "^1.7.9"\n },\n "devDependencies": {\n "@vitejs/plugin-vue": "^5.2.1",\n "typescript": "~5.7.3",\n "vite": "^6.0.5",\n "vue-tsc": "^2.2.0"\n }\n}\n'); zip.file(folder+"vite.config.ts","import { defineConfig } from 'vite'\nimport vue from '@vitejs/plugin-vue'\nimport { resolve } from 'path'\n\nexport default defineConfig({\n plugins: [vue()],\n resolve: { alias: { '@': resolve(__dirname,'src') } }\n})\n"); zip.file(folder+"tsconfig.json",'{"files":[],"references":[{"path":"./tsconfig.app.json"},{"path":"./tsconfig.node.json"}]}\n'); zip.file(folder+"tsconfig.app.json",'{\n "compilerOptions":{\n "target":"ES2020","useDefineForClassFields":true,"module":"ESNext","lib":["ES2020","DOM","DOM.Iterable"],\n "skipLibCheck":true,"moduleResolution":"bundler","allowImportingTsExtensions":true,\n "isolatedModules":true,"moduleDetection":"force","noEmit":true,"jsxImportSource":"vue",\n "strict":true,"paths":{"@/*":["./src/*"]}\n },\n "include":["src/**/*.ts","src/**/*.d.ts","src/**/*.tsx","src/**/*.vue"]\n}\n'); zip.file(folder+"env.d.ts","/// \n"); zip.file(folder+"index.html","\n\n\n \n \n "+slugTitle(pn)+"\n\n\n
\n \n\n\n"); var hasMain=Object.keys(extracted).some(function(k){return k==="src/main.ts"||k==="main.ts";}); if(!hasMain) zip.file(folder+"src/main.ts","import { createApp } from 'vue'\nimport { createPinia } from 'pinia'\nimport App from './App.vue'\nimport './assets/main.css'\n\nconst app = createApp(App)\napp.use(createPinia())\napp.mount('#app')\n"); var hasApp=Object.keys(extracted).some(function(k){return k.indexOf("App.vue")>=0;}); if(!hasApp) zip.file(folder+"src/App.vue","\n\n\n\n\n"); zip.file(folder+"src/assets/main.css","*{margin:0;padding:0;box-sizing:border-box}body{font-family:system-ui,sans-serif;background:#fff;color:#213547}\n"); zip.file(folder+"src/components/.gitkeep",""); zip.file(folder+"src/views/.gitkeep",""); zip.file(folder+"src/stores/.gitkeep",""); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nnpm run dev\n\`\`\`\n\n## Build\n\`\`\`bash\nnpm run build\n\`\`\`\n\nOpen in VS Code or WebStorm.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n"); } /* --- Angular (v19 standalone) --- */ function buildAngular(zip,folder,app,code,panelTxt){ var pn=pkgName(app); var C=cc(pn); var sel=pn.replace(/_/g,"-"); var extracted=extractCode(panelTxt); zip.file(folder+"package.json",'{\n "name": "'+pn+'",\n "version": "0.0.0",\n "scripts": {\n "ng": "ng",\n "start": "ng serve",\n "build": "ng build",\n "test": "ng test"\n },\n "dependencies": {\n "@angular/animations": "^19.0.0",\n "@angular/common": "^19.0.0",\n "@angular/compiler": "^19.0.0",\n "@angular/core": "^19.0.0",\n "@angular/forms": "^19.0.0",\n "@angular/platform-browser": "^19.0.0",\n "@angular/platform-browser-dynamic": "^19.0.0",\n "@angular/router": "^19.0.0",\n "rxjs": "~7.8.0",\n "tslib": "^2.3.0",\n "zone.js": "~0.15.0"\n },\n "devDependencies": {\n "@angular-devkit/build-angular": "^19.0.0",\n "@angular/cli": "^19.0.0",\n "@angular/compiler-cli": "^19.0.0",\n "typescript": "~5.6.0"\n }\n}\n'); zip.file(folder+"angular.json",'{\n "$schema": "./node_modules/@angular/cli/lib/config/schema.json",\n "version": 1,\n "newProjectRoot": "projects",\n "projects": {\n "'+pn+'": {\n "projectType": "application",\n "root": "",\n "sourceRoot": "src",\n "prefix": "app",\n "architect": {\n "build": {\n "builder": "@angular-devkit/build-angular:application",\n "options": {\n "outputPath": "dist/'+pn+'",\n "index": "src/index.html",\n "browser": "src/main.ts",\n "tsConfig": "tsconfig.app.json",\n "styles": ["src/styles.css"],\n "scripts": []\n }\n },\n "serve": {"builder":"@angular-devkit/build-angular:dev-server","configurations":{"production":{"buildTarget":"'+pn+':build:production"},"development":{"buildTarget":"'+pn+':build:development"}},"defaultConfiguration":"development"}\n }\n }\n }\n}\n'); zip.file(folder+"tsconfig.json",'{\n "compileOnSave": false,\n "compilerOptions": {"baseUrl":"./","outDir":"./dist/out-tsc","forceConsistentCasingInFileNames":true,"strict":true,"noImplicitOverride":true,"noPropertyAccessFromIndexSignature":true,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"paths":{"@/*":["src/*"]},"skipLibCheck":true,"esModuleInterop":true,"sourceMap":true,"declaration":false,"experimentalDecorators":true,"moduleResolution":"bundler","importHelpers":true,"target":"ES2022","module":"ES2022","useDefineForClassFields":false,"lib":["ES2022","dom"]},\n "references":[{"path":"./tsconfig.app.json"}]\n}\n'); zip.file(folder+"tsconfig.app.json",'{\n "extends":"./tsconfig.json",\n "compilerOptions":{"outDir":"./dist/out-tsc","types":[]},\n "files":["src/main.ts"],\n "include":["src/**/*.d.ts"]\n}\n'); zip.file(folder+"src/index.html","\n\n\n \n "+slugTitle(pn)+"\n \n \n \n\n\n \n\n\n"); zip.file(folder+"src/main.ts","import { bootstrapApplication } from '@angular/platform-browser';\nimport { appConfig } from './app/app.config';\nimport { AppComponent } from './app/app.component';\n\nbootstrapApplication(AppComponent, appConfig)\n .catch(err => console.error(err));\n"); zip.file(folder+"src/styles.css","* { margin: 0; padding: 0; box-sizing: border-box; }\nbody { font-family: system-ui, -apple-system, sans-serif; background: #f9fafb; color: #111827; }\n"); var hasComp=Object.keys(extracted).some(function(k){return k.indexOf("app.component")>=0;}); if(!hasComp){ zip.file(folder+"src/app/app.component.ts","import { Component } from '@angular/core';\nimport { RouterOutlet } from '@angular/router';\n\n@Component({\n selector: 'app-root',\n standalone: true,\n imports: [RouterOutlet],\n templateUrl: './app.component.html',\n styleUrl: './app.component.css'\n})\nexport class AppComponent {\n title = '"+pn+"';\n}\n"); zip.file(folder+"src/app/app.component.html","
\n
\n

"+slugTitle(pn)+"

\n

Built with PantheraHive BOS

\n
\n \n
\n"); zip.file(folder+"src/app/app.component.css",".app-header{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:60vh;gap:16px}h1{font-size:2.5rem;font-weight:700;color:#6366f1}\n"); } zip.file(folder+"src/app/app.config.ts","import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';\nimport { provideRouter } from '@angular/router';\nimport { routes } from './app.routes';\n\nexport const appConfig: ApplicationConfig = {\n providers: [\n provideZoneChangeDetection({ eventCoalescing: true }),\n provideRouter(routes)\n ]\n};\n"); zip.file(folder+"src/app/app.routes.ts","import { Routes } from '@angular/router';\n\nexport const routes: Routes = [];\n"); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nng serve\n# or: npm start\n\`\`\`\n\n## Build\n\`\`\`bash\nng build\n\`\`\`\n\nOpen in VS Code with Angular Language Service extension.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n.angular/\n"); } /* --- Python --- */ function buildPython(zip,folder,app,code){ var title=slugTitle(app); var pn=pkgName(app); var src=code.replace(/^\`\`\`[\w]*\n?/m,"").replace(/\n?\`\`\`$/m,"").trim(); var reqMap={"numpy":"numpy","pandas":"pandas","sklearn":"scikit-learn","tensorflow":"tensorflow","torch":"torch","flask":"flask","fastapi":"fastapi","uvicorn":"uvicorn","requests":"requests","sqlalchemy":"sqlalchemy","pydantic":"pydantic","dotenv":"python-dotenv","PIL":"Pillow","cv2":"opencv-python","matplotlib":"matplotlib","seaborn":"seaborn","scipy":"scipy"}; var reqs=[]; Object.keys(reqMap).forEach(function(k){if(src.indexOf("import "+k)>=0||src.indexOf("from "+k)>=0)reqs.push(reqMap[k]);}); var reqsTxt=reqs.length?reqs.join("\n"):"# add dependencies here\n"; zip.file(folder+"main.py",src||"# "+title+"\n# Generated by PantheraHive BOS\n\nprint(title+\" loaded\")\n"); zip.file(folder+"requirements.txt",reqsTxt); zip.file(folder+".env.example","# Environment variables\n"); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\npython3 -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\n\`\`\`\n\n## Run\n\`\`\`bash\npython main.py\n\`\`\`\n"); zip.file(folder+".gitignore",".venv/\n__pycache__/\n*.pyc\n.env\n.DS_Store\n"); } /* --- Node.js --- */ function buildNode(zip,folder,app,code){ var title=slugTitle(app); var pn=pkgName(app); var src=code.replace(/^\`\`\`[\w]*\n?/m,"").replace(/\n?\`\`\`$/m,"").trim(); var depMap={"mongoose":"^8.0.0","dotenv":"^16.4.5","axios":"^1.7.9","cors":"^2.8.5","bcryptjs":"^2.4.3","jsonwebtoken":"^9.0.2","socket.io":"^4.7.4","uuid":"^9.0.1","zod":"^3.22.4","express":"^4.18.2"}; var deps={}; Object.keys(depMap).forEach(function(k){if(src.indexOf(k)>=0)deps[k]=depMap[k];}); if(!deps["express"])deps["express"]="^4.18.2"; var pkgJson=JSON.stringify({"name":pn,"version":"1.0.0","main":"src/index.js","scripts":{"start":"node src/index.js","dev":"nodemon src/index.js"},"dependencies":deps,"devDependencies":{"nodemon":"^3.0.3"}},null,2)+"\n"; zip.file(folder+"package.json",pkgJson); var fallback="const express=require(\"express\");\nconst app=express();\napp.use(express.json());\n\napp.get(\"/\",(req,res)=>{\n res.json({message:\""+title+" API\"});\n});\n\nconst PORT=process.env.PORT||3000;\napp.listen(PORT,()=>console.log(\"Server on port \"+PORT));\n"; zip.file(folder+"src/index.js",src||fallback); zip.file(folder+".env.example","PORT=3000\n"); zip.file(folder+".gitignore","node_modules/\n.env\n.DS_Store\n"); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\n\`\`\`\n\n## Run\n\`\`\`bash\nnpm run dev\n\`\`\`\n"); } /* --- Vanilla HTML --- */ function buildVanillaHtml(zip,folder,app,code){ var title=slugTitle(app); var isFullDoc=code.trim().toLowerCase().indexOf("=0||code.trim().toLowerCase().indexOf("=0; var indexHtml=isFullDoc?code:"\n\n\n\n\n"+title+"\n\n\n\n"+code+"\n\n\n\n"; zip.file(folder+"index.html",indexHtml); zip.file(folder+"style.css","/* "+title+" — styles */\n*{margin:0;padding:0;box-sizing:border-box}\nbody{font-family:system-ui,-apple-system,sans-serif;background:#fff;color:#1a1a2e}\n"); zip.file(folder+"script.js","/* "+title+" — scripts */\n"); zip.file(folder+"assets/.gitkeep",""); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Open\nDouble-click \`index.html\` in your browser.\n\nOr serve locally:\n\`\`\`bash\nnpx serve .\n# or\npython3 -m http.server 3000\n\`\`\`\n"); zip.file(folder+".gitignore",".DS_Store\nnode_modules/\n.env\n"); } /* ===== MAIN ===== */ var sc=document.createElement("script"); sc.src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"; sc.onerror=function(){ if(lbl)lbl.textContent="Download ZIP"; alert("JSZip load failed — check connection."); }; sc.onload=function(){ var zip=new JSZip(); var base=(_phFname||"output").replace(/\.[^.]+$/,""); var app=base.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")||"my_app"; var folder=app+"/"; var vc=document.getElementById("panel-content"); var panelTxt=vc?(vc.innerText||vc.textContent||""):""; var lang=detectLang(_phCode,panelTxt); if(_phIsHtml){ buildVanillaHtml(zip,folder,app,_phCode); } else if(lang==="flutter"){ buildFlutter(zip,folder,app,_phCode,panelTxt); } else if(lang==="react-native"){ buildReactNative(zip,folder,app,_phCode,panelTxt); } else if(lang==="swift"){ buildSwift(zip,folder,app,_phCode,panelTxt); } else if(lang==="kotlin"){ buildKotlin(zip,folder,app,_phCode,panelTxt); } else if(lang==="react"){ buildReact(zip,folder,app,_phCode,panelTxt); } else if(lang==="vue"){ buildVue(zip,folder,app,_phCode,panelTxt); } else if(lang==="angular"){ buildAngular(zip,folder,app,_phCode,panelTxt); } else if(lang==="python"){ buildPython(zip,folder,app,_phCode); } else if(lang==="node"){ buildNode(zip,folder,app,_phCode); } else { /* Document/content workflow */ var title=app.replace(/_/g," "); var md=_phAll||_phCode||panelTxt||"No content"; zip.file(folder+app+".md",md); var h=""+title+""; h+="

"+title+"

"; var hc=md.replace(/&/g,"&").replace(//g,">"); hc=hc.replace(/^### (.+)$/gm,"

$1

"); hc=hc.replace(/^## (.+)$/gm,"

$1

"); hc=hc.replace(/^# (.+)$/gm,"

$1

"); hc=hc.replace(/\*\*(.+?)\*\*/g,"$1"); hc=hc.replace(/\n{2,}/g,"

"); h+="

"+hc+"

Generated by PantheraHive BOS
"; zip.file(folder+app+".html",h); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\nFiles:\n- "+app+".md (Markdown)\n- "+app+".html (styled HTML)\n"); } zip.generateAsync({type:"blob"}).then(function(blob){ var a=document.createElement("a"); a.href=URL.createObjectURL(blob); a.download=app+".zip"; a.click(); URL.revokeObjectURL(a.href); if(lbl)lbl.textContent="Download ZIP"; }); }; document.head.appendChild(sc); } function phShare(){navigator.clipboard.writeText(window.location.href).then(function(){var el=document.getElementById("ph-share-lbl");if(el){el.textContent="Link copied!";setTimeout(function(){el.textContent="Copy share link";},2500);}});}function phEmbed(){var runId=window.location.pathname.split("/").pop().replace(".html","");var embedUrl="https://pantherahive.com/embed/"+runId;var code='';navigator.clipboard.writeText(code).then(function(){var el=document.getElementById("ph-embed-lbl");if(el){el.textContent="Embed code copied!";setTimeout(function(){el.textContent="Get Embed Code";},2500);}});}