This project contains all the files requiered to build:
- a container image for the instructor with Jupyter notebooks, a Java Kernel and NBGrader to create assignments
- a container image for the students with Jupyter notebooks and a Java Kernel to do the assignments.
Students can run the container installing docker in their computers, inside a small virtual machine (with Alpine Linux and docker) or remotely via JupyterHub. For deployment options you can check (in Spanish):
@Conference{Gutierrez-2023-jupyter-java-nbgrader-jupyterhub-openstack,
author = "Juan Gutiérrez-Aguado and Ignacio García-Fernandez and Manolo Pérez-Aixendri",
title = "Uso de Jupyter notebooks y nbgrader para ofrecer retroalimentación en una asignatura de programación",
year = "2023",
pages = "1-8",
month = "July",
address = "Granada (Spain)",
organization = "AENUI",
}This file contains the following configuration:
- That all the notebooks will be created under a folder named
Tareasand will be located under/home/jovyan. - The folder where the assignments will be deployed by nbgrader is
/srv/nbgrader/exchange. - The instructor will use
//BSOLand//ESOLto write the solution. All the code that is between those comments will be removed when nbgrader generates the student version of the assigments. - Test that are between
//BTESTand//ETESTwill not be included in the student version.
You can adapt all these values to your needs before creating the container image. If you change the CourseDirectory values you will have to adapt that accordingly in the Dockerfile and in the python file remove_test_from_feedback.py.
Configuration for the indentation (3 spaces).
This file a hook is used to remove the solution from the feedback (according to the delimiters defined in container/nbgrader_config.py:
From a base image with Jupyter all the dependencies are installed and the configurations files are copied to the image.
Finally nbgrader is configured to use the folder Tareas (you can change that folder, but remember to be consistent across all provided files).
cd instructor-container
# This instruction assumes that you have docker in your machine
docker build . -t jupyter-java-nbgrader:1.0# This is the folder where the assigments and student versions will be in
# your file system. Adapt to your needs
courseDir=/home/instructor/course/
# Directory with the assignments
dirTareas=$courseDir/Tareas
mkdir -p $dirTareas
# Directory where nbgrader will export the student version of the assignments
dirExchange=$courseDir/exchange
mkdir -p $dirExchange
# Running the container the first time
docker run --name jnb -v $dirExchange:/srv/nbgrader/exchange -v $dirTareas:/home/jovyan/Tareas -p 8888:8888 jupyter-java-nbgrader:1.0
# Check the URL with the token and open your browser
# Stopping the container
docker stop jnb
# Restating the container
docker start jnb
# Check the logs to see the URL and the token
docker logs jnbThis image does not contain the nbgrader extension, and can be uploaded to dockerhub, encapsulated in a VM to be distributed to the studens, or can be used in a JupyterHub deployment.
cd student-container
# This instruction assumes that you have docker in your machine
docker build . -t jupyter-java:1.0There is a folder with an example of the student version (generated by nbgrader) of an assignment about Java Interfaces (this sample notebook is in Spanish). This notebook includes some test, so students can check whether their solutions are correct.