Skip to content

Repository files navigation

Python Programming Learning Platform

A knowledge graph-based learning platform that helps students learn Python programming concepts through an adaptive testing system.

Overview

This project uses Neo4j graph database to model relationships between Python programming concepts (topics) and creates a personalized learning path based on student performance. The system includes:

  • Knowledge Graph: Topics and their prerequisite relationships stored in Neo4j
  • Adaptive Testing: AI-powered question generation and evaluation
  • Progress Tracking: PostgreSQL database for storing student answers and progress
  • Web Interface: Flask-based API for student interaction

Project Structure

.
├── app.py                      # Main Flask application
├── main.py                     # Alternative entry point
├── database.py                 # Neo4j database operations
├── postgres_db.py              # PostgreSQL database operations
├── judge.py                    # AI-based answer evaluation
├── seed.py                     # Database seeding script
├── models/
│   └── Phi-3-mini-4k-instruct-q4.gguf  # Local LLM model
└── [debug/test files]          # Various debugging and testing utilities

Prerequisites

  • Python 3.8+
  • Neo4j Database
  • PostgreSQL Database
  • Required Python packages (see Installation)

Installation

  1. Clone the repository

    git clone <your-repo-url>
    cd skillgraph
  2. Install dependencies

    pip install -r requirements.txt
  3. Download the LLM model

    python download_model.py

    The model file (Phi-3-mini-4k-instruct-q4.gguf) will be downloaded to the models/ directory.

  4. Set up environment variables

    Copy .env.example to .env and update with your credentials:

    cp .env.example .env

    Edit .env with your actual database credentials.

  5. Set up databases

    • Install and start Neo4j
    • Install and start PostgreSQL
    • Verify connections with:
      python check_db.py
  6. Seed the knowledge graph

    python seed.py

Configuration

The application uses environment variables for configuration. See .env.example for all available options:

  • Neo4j: URI, username, password
  • PostgreSQL: host, database name, username, password, port

Usage

  1. Start the application

    python app.py
  2. Access the API

    • The server runs on http://localhost:5000
    • Use the provided endpoints to interact with the learning platform

API Endpoints

  • POST /submit - Submit student answers for evaluation
  • GET /next-topic - Get the next recommended topic
  • Additional endpoints defined in app.py

Knowledge Graph Structure

The system models Python concepts as a directed graph where:

  • Nodes: Programming topics (e.g., Variables, Loops, Functions)
  • Edges: REQUIRES relationships showing prerequisites
  • Properties: Difficulty levels (Easy, Medium, Hard)

Knowledge Graph Visualization

Testing

Run the test files to verify functionality:

python test_api.py
python test_submit.py
python test_frontend_call.py

Debugging Tools

  • check_db.py - Verify database connections
  • debug_neo4j.py - Debug Neo4j queries
  • diagnose.py - System diagnostics
  • force_repair.py - Database repair utilities

Security Notes

  • Never commit .env file to version control
  • Keep your database credentials secure
  • The .gitignore file is configured to exclude sensitive files

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Acknowledgments

  • Uses Phi-3-mini-4k-instruct model for AI evaluation
  • Built with Flask, Neo4j, and PostgreSQL

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages