How to identify, and solve, when you can't autograde a submission
There are three broad cases here:
- The students submission is not listed,
- The student is listed, but the autograde process can't find the notebook, or
- 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:
- when you generate the assignment, the system:
- records the name of each notebook in the assignment,
- for each notebook: records & removes all the hidden tests, mark schemes, and point-awards - noting which cell the data came from.
For the purpose of these notes, lets call these cells noted cells (but also see cell metadata below)
- when you collect student submissions, the system:
- fetched all the (latest) submissions for that assignment, on that course.
- replaces the previous submission, if there was one
- when you autograde a specific students submission, the system:
- copies all the files from the students submitted folder into a parallel autograded tree,
- loops through all the notebooks recorded when the assignment was released, and
- inserts back in all the hidden tests, mark schemes, and point-awards.
- runs the notebook, and records the points awarded from the autograde answer cells
- Students can:
- Insert code and markdown cells anywhere they wish
- Duplicate any cell in the notebook
- Move any cell in the notebook up or down
- Delete any non-noted cells in the notebook
- Delete duplicated noted cells
- Edit any:
- non-noted cells
- any "Autograde answer" and "Manually graded answer" cells
- Students cannot:
- Delete any original noted cells in the notebook
- Edit any "Autograde test", "Manually graded task", or "read-only" cells
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:
- A noted cell has been duplicated, or
- 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:
- Enable the ability to edit cell metadata: "View" menu -> "Cell Toolbar" sub-menu -> "Edit Metadata" item
- Scroll down to the cell you want to check
- Click on the "Edit Metadata" button in the grey toolbar for the specific cell
- 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.