Jupyter Logo

Why I Won’t Use nbgrader#

I use Jupyter Lab to teach CIS-15: Python Programming for Everyone. My assignments are distributed as Jupyter Notebooks that are filled out by students and turned in. Some assignments have automated checking that students can use to see how I will evaluate their code. Sounds like a job for nbgrader, but it’s not for me and here’s why.

Jupyter Notebook Assignments#

It’s convenient to hand out notebook files (*.ipynb) using Canvas LMS. When I give an assignment I just attach the file and set due dates, etc. The notebook has a code cell for students to complete. Then they download the notebook from my JupyterHub server and submit it to Canvas. Downloading (and re-downloading) the notebooks is a little bit of a hassle and sometimes students accidentally submit a blank notebook, but the process is common to many computer tasks and most students find it easy. There’s nothing Python or Jupyter specific they have to know.

The notebooks describe the assignment and may have some exercises to do. When I have time (and when it’s possible) I embed self-check code into the assignment notebook. Usually the last cell has code that runs a few unit tests and shows the results. I encourage students to use the “checker” to evaluate their code and find bugs. In places where my requirements may be ambiguous, the checker is the referee. Knowing they’ve met requirements helps students feel confident to tinker and explore. In my upcoming sabbatical I plan to embed unit testing code in all of my assignments.

What is nbgrader?#

According to their documentation:

nbgrader is a tool that facilitates creating and grading assignments in the Jupyter notebook. It allows instructors to easily create notebook-based assignments that include both coding exercises and written free-responses. nbgrader then also provides a streamlined interface for quickly grading completed assignments.

In simple terms nbgrader is:

  1. A system for creating template notebooks and processing them into student and instructor versions.

  2. A test framework that gives students instant feedback on their code.

  3. A system for distributing and collecting notebooks.

  4. A system for grading submissions and publishing grades.

But all I want a way to give students feedback on their code. The rest is stuff that’s impossible to separate.

Testing Notebooks#

I’m planning on building software that makes it easy to embed unit test code into a notebook that provides useful feedback to students. My goals are:

  1. Pure Python

    1. Fully installable by pip

    2. Uses IPython kernel integration (not JupyterLab plugins)

  2. The same document for everyone. No compiling a source document into a student document

  3. Easy for students to use and understand

There are some anti-goals too:

  1. No automated scoring or grading.

nbgrader duplicates too much functionality in Canvas and is a system that I have to maintain. It think nbgrader is cool but it’s an example of maximal design that makes it unfit for my goals.