Skip to content

Support correction of ipynb notebooks

Description / Overview

We want to support the correction of Jupyter notebooks for Python exams. In order to that with our current interface we convert the Jupyter notebook into a Python script with comments describing where each cell starts and also comment blocks after each input with the corresponding cell output. Because we want the tutors to have the ability to look at the original notebook in case there are things missing in our script representation (we don't render images). Since the conversion happens in hekctor and not in the backend/frontend we need to store the original .ipynb as well as the rendered version.
grady-corp/rusty-hektor> already supports this rendering of .ipynb notebooks and places it in the normal code field. The original .ipynb is placed under the source_code field.

Use cases

(Who is this for?)

Links / references

Feature checklist

So in order to fully support Jupyter notebooks, the following things need to be done:

Backend

  • add a nullable source_code field to the Submission model
  • add a boolean source_code_available field to the Submissions
    • add this field to the views where needed
  • add a route to the submission view that returns a corresponding source_code if available

Frontend

  • add the optional sourceCode field to the Submission model(s)
  • everywhere student submissions are displayed (don't forget Student views!):
    • if sourceCodePresent is true, show Download original source button in top toolbar
    • when Download original source is clicked, fetch source from backend
Edited by robinwilliam.hundt