Moodle integration with Jupyter notebooks

Moodle integration with Jupyter notebooks

by Ely Pa -
Number of replies: 8

Hi All,

  I was wondering if there is any plugin that allows Moodle integration with Jupyter notebooks, i.e. to be able to add a Jupyter notebook as an activity into a course. And in case there's nothing around, any suggestion about how this could be developed?


Cheers,

e.

Average of ratings: -
In reply to Ely Pa

Re: Moodle integration with Jupyter notebooks

by Mark Johnson -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

We have implemented support for Jupyter/Ipython notebooks as part of our OpenStudio plugin which unfortunately hasn't been publicly released yet.

Essentially users are allowed to upload a notebook exported from Jupyter for other users to view and comment on.  Users need to put the .ipynb file and the exported .html rendering in a zip and upload it.  There are some validation checks that the contents of the zip looks correct (basically that it contains the right kind of files, and the ipynb is valid JSON with the fields we'd expect).  The html export is then displayed to users in an iframe, with a download link for the ipynb file.

Implementing something similar as a separate resource plugin shouldn't be too difficult for someone.

In reply to Mark Johnson

Re: Moodle integration with Jupyter notebooks

by Tony Ballantyne -

I'm interested in Jupyter notebook support too. Do you have a timeframe on the OpenStudio plugin?

In reply to Tony Ballantyne

Re: Moodle integration with Jupyter notebooks

by Mark Johnson -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Unfortunately there's not a plan to release OpenStudio at the moment.

In reply to Mark Johnson

Re: Moodle integration with Jupyter notebooks

by Ger Tielemans -

We have lecturers who teach Math, Python, R and are jumping between Moodle en Jupyter Notebook to allow students use editors with code evaluate options. I found in Moodle the Sage filter which connects to a SageCell server.
Sage had a Sage Notebook, but is now creating a version (8.1) on top of Jupyter Notebook: http://www.sagemath.org/

If you wish to use the complete functionality of Jupyter (and the new JupyterLab) you stick to that,
but why not have the option to connect to the server and borrow editor boxes you merge in a Moodle book, so you can combine the options from Moodle with such editors? 

The Sage plugin asks now for code between the sage tags like [sage]1+2[/sage] and shows only the result.

If you change the plugin in your own moodle (see below) it can also offer Sage in editor mode  [sage]...[/sage] and then you can type - in Moodle -  code like in the two attachments.

If you wish to create a "Jupyter-like" Moodle book you wish to offer students combinations of text with empty editors and editors already filled with code where students have to press the evaluate button like [sage]example code[/sage]

BUT: when there  are symbols in the code like < or > our Moodle/server combination FIRST replaces < with:   & l t ; 
If you press " evaluate" you get an error, but if you manually put the code symbol back and then press it works fine...

How to overrule this Moodle rewrite action?




Attachment icon375.png
Attachment icon377.png
In reply to Ger Tielemans

Re: Moodle integration with Jupyter notebooks

by Ger Tielemans -

In the new version of the plugin the < > problem is solved !!

SageCell 1.06 (2018013000)

Average of ratings: Useful (1)
In reply to Mark Johnson

Re: Moodle integration with Jupyter notebooks

by Tony Hirst -

The OpenStudio plugin requires users to upload a zip file with an .nbk suffix that contains the notebook .ipynb file and an html export view of it; (the html view can be a bit ropey eg if the notebook has run output cells that originally contained iframes). A crude notebook extension provides a toolbar button to create the .nbk package that uses nbconvert html_embed filter to generate the html.


The original proposal was for an OpenStudio plugin architecture that would allow .ipynb to be uploaded and then rendered back to users of OpenStudio using nbviewer. That was blocked, presumably on grounds of complexity, available project time/resource and maybe also security...

In reply to Ely Pa

Re: Moodle integration with Jupyter notebooks

by Dirk Grunwald -

There's a group that has integrated Jupyter Notebook to Open edX - see https://openedx2018.sched.com/event/EUAl


Perhaps something similar could be done for moodle.