- The nbgrader extension is enabled by default for all users. This can be configured in the
nbgrader_config.py
file. This will be done at a later point. - Sometimes the IP_ADDRESS variable in the
docker-compose.yaml
file needs to be changed to the IP address of the JupyterHub container instance. This is a known issue and will be fixed at a later point. The IP address can be found by runningdocker network inspect jupyterhub-network
in the terminal when the hub is running or you can look it up on docker desktop. The IP address also needs to be changed in thenbgrader_config.py
file of the singleuser image. The image needs to be removed from docker registry and be rebuilt afterwards!
- The
docker-compose.yaml
contains two services:lab
: This is a singleuser JupyterLab instance including nbgrader extensionhub
: This is the JupyterHub container instance, which is used to spawn the singleuser instances
The singleuser image is used to spawn new singleuser instances.
- Docker
- Clone this repository
- Build the singleuser image by running this command:
docker build -t jupyterlab-singleuser ./docker/lab
- Start up the system by running:
docker-compose up
This workflow shows the setup of the system and how it can be used. The workflow is based on the following scenario:
- An admin creates a course and adds an instructor to it
- The instructor adds students to the course
- The instructor creates an assignment and releases it
- The students fetch the assignment, complete it and submit it
- The instructor collects and grades the assignment and releases the feedback
- run
docker-compose up
- go to
localhost:8000
- sign up a new users with usernames
admin1
,instructor1
,user1
,user2
,user3
- login with the
admin1
user - create a new course by opening a terminal in the container and type
cm create_course SP
- add the instructor to the course by typing
cm add_instructor SP instructor1 -f instructor1 -l instructor1 -e instructor1@mail
- login with the
instructor1
user - add the students to the course by typing
cm add_student SP user1 -f user1 -l user1 -e user1@mail
andcm add_student SP user2 -f user2 -l user2 -e user2@mail
in a terminal in the container - create a file called
nbgrader_config.py
in the root directory and insertc.CourseDirectory.course_id = "SP"
- create a folder called
source
. Insert a folder calledSP
and add a notebook to it - open formgrader and generate and release the assignment
- login with the users
user1
anduser2
and fetch, complete and save the assignments - login with the user
user3
-> this user should not be able to see or fetch the assignment - run
docker exec -it jupyter-user1 /bin/bash
and typerm -rf /home/user1/SP/.ipynb_checkpoints
- run
docker exec -it jupyter-user2 /bin/bash
and typerm -rf /home/user2/SP/.ipynb_checkpoints
- submit the assignments
- login with the
instructor1
user - collect and grade the assignment and generate and release the feedback
- logout with all users
- run
docker compose down
To view the courses, assigned instructors and students, login with the admin1 user and head to the following links:
- http://localhost:8000/services/ngshare/courses
- http://localhost:8000/services/ngshare/instructors/SP
- http://localhost:8000/services/ngshare/students/SP
To see other available endpoints, head to http://localhost:8000/services/ngshare/ (not all endpoints are GET-endpoints)
- Fix issue with .ipynb_checkpoint files, so nbgrader does not throw an error when fetching assignments (LibreTexts/ngshare#161)
- Fix issue with fetching feedbach
- Fix issue with IP_ADDRESS variable in docker-compose.yaml file
- Fix issue with ip address in nbgrader_config.py file
- Fix issue with nbgrader extension being enabled by default for all users
- Fix error log (admin1)
- Remove GRANT_SUDO, so new packages can't be installed
- Restrict other ways to cheat / communicate with other students (pip, ...)
- Clean up code