In our latest webinar, we tell you everything you need to know to get started with Jupyter Notebooks (also known as IPython Notebooks) in CodeGrade. We explain how Jupyter Notebooks are structured and how you can best manually grade and give feedback to them using CodeGrade's inline feedback, general feedback and render viewer. Furthermore, we teach you how you can effectively and easily autograde the Python code in Jupyter Notebooks. This webinar was part of our monthly CodeGrade Webinars series and was recorded live on December 3rd 2021, it is available on demand now.
Jupyter Notebook theory
Jupyter Notebooks, formerly known as IPython Notebooks, are files with the `.ipynb` extension. Even though Jupyter Notebooks support multiple programming languages, we most often see them used for Python courses. They combine these "code cells" with text cells (supporting Markdown and LaTeX). This combination makes for a very powerful educational tool that is used not only for courses like Introduction to Python, but also more advanced courses like Machine Learning, Data Science and Computer Vision.
On the inside, a Jupyter Notebook is simply a JSON document. All cells, metadata and output are stored in JSON. It is very important to understand that the output is also statically saved here and can thus be altered manually or be outdated if a Jupyter Notebook has not been run.
Manually Grading Jupyter Notebook
CodeGrade supports Jupyter Notebooks right out of the box and renders the notebook for you. You can then use all of CodeGrade's feedback features to give feedback and grade the Jupyter Notebook manually. You can give feedback on individual cells, lines of code and general feedback over the Jupyter Notebook as a whole.

Automatically running Jupyter Notebooks for manual grading
As mentioned before: the output cells are also saved in the Jupyter Notebook JSON document. This means that when we are grading a Jupyter Notebook handed in by the student in CodeGrade, we are not guaranteed to have the latest version of the output (it can be manually altered by the student or the notebook could not be run). To solve this, we can use CodeGrade AutoTest to automatically run each IPython Notebook immediately after they are handed in. An up-to-date version of the Jupyter Notebook will then show up in the Code Viewer under the AutoTest output:

We can do this with a very simple command in a Run Program step in AutoTest. Add the following command (explained in more detail in the webinar):
-!- CODE language-sh -!- jupyter nbconvert --execute --to notebook
-–output $AT_OUTPUT/jupyter.ipynb $STUDENT/jupyter.ipynb -–allow-errors

%20(800%20x%20525%20px)%20(800%20x%20525%20px)%20(11).png)
%20(800%20x%20525%20px)%20(800%20x%20525%20px)%20(10).png)
%20(800%20x%20525%20px)%20(800%20x%20525%20px)%20(9).png)