How to Create a Lesson

๐Ÿ“ฝ๏ธ Watch & Learn

HD Expand your knowledge

This guide walks you through how to design, build, and deploy an interactive coding lesson using lesson.html and cover.html. These layout templates are part of a modular system that makes it easy for teachers to assemble consistent, polished, and engaging lessons. The system supports multimedia, code execution, student input, live feedback, and collaborative tools.


๐Ÿ”— Sample Lesson: Want to see what a final lesson looks like? View a live example here.


๐Ÿ“ Step 1: Understand the Purpose of Each File

๐Ÿงฉ lesson.html (Base Layout)

This is the core layout used by all coding lessons. It defines the structure and style and includes embedded functionality such as localStorage, animations, and in-browser code execution. Think of this as the underlying skeleton.

โœ… You do not need to modify this file. It automatically wraps your lesson content.
  • Stylish code formatting and dark theme styling
  • Popcorn Hack support for both JavaScript and Python
  • Feedback poll integration for student input
  • Smooth section animations
  • Automatic saving of responses via local storage

๐Ÿงช function.html (Lesson Template)

This file demonstrates how to use the function.html base layout and inject lesson-specific content. It contains the content area, lesson instructions, and references to interactive components. Put this file inside the lessons inside the navigation directory.

At the top is a YAML frontmatter block that sets the lesson metadata:

layout: lesson
title: Introduction to Functions
video_url: https://youtube.com/yourvideo
hack_prompt: Write a function that adds two numbers.
permalink: /functions
flashcard: functions_flashcard
game: functions_game
category: ['Lesson']

Youโ€™ll customize this file every time you create a new lesson.


๐Ÿ› ๏ธ Step 2: Create a New Lesson File

  1. Duplicate cover.html
    Rename it based on your lesson topic: loops.html, arrays.html, etc.
  2. Edit the Frontmatter
    Update:
    • title: Displayed at the top of the lesson
    • video_url: YouTube video to support the topic
    • hack_prompt: Coding challenge or discussion question
    • permalink: The URL path for the lesson
  3. Write Your Lesson Content
    Inside <div id="lesson-content">, add your instructions, code snippets, visuals, and explanations.
<div id="lesson-content">
  <h2>What is a Loop?</h2>
  <p>Loops let you run the same block of code multiple times.</p>
  <pre><code>for (let i = 0; i < 5; i++) {
    console.log(i);
  }</code></pre>
</div>

Feature Flowchart

๐Ÿงฉ Step 3: Add Interactive Components

Pick the features that fit your lesson. All components are modular and easy to include:

Feature Include Syntax Description
๐Ÿ“บ Video Playerinclude video.htmlShows a YouTube video defined in frontmatter
โœ๏ธ Whiteboard Viewerinclude whiteboard.htmlLets students see a live whiteboard via board code
๐Ÿค– AI Quiz Toolinclude ai_comprehension.htmlStudents can generate practice questions using AI
๐Ÿ’ป Code Promptinclude hack.htmlLets students type, run, and save code responses
๐Ÿƒ Flashcardsinclude flashcards.htmlPulls cards from YAML, allows flipping, review, tracking
๐Ÿ“ Student Notesinclude flashcard-notes.htmlStudents build and review their own flashcards
๐ŸŽฎ Quiz Gameinclude game.htmlMultiplayer quiz game with leaderboard and timers
๐Ÿ‘ Pollinclude poll.htmlStudents rate the lesson and add comments
๐Ÿง  Sidebarinclude slim_sidebar.htmlTools: dictionary, notes, read-aloud, highlights

๐Ÿ” Step 4: Check and Deploy

  1. โœ… Verify Includes Exist
    If you added include game.html, make sure that file exists in your project.
  2. ๐Ÿงช Test the Page
    Open the file in a local preview environment. Interact with every component:
    • Click through flashcards
    • Enter and run code
    • Submit the poll
    • Try the AI comprehension checker
  3. ๐Ÿš€ Deploy It
    Once everything works, publish it to your lesson site or LMS.

๐Ÿ‘ฉโ€๐Ÿซ Best Practices for Teachers

  • Keep Each Lesson Focused: Target one concept per lesson (e.g., โ€œwhile loopsโ€ or โ€œif statementsโ€).
  • Use Visuals Early: Embed videos or show a whiteboard before diving into code.
  • Prompt Reflection: Include polls, notes, or AI questions to get students thinking.
  • Encourage Review: Use flashcards at the end to reinforce terminology.
  • Save Time with Reusables: Once you build a tool like whiteboard.html, you can reuse it in all lessons.

โœ… Summary Checklist

  • [ ] Duplicate cover.html
  • [ ] Fill in frontmatter (title, video, prompt, permalink)
  • [ ] Add content inside lesson-content
  • [ ] Choose and insert interactive components
  • [ ] Confirm include files exist
  • [ ] Preview and test locally
  • [ ] Deploy when everything is working

With this layout system, you can build high-quality, interactive lessons that are modular, student-friendly, and easy to maintain. Whether you're teaching loops, functions, or arrays, these templates give you a powerful way to bring your content to life.


๐Ÿ”ฎ Future Vision

This layout system is already modular and easy to deploy, but it can evolve into a full-fledged interactive learning platform with deeper integration of backend and analytics.

Goals for Expansion

1. User Accounts

  • Add student and teacher login via a Flask backend
  • Use sessions or JWT for secure access control

2. Data Storage & Progress Tracking

  • Migrate all localStorage-based components (code input, flashcards, highlights, quiz answers) to a database (PostgreSQL or MongoDB)
  • Track individual student progress, AI quiz performance, and code history

3. Gamification

  • Teachers can award tokens, badges, or achievements stored in a user profile
  • Completion of tasks like flashcards or code prompts could unlock new content or feedback

4. Teacher Dashboard

  • View all student progress in one place
  • Set deadlines, unlock features per student/class
  • Review code submissions, flashcards created, and quiz attempts

5. Shared Libraries

  • Enable students to share flashcard decks
  • Create a gallery of teacher-curated lessons with import options

Long-Term Vision

By layering backend support and real-time analytics on top of the existing modular system, this framework could become a lightweight LMS that is:

  • Interactive and student-friendly
  • Data-rich for teachers
  • Easy to maintain and extend for developers
1/16

Flashcards (Static)

1/16

Answer:

Displays pre-loaded flashcards with definitions for review.

๐Ÿ” Marked for Review

    ๐Ÿƒ Use these flashcards to review each interactive component: what it does, where it goes, and when to use it in a lesson.

    ๐Ÿ“š Flashcard Notes

    0 / 0

    ๐Ÿ“ You can also add your own flashcards about additional features or customization ideas as you experiment with the layout system.

    Extra Practice

    ๐Ÿง 
    AI Comprehension Checker