A JupyterHub service for managing course members in the e2x ecosystem. This service provides a web interface for graders to manage students and other graders in their courses.
- Course Management: View and manage courses you have grader access to
- Member Management: Add/remove students and graders from courses
- JupyterHub Integration: Automatically create users in JupyterHub when adding course members
- Role-based Access: Only graders can manage course membership
- Web Interface: Clean, responsive UI built with Grid.js and SweetAlert2
Course management interface showing available courses
Managing course members - adding and removing students and graders
pip install --no-cache-dir git+https://github.com/Digiklausur/e2x-course-service.git
Or for development:
git clone https://github.com/Digiklausur/e2x-course-service
cd e2x-course-service
pip install -ve .
The service requires the following environment variables:
JUPYTERHUB_SERVICE_PREFIX
: The URL prefix for the serviceJUPYTERHUB_API_TOKEN
: API token for authenticating with JupyterHub
The service expects course data to be organized in the following directory structure:
course_base_path/
├── course1/
│ ├── student/
│ │ └── course1-semester1.csv
│ └── grader/
│ └── course1-semester1.csv
└── course2/
├── student/
│ └── course2-semester1.csv
└── grader/
└── course2-semester1.csv
Each CSV file should contain a Username
column with the usernames of course members.
from e2x_course_service.app import CourseServiceApp
app = CourseServiceApp()
app.course_base_path = "/path/to/course/data"
app.port = 10101
app.start()
Add to your JupyterHub configuration:
c.JupyterHub.services = [
{
'name': 'course-service',
'url': 'http://localhost:10101',
'command': [
'python', '-m',
'e2x_course_service.app',
'--CourseServiceApp.course_base_path=/path/to/course/data,
'--CourseServiceApp.port=10101'
],
}
]
Add the role for the course-service:
c.JupyterHub.loadRoles = [
{
'name': 'course-service',
'description': 'allow access to the course service',
'services': ['course-service'],
'scopes': [
'self',
'access:services!service=course-service',
'admin:users',
'list:users',
'delete:users'
]
},
{
'name': 'user',
'description': 'basic user access to course service',
'scopes': [
'self',
'access:services!service=course-service'
]
}
]
The frontend is built using esbuild:
cd ui
npm install
npm run build
npm run format # Format JavaScript
ruff check . # Check Python code
GET /api/courses
- List courses for the current userGET /api/course_members
- Get members of a specific coursePUT /api/course_members
- Update course membershipDELETE /api/course_members
- Remove members from a course
MIT License - see LICENSE for details.