Student Projects 2024-25 | University of Birmingham
Student: Runtao Duan (rxd496@student.bham.ac.uk)
Supervisor: Dr. Rachid Anane
Department: School of Computer Science, College of Engineering and Physical Sciences
A web-based programming education platform built upon the Intelligent Tutoring Systems (ITS) three-model architecture (Domain Model, Learner Model, and Tutoring Model), providing personalized learning experiences for novice Python programmers.
Note: Earlier commits were made while testing GitLab usage. The actual project code is included in this latest commit.
This platform addresses the gap between mainstream online coding platforms and research-based intelligent tutoring systems. It provides instant, multi-source feedback through large language models (OpenAI, DeepSeek), implements adaptive scaffolding based on learner behavior, and maintains comprehensive learning analytics for educational research.
- Domain Model: Hierarchical curriculum structure with prerequisite dependencies
- Learner Model: Overlay model tracking progress, attempts, and temporal learning patterns
- Tutoring Model: Rule-based adaptive scaffolding with real-time intervention triggers
- In-browser Code Execution: Secure sandboxed execution via Judge0 API with automatic fallback
- Multi-source AI Feedback: Parallel analysis from multiple LLMs with comparative insights
- Adaptive Scaffolding: Dynamic hint provision based on attempt count, time-on-task, and individual learning patterns
- Real-time Learning Analytics: Comprehensive tracking of coding behavior and learning progression
- Sandboxed Execution: All user code runs in isolated Judge0 containers
- Graceful Degradation: Automatic fallback mechanisms when external services are unavailable
- Secure Authentication: JWT-based stateless authentication with refresh token support
Frontend (Vue 3) ←→ Backend (Flask) ←→ Database (SQLite)
↓ ↓ ↓
CodeMirror 6 RESTful API Learning Analytics
Scaffolding UI Multi-model AI Progress Tracking
Real-time Feedback ←→ Judge0 Integration ←→ Content Management
- Frontend: Vue 3, Vite, Vue Router, Pinia, CodeMirror 6, i18n
- Backend: Flask 2.3, SQLAlchemy, Flask-JWT-Extended, Flask-CORS
- Database: SQLite (PostgreSQL-ready)
- External Services: Judge0 (code execution), OpenRouter (AI feedback)
- Deployment: Docker-ready, Nginx-compatible
- Zone of Proximal Development: Scaffolding triggers based on Vygotsky's ZPD theory
- Personalized Learning: Individual time thresholds adapted from historical performance
- Feedback Effectiveness Tracking: Quantitative measurement of different tutoring approaches
- Real-time Behavioral Monitoring: Millisecond-precision tracking of coding activity
- Multi-model AI Comparison: Concurrent analysis from different LLM providers
- Session-based Time Calculation: Active learning time computation excluding idle periods
- Feedback Loop Closure: Complete data pipeline from intervention to success measurement
git clone https://git.cs.bham.ac.uk/projects-2024-25/rxd496.git
cd rxd496- Python 3.8+
- Node.js 18+
- Git
cd backend
python -m venv venv
venv\Scripts\activate # For Windows PowerShell
pip install -r requirements.txt
cp env.example .env # Configure API keys as needed
python setup_database.py # Initialize with sample data
python app.pyell
cd frontend
npm install
cp env.example .env.local # Configure API endpoints
npm run dev
- Frontend Application:
http://localhost:3000 - API Health Check:
http://localhost:5000/api/health - API Documentation:
http://localhost:5000/
- Username:
admin - Password:
admin123(⚠️ Change in production)
For a complete demonstration of the platform's functionality:
# Quick start for evaluation
git clone https://git.cs.bham.ac.uk/projects-2024-25/rxd496.git
cd rxd496
# Backend setup (Terminal 1)
cd backend; python -m venv venv; venv\Scripts\activate
pip install -r requirements.txt; python setup_database.py
python app.py
# Frontend setup (Terminal 2)
cd frontend; npm install; npm run dev- Demo URL:
http://localhost:3000(after setup) - API Endpoints:
http://localhost:5000/api/ - Admin Panel: Login with admin credentials above
# For deployment purposes
cd frontend; npm run build
# Serves static files from backend at /static/├── backend/ # Flask REST API
│ ├── app.py # Application factory
│ ├── config.py # Configuration management
│ ├── extensions.py # Flask extensions initialization
│ ├── env.example # Environment variables template
│ ├── requirements.txt # Python dependencies
│ ├── setup_database.py # Database initialization script
│ ├── models/ # Database models
│ │ ├── content_models.py # Domain Model (Module/Lesson/Exercise)
│ │ └── learning_models.py # Learner Model (User/Progress/Feedback)
│ ├── routes/ # API endpoints
│ │ ├── auth.py # Authentication
│ │ ├── content.py # Content delivery
│ │ ├── submissions.py # Code submission & evaluation
│ │ ├── admin.py # Content management
│ │ ├── analytics.py # Learning analytics
│ │ ├── chat.py # Chat functionality
│ │ ├── progress.py # Progress tracking
│ │ └── upload.py # File upload handling
│ └── utils/ # Core utilities
│ ├── code_executor.py # Judge0 integration
│ ├── code_analyzer.py # Multi-model AI analysis
│ ├── datetime_utils.py # Date/time utilities
│ └── messages.py # Internationalization
├── frontend/ # Vue 3 SPA
│ ├── index.html # Main HTML template
│ ├── package.json # Node.js dependencies
│ ├── package-lock.json # Dependency lock file
│ ├── vite.config.js # Build configuration
│ ├── vitest.config.ts # Testing configuration
│ ├── tsconfig.json # TypeScript configuration
│ ├── env.example # Environment variables template
│ └── src/
│ ├── App.vue # Root component
│ ├── main.js # Application entry point
│ ├── style.css # Global styles
│ ├── api.js # API client
│ ├── adminApi.js # Admin API client
│ ├── components/ # Reusable components
│ ├── views/ # Page components
│ ├── stores/ # Pinia state management
│ ├── composables/ # Vue composition functions
│ ├── utils/ # Utility functions
│ ├── types/ # TypeScript type definitions
│ ├── styles/ # Additional styling
│ ├── tests/ # Test files
│ ├── directives/ # Vue directives
│ ├── config/ # Configuration files
│ ├── router/ # Vue Router configuration
│ └── i18n/ # Internationalization
├── .gitignore # Git ignore rules
└── README.md # Project documentation
# Environment mode
FLASK_ENV=development
# Server configuration
HOST=0.0.0.0
PORT=5000
DEBUG=true
# Frontend configuration
FRONTEND_URL=http://localhost:3000
FRONTEND_PORT=3000
# Security configuration
SECRET_KEY=your-secret-key-here
JWT_SECRET_KEY=your-jwt-secret-here
# Database configuration (optional, defaults to SQLite)
# DATABASE_URL=sqlite:///learning_platform.db
# DATABASE_URL=postgresql://user:pass@localhost/dbname
# External APIs
# Judge0 API (Code execution service)
JUDGE0_API_KEY=your-judge0-api-key-here
JUDGE0_BASE_URL=https://judge0-ce.p.rapidapi.com
JUDGE0_HOST=judge0-ce.p.rapidapi.com
JUDGE0_TIMEOUT=15
PYTHON_LANGUAGE_ID=71
# OpenRouter API (AI analysis service)
OPENROUTER_API_KEY=your-openrouter-api-key-here
OPENROUTER_BASE_URL=https://openrouter.ai/api/v1
OPENROUTER_TIMEOUT=15# API base URL
VITE_API_BASE_URL=http://localhost:5000/api
# Port configuration
VITE_FRONTEND_PORT=3000
VITE_BACKEND_PORT=5000POST /api/auth/register- User registrationPOST /api/auth/login- User authenticationGET /api/auth/profile- Get user profile
GET /api/content/modules- Retrieve course modulesGET /api/content/lessons/:id- Get lesson details with progressGET /api/content/exercises/:id/hints- Fetch adaptive hints
POST /api/submissions/submit- Submit code for evaluationPOST /api/submissions/exercises/:id/hint- Request scaffolding hintGET /api/submissions/exercises/:id/history- Get submission historyPOST /api/submissions/feedback-rating- Rate feedback effectiveness
GET /api/analytics/user/code_analysis- Personal learning insightsGET /api/analytics/exercise/:id/analysis- Exercise-specific analyticsGET /api/analytics/research/feedback_effectiveness- Research data (Admin)
const shouldShowHintByTime = (exercise) => {
const currentTime = currentTimes.value[exerciseId] || 0
const avgTime = lesson.value?.progress?.avg_time_sec || 0
const attempts = lesson.value?.progress?.attempts || 0
// Fixed threshold: 90 seconds of active coding
if (currentTime > 90) return true
// Personalized threshold: 1.5x individual average time
if (avgTime > 0 && currentTime > avgTime * 1.5) return true
// Attempt-based threshold: 3+ failed submissions
if (attempts >= 3) return true
return false
}- Silent Phase (0-60s): No intervention, allowing independent exploration
- Reminder Phase (60-90s): Subtle hint button availability
- Support Phase (90-120s): Animated breathing effect and enhanced messaging
- Active Phase (120s+): Prominent visual cues and proactive assistance offers
The platform collects comprehensive data for educational research:
- Temporal Patterns: Precise coding session timestamps and durations
- Error Classification: Syntax, logic, runtime, and timeout error categorization
- Scaffolding Usage: Hint request patterns and effectiveness measurement
- Progress Tracking: Lesson completion rates and prerequisite navigation
-- Sample query for research analysis
SELECT
f.feedback_type,
AVG(fe.time_to_success_sec) as avg_resolution_time,
AVG(fe.subsequent_attempts) as avg_attempts,
AVG(fe.helpfulness_rating) as user_satisfaction
FROM feedback_instances f
JOIN feedback_effectiveness fe ON f.feedback_id = fe.feedback_id
WHERE fe.did_succeed = true
GROUP BY f.feedback_type;The platform supports multiple languages with complete UI translation:
- English: Full interface and error messages
- Chinese (Simplified): Complete localization support
- Extensible: Easy addition of new language packs
cd backend
python -m pytest tests/ -v --cov=.cd frontend
npm run test:unit
npm run test:e2e- Code Execution: < 10 seconds end-to-end (Judge0 + AI feedback)
- UI Responsiveness: < 200ms for all user interactions
- Scalability: Tested with concurrent users up to 50+ sessions
# Build and run with Docker Compose
docker-compose up --build -d
# Or build individually
docker build -t its-platform-backend ./backend
docker build -t its-platform-frontend ./frontend- Database: Migrate to PostgreSQL for production workloads
- Web Server: Use Nginx as reverse proxy with Gunicorn
- Monitoring: Implement logging and error tracking
- Security: Update secret keys and enable HTTPS
- Learning Effectiveness: Compare scaffolding strategies across different learner populations
- AI Feedback Quality: Analyze which LLM approaches yield better learning outcomes
- Temporal Learning Patterns: Study how coding session timing affects comprehension
- ITS Architecture Evaluation: Benchmark three-model implementation effectiveness
- Personalization Algorithms: Test different adaptive threshold algorithms
- Multi-modal Feedback: Explore combining AI analysis with static code metrics
This project serves as a research platform. For academic collaborations or technical improvements:
- Fork the repository
- Create a feature branch (
git checkout -b feature/improvement) - Commit changes with clear messages
- Document any research implications
- Submit a pull request with detailed description
This project is developed for academic and research purposes. Please cite this work in academic publications:
@misc{pytutor_ai_2025,
title={PyTutor AI: Interactive Python Intelligent Tutoring Platform - Implementing Adaptive Scaffolding with Multi-source AI Feedback},
author={Runtao Duan},
year={2025},
school={University of Birmingham},
department={School of Computer Science, College of Engineering and Physical Sciences},
type={Master's Thesis},
supervisor={Dr. Rachid Anane},
studentid={2850586}
}
For research inquiries, technical questions, or collaboration opportunities:
- Project: Student Projects 2024-25
- Author: Runtao Duan (Student ID: 2850586)
- Email: rxd496@student.bham.ac.uk
- GitLab Repository: https://git.cs.bham.ac.uk/projects-2024-25/rxd496
- Institution: University of Birmingham
- Department: School of Computer Science, College of Engineering and Physical Sciences
- Thesis Supervisor: Dr. Rachid Anane
- Academic Year: 2024-25
Bridging the gap between scalable online education and personalized intelligent tutoring through adaptive AI-powered scaffolding.
Note: This README file was generated with assistance from Claude 4.0 and subsequently reviewed and edited by the author.