Grading with Jupyter notebook

For auto-grading Jupyter notebook you can always extract the source code using nbextract and then use the Vocareum grading APIs. 

For Python notebooks there is another solution available on Vocareum platform - 

  1. Select "Scripts and Resources". Select View=>Jupyter. This will launch Jupyter notebook server from the "work" directory.
  2. When you create a cell, you have following options for the source cells - 
  • Read-only - This cell will not be editable by the student. Before auto-grading this cell will be replaced by the original cell in case student submission has any changes to this cell.
  • Auto grader tests - This cell is identified as a test block. The student will not be able to edit the cell. When you select it, you will be asked to select a criterion that was specified in the Part setting section. When auto grading is executed, if an assertion is triggered in this cell, the student will be assigned maximum points for this rubric, 0 otherwise.

3. After you have created the notebook, switch to "Standard View" - 

5. Copy the notebook you just created from the "work" directory to "Starter code". When the assignment is published, the student will be presented with a notebook that is derived from the starter code.

Special tags in starter code

Any section of python cell starting with ### BEGIN SOLUTION will be stripped out until ### END SOLUTION is encountered and will be replaced with # YOUR SOLUTION HERE

In the auto-grader test cell of the starter code, if the platform encounters ### BEGIN HIDDEN TESTS, the code following it will be removed until ### END HIDDEN TESTS is reached. Note that the removed section will be replaced before the auto-grader is run.

Auto-grading

There are two utilities functions that you need to add to your submission/grading scripts for auto-grading to run - 

  • vocCheckNotebook  <notebook>
    • This prepares the student notebook for grading. It checks if any of the auto-grade tests blocks have been modified and replaces them with the original block if needed.
  • vocGradeNotebook <notebook>
    • This script grades the notebook. 

Still need help? Contact Us Contact Us