This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
python app.pyThe application will start a Gradio web interface at http://127.0.0.1:7860
# Using uv (recommended)
uv venv -p 3.12
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -r requirements.txt
# Using pip
pip install -r requirements.txtCreate a .env file with:
OPENAI_API_KEY=your_api_key_here
This is an AI Course Assessment Generator that creates learning objectives and multiple-choice questions from course materials. The system uses OpenAI's language models with structured output generation via the instructor library.
- Content Processing: Upload course materials (.vtt, .srt, .ipynb) → Extract and tag content with XML source references
- Learning Objective Generation: Generate base objectives → Group and rank → Enhance with incorrect answer suggestions
- Question Generation: Create multiple-choice questions from objectives → Quality assessment → Ranking and grouping
- Assessment Export: Save final assessment to JSON format
Modular Prompt System: The prompts/ directory contains reusable prompt components that are imported and combined in generation modules. This allows for consistent quality standards across different generation tasks.
Orchestrator Pattern: Both LearningObjectiveGenerator and QuizGenerator act as orchestrators that coordinate calls to specialized generation functions rather than implementing generation logic directly.
Structured Output: All LLM interactions use Pydantic models with the instructor library to ensure consistent, validated output formats.
Source Tracking: Content is wrapped in XML tags (e.g., <source file="example.ipynb">content</source>) throughout the pipeline to maintain traceability from source files to generated questions.
LearningObjectiveGenerator(learning_objective_generator/generator.py): Orchestrates learning objective generation, grouping, and enhancementQuizGenerator(quiz_generator/generator.py): Orchestrates question generation, quality assessment, and ranking
- Learning objectives progress from
BaseLearningObjective→LearningObjective(with incorrect answers) →GroupedLearningObjective - Questions progress from
MultipleChoiceQuestion→RankedMultipleChoiceQuestion→GroupedMultipleChoiceQuestion - Final output is an
Assessmentcontaining both objectives and questions
- Base Generation: Create initial learning objectives from content
- Grouping & Ranking: Group similar objectives and select best in each group
- Enhancement: Add incorrect answer suggestions to selected objectives
- Question Generation: Create multiple-choice questions with feedback
- Quality Assessment: Use LLM judge to evaluate question quality
- Final Ranking: Rank and group questions for output
app.py: Gradio interface with tabs for objectives, questions, and export- Handler modules process user interactions and coordinate with generators
- State management tracks data between UI components
- Default model:
gpt-5with temperature1.0 - Separate model selection for incorrect answer generation (typically
o1) - Quality assessment often uses
gpt-5-minifor cost efficiency
- Supports
.vtt/.srtsubtitle files and.ipynbJupyter notebooks - All content is tagged with XML source references for traceability
- Content processor handles multiple file formats uniformly
The system enforces educational quality through modular prompt components:
- General quality standards apply to all generated content
- Specific standards for questions, correct answers, and incorrect answers
- Bloom's taxonomy integration for appropriate learning levels
- Example-based prompting for consistency