How to identify, and solve, when you can't autograde a submission

example of an autogrtade error, with contents trimmed

There are three broad cases here:

  1. The students submission is not listed,
  2. The student is listed, but the autograde process can't find the notebook, or
  3. The student is listed, but the autograde process is throwing up some other error.

Quick notes on the grading system, and what students can do to a notebook:

Submission not listed

In this situation, the most probable cause is the student has simply not submitted their work.

You can verify this by checking the set of submissions (see Where student submissions are held below)

[ERROR] No notebooks found, did you forget to run 'nbgrader generate_assignment'?

This appears when the studend has renamed their notebook.

To fix, simply rename their submitted notebook to the correct name, and you will be able to autograde (again, see Where student submissions are held below)

Duplicated noted cells

There are two basic variations on this:

  1. A noted cell has been duplicated, or
  2. A noted cell has had its base type changed from a code to markdown (or visa-versa) - usually accompanied by a solution in another cell.

You may find you get one symptom, correct it... which then reveals the other.

Duplicated cell

The full error-message will probably read:

  [ERROR] One or more notebooks in the assignment use an old version
      of the nbgrader metadata format. Please **back up your class files
      directory** and then update the metadata using:

      nbgrader update .
    

This happens when a student uses the Copy Cells and Paste Cells functions of a notebook to create another cell for their answers... not realising this creates a problem.

Fixing is, sadly, not an simple task... and requires some research and investigation on your part. However, these notebooks usually can be fixed.

The first task is to confirm the problem is a duplicated cell. Open a terminal in your noteable session, and cd to where the students notebook has been placed (see Where student submissions are held below).
Run the command "grep grade_id name_of_notebook.ipynb"... output should look something like:

    "grade_id": "cell-5dc080c7963fae78",
    "grade_id": "cell-20379abc01ebabc0",
    "grade_id": "cell-5dc080c7963fae78",
    "grade_id": "cell-7bcf2ae00414cbb4",
    "grade_id": "cell-7a80e5aaf5da35bd",
    "grade_id": "cell-31fbf150874d03de",
    "grade_id": "cell-75cc5d21a954e786",
    "grade_id": "cell-dd6d1c648a226e9b",
    "grade_id": "cell-62648d319eded5cf",
    "grade_id": "cell-108949b47d36371a",
    "grade_id": "cell-00a1cc8013070e7e",
    "grade_id": "cell-a6ac1ab44092a3fd",
    "grade_id": "cell-9b7716c3d522b5eb",
    "grade_id": "cell-9ece6ca205e80ef8",
    "grade_id": "cell-e1314d25ab570465",
    

In this example, the "cell-5dc080c7963fae78" has been repeated... fortunately just twice.... and are the 1st & 3rd noted cells in the notebook.

Having Identified the rough location of the cells, you can compare your source notebook to the students submitted notebook to get an idea of which cells in the students notebook to need to fix.

To fix, we need to check each duplicated cell, and remove the noted marking from all but one... and you will need to determine which is "the right one"

Having identified roughly which cells in the student's submitted notebook may be the duplicates, we need to confirm... so we need to view the metadata for those cells.

Working in the student's submitted notebook:

  1. Enable the ability to edit cell metadata: "View" menu -> "Cell Toolbar" sub-menu -> "Edit Metadata" item
  2. Scroll down to the cell you want to check
  3. Click on the "Edit Metadata" button in the grey toolbar for the specific cell
  4. Change the metadata as needed, then save (the [edit] button)
    • What you edit depends on the problem, but for the most part, you'll need to remove the "nbgrader": {...} section from the incorrect cells
    • If you need to delete a duplicated noted cell, you need to remove the "deletable": false entry in the cells metadata.

Base type changed

The full error-message will read something like:

  Failed validating 'required' in notebook:

  On instance:
  {'cell_type': 'markdown',
  'execution_count': None,
  'metadata': {'deletable': False,
                'nbgrader': {'cell_type': 'code',
                            'checksum': '98f0602b716b1846fcd998f6f67580c0',
                            'grade': False,
                            'grade_id': 'cell-5dc080c7963fae78',
                            'locked': False,
                            'schema_version': 3,
                            'solution': True,
                            'task': False}},
  'outputs': ['...0 outputs...'],
  'source': '### my code'}
    

This usually occurs when the student creates an answer underneath the answer cell you provided... then changes the original cell to be a comment.

The simplist fix is to remove the "nbgrader": {...} metadata from the now wrong cell to the new answer cell.