How to submit Notebooks#

We will use the Canvas integration of Gradescope for submission and feedback on Notebooks.

This is my first time using gradescope – from what I can tell, it works exceptionally well for giving feedback on student’s work – but there might be a bit of a learning curve for me especially in the administration part of things.

If you have used Gradescope in your work as TA or in your other classes and have suggestions for me, please don’t be shy – I would really appreciate them!

You will need to create a PDF file from your notebook.

Unfortunaly, the ‘print-to-PDF’ does not do a great job of formatting the notebook. Therefore please follow these instructions:

1. Download a .ipynb from Google Colab#

(If you are working locally on your computer, you can skip this step)

  • 1a. Download you notebook to your computer using the Colab menu (and not the browser menu)
    File > Download > Download .ipynb

  • 1b. Check the size of your downloaded file – if it is 1kB only, it means that you used the browser menu instead of the Colab menu in the previous step.

2. In this webpage, use the button to open this page in Colab#

  • 2a. Use the button to open this webpage in Colab

  • 2b. Then click on the “File Directory” icon on the left

  • 2c. Drag the ipynb file to upload it to this Colab enviroment.

  • 2d. In the code cell below, change the Filename for the name of your .ipynb file and run it to create a PDF file.

!sudo apt-get install texlive texlive-latex-extra texlive-xetex pandoc
!jupyter nbconvert --to pdf /content/[Insert your filename here].ipynb
  • 2e. The PDF file should appear in the left file bar. Right click to download.

  • 2f. Make sure that all of the material is displayed properly. If you have issues, don’t hesitate to ask.

If you are working locally in your python environment instead of Colab, you can pip install or conda install the tetex package once, and covert your ipynb files directly using the code above.

For example with my mini-conda distribution, I did

conda install nbconvert

once, then in the directory with my notebook I convert the notebook with:

jupyter-nbconvert --to pdf NameOfNotebook.ipynb

3. How to upload your PDF to Gradescope#

  • 3a. Open the Canvas assigment and follow the prompt to upload your PDF file.

  • 3b. Gradescope will ask you to select pages for each “Question” in the assignement – there is only one “Question”, so select all of the pages in your PDF.