IPython notebooks in Open edX?

873 views
Skip to first unread message

Ned Batchelder

unread,
May 4, 2015, 5:15:38 PM5/4/15
to edx-...@googlegroups.com
Hi,

A really interesting technology in the Python world are IPython (now called Jupyter) notebooks. These let you embed Python code into a running textual narration.  The code is live, and can be executed in-place, with graphics and charts live as well.

As an example, here's Peter Norvig explaining the Traveling Salesman Problem: the http://nbviewer.ipython.org/url/norvig.com/ipython/TSPv3.ipynb

Has anyone done any work to combine notebooks with Open edX?  It would be very cool to do assessments by having students enter code live into a notebook, with the grade being reported back to Open edX.

--Ned.

John Zornig

unread,
May 4, 2015, 7:48:46 PM5/4/15
to edx-...@googlegroups.com
Hi Ned,

We use them at UQx when analysing data from the edX data packages. We learned the technique from folk at MIT.

JZ

--
You received this message because you are subscribed to the Google Groups "General Open edX discussion" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/edx-code/CAGtJPNN6Q_hf%2BVXHX_qx4sd%3D4scR_k3LdpnDZy0fffHqKRUU%2BA%40mail.gmail.com.

Colin Fredericks

unread,
May 5, 2015, 9:12:51 AM5/5/15
to edx-...@googlegroups.com
I have several faculty members who would be interested in this sort of thing. The barrier was always running the external server for the python. 

Grading was problematic because only the output of the code was graded, so if someone knew what they wanted to return... they could just return it. I'm probably going to use more Open Response questions for that, having students grade each others' code drafts.

Wes Turner

unread,
May 25, 2015, 3:17:36 PM5/25/15
to edx-...@googlegroups.com
https://github.com/ipython/ipython/wiki/Install:-Docker#links-to-jupyter-hub (for hosting 1 or more *containerized* Notebook servers)
https://github.com/jupyter/nbgrader (for grading notebooks)
  * someone on ipython-dev mentioned adding RESTful views and buttons (to nbviewer, I believe) for submitting notebooks
http://mail.scipy.org/pipermail/ipython-dev/2015-February/015911.html (IPython/Jupyter notebooks -> EdX transforms -> EdX course)

Julia Mullen

unread,
Nov 21, 2017, 10:33:14 AM11/21/17
to General Open edX discussion

  Hi,

  Where does this stand now?  I looked through the documentation to see if there were instructions on incorporating and integrating Jupyter notebooks into open edX xblocks - are there? 
 
   and pointers and help is appreciated.

   Thanks,
       Julie

Wes Turner

unread,
Nov 21, 2017, 1:35:33 PM11/21/17
to edx-...@googlegroups.com


On Tuesday, November 21, 2017, Julia Mullen <julia....@gmail.com> wrote:

  Hi,

  Where does this stand now?  I looked through the documentation to see if there were instructions on incorporating and integrating Jupyter notebooks into open edX xblocks - are there?  

I just found this:

> nginx + django + docker architecture to host notebooks embedded from open-edx hosted MOOCs

Official support from edX for Jupyter integration really would be worth funding.


 
   and pointers and help is appreciated.

BinderHub builds Docker containers from e.g Git repos and then creates an instance of that Docker image and hosts it with a JupyterHub (e.g. hosted in a cloud).



JupyterHub hosts Jupyter instances with authentication (e.g. OAuth; IDK about using edX users as JupyterHub users with individual Docker image instance containers with nbgrader/xblock)




 


   Thanks,
       Julie


On Monday, May 25, 2015 at 3:17:36 PM UTC-4, Wes Turner wrote:
https://github.com/ipython/ipython/wiki/Install:-Docker#links-to-jupyter-hub (for hosting 1 or more *containerized* Notebook servers)
https://github.com/jupyter/nbgrader (for grading notebooks)
  * someone on ipython-dev mentioned adding RESTful views and buttons (to nbviewer, I believe) for submitting notebooks
http://mail.scipy.org/pipermail/ipython-dev/2015-February/015911.html (IPython/Jupyter notebooks -> EdX transforms -> EdX course)

On Tuesday, May 5, 2015 at 8:12:51 AM UTC-5, Colin Fredericks wrote:
I have several faculty members who would be interested in this sort of thing. The barrier was always running the external server for the python. 

Grading was problematic because only the output of the code was graded, so if someone knew what they wanted to return... they could just return it. I'm probably going to use more Open Response questions for that, having students grade each others' code drafts.


On Monday, May 4, 2015 at 5:15:38 PM UTC-4, Ned Batchelder wrote:
Hi,

A really interesting technology in the Python world are IPython (now called Jupyter) notebooks. These let you embed Python code into a running textual narration.  The code is live, and can be executed in-place, with graphics and charts live as well.

As an example, here's Peter Norvig explaining the Traveling Salesman Problem: the http://nbviewer.ipython.org/url/norvig.com/ipython/TSPv3.ipynb

Has anyone done any work to combine notebooks with Open edX?  It would be very cool to do assessments by having students enter code live into a notebook, with the grade being reported back to Open edX.

--Ned.  

--
You received this message because you are subscribed to a topic in the Google Groups "General Open edX discussion" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/edx-code/9f2cee30-fdb3-491e-9397-7ec34375fd1b%40googlegroups.com.

Nate Aune

unread,
Dec 7, 2017, 8:48:02 PM12/7/17
to General Open edX discussion
We're spinning up Jupyter notebooks from within Open edX courses using our Container Launcher XBlock, but I'd love to see a deeper integration whereby one could embed a Jupyter Notebook directly in the edX course, and even talk to the NBGrader API to retrieve scores and return these to edX for student grading purposes.

Miguel Amigot II

unread,
Apr 25, 2018, 12:46:33 PM4/25/18
to General Open edX discussion
The new jupyter-viewer-xblock (https://github.com/ibleducation/jupyter-viewer-xblock) allows to embed notebooks dynamically from a public URL.

Julia Mullen

unread,
Apr 25, 2018, 1:56:11 PM4/25/18
to edx-...@googlegroups.com
Hi Miguel,

Thanks for sharing this, it is very nice.  I have a couple of quick questions:
   1. you refer to this as a viewer - is the student able to interact with the notebook?  For example can the student run cells and modify commands and run them?
   2. if interaction is possible, how do you handle the case where the student makes a mistake and wants to modify a cell and rerun it?
   3. along the same lines, if the student works on the notebook but wants to come back later, does the student see the same notebook or a new clean version
   4. can the student get a new "clean" version?

We have a crude solution and have started working on converting it to an xblock but put it aside for a bit.  I'll take a look at the git repo.

I would love to chat with you at the Open edX conference next month - perhaps we can find some time to talk about this.

Thanks,
    Julie




--
Julia S. Mullen, Ph.D
​Computational Scientist​
​SME High Performance Computing​

Wes Turner

unread,
Apr 25, 2018, 2:16:25 PM4/25/18
to edx-...@googlegroups.com

John Mark

unread,
Apr 25, 2018, 3:06:25 PM4/25/18
to General Open edX discussion
Nice work, everyone. Since this thread is now 3 years old, I'm dubbing it "night of the living thread" 

;)

Lorena Barba

unread,
May 1, 2018, 4:52:26 AM5/1/18
to General Open edX discussion
Hi Julie,

Long time, no see! When was the last time?

IBL are working with me on these Jupyter integrations. We'll be presenting our progress at Open edX Con in a few weeks:

The XBlock that Miguel posted about on Aug. 25 is, indeed, a viewer. It provides no connection to a JupyterHub, or anything like that. 

The idea is that an instructor (like me) writes the course first on Jupyter notebooks. These are like a computable textbook, and of course all openly licensed and available on GitHub. Then she wants to make an online course or MOOC. But she is not planning on making a video-based MOOC, of course. She will integrate the content from the notebooks, and then add assessments, discussions, etc., to craft the learning sequences.

The Jupyter viewer permits adding the content into the course with simply the URL to the public notebook. You can add a whole notebook, or sections of it, using `start` and `end` tags.

Here is my Open edX instance:

My latest course, “Get Data Off the Ground with Python,”  is using the new XBlock
I added the second half of this course using the XBlock, and it took me less than an hour.
You’ll have to enroll to see it, but it’s worth it.

In Open edX, each Section of the course corresponds to one notebook (one full “lesson”).
The notebook content is broken down in Sub-Sections and Units within the online course, forming a learning sequence after adding in topic discussions, quiz questions and other assessments, (a few!) short videos…

To provide a way to interact with the notebooks fully, I'm embedding Binder buttons within the course. Binder is a free service from the Jupyter project, and it launches a dockerized instance of JupyterHub with a set of notebooks in a GitHub repo, using a requirements file deposited by the author in the repo. 
With Binder, I can provide a "computable experience" to the learners in the free version of the online course. (On campus, I provide a full-fledged JupyterHub, with SSO using university credentials).

Our current WiP is an XBlock to run notebooks through nbgrader, to deliver graded assessments based on Jupyter within Open edX. Stay tuned!

I'm also planning to write a blog post expanding on what I say here.

Cheers!
Lorena.

p.s. the origin of this thread is actually an email exchange I was having with Ned in April 2015 about all these ideas ... perseverance! :–D

Julia Mullen

unread,
May 1, 2018, 2:13:20 PM5/1/18
to edx-...@googlegroups.com
Hi Lorena, 

Perseverance indeed!  I have been following this for a bit - I think I posted a note asking how it was coming about a year ago.  Thank you for the clarification and information on the course. I will register for your course because we are looking at offering computational experiences as well.  Currently we run our Jupyter Hub on our supercomputer so that folks can have a simple experience while learning.  That said, our open edX courses support preparation for HS summer students and your solution might be the appropriate solution for those courses.  

How long will you be in Montreal?  I would love to get together and chat about this and some general HPC education topics as well.  I am driving up from Mass to Montreal on Monday and will head out on Thursday night.  Will you have some time to chat - perhaps we can catch a meal.  

Let me know - 
   Julie

--
You received this message because you are subscribed to a topic in the Google Groups "General Open edX discussion" group.

Lorena Barba

unread,
May 19, 2018, 9:04:07 PM5/19/18
to General Open edX discussion
Hi Julia,

We announced the new integration a few days ago: https://twitter.com/LorenaABarba/status/996523241161330690

This is the Graded Jupyter Notebook XBlock, allowing an instructor to create a graded sub-section in Open edX based on an nbgrader-instrumented Jupyter notebook. The instructor uploads the assignment notebook (instructor version after setting auto-graded cells with their score values), uploads a `requirements.txt` file with needed libraries, and sets the number of allowed tries and a couple of other parameters. The student downloads the notebook and solves the assignment in their local Jupyter or a cloud service (JupyterHub, Azure Notebooks, CoCalc, etc.). When the student uploads their solved assignment, it gets immediately auto-graded by nbgrader in a container—the score gets sent back to the XBlock and gets displayed to the student (detail by graded cell), and gets automatically added to their progress in the Open edX gradebook.

Here is a demo of the XBlock usage: https://youtu.be/SwRAs8_FIdo

and here is a post on the blog of or tech partners.

I'm so excited about this and I can't wait to create more courses with it!

Let me know what you think,
Lorena.

p.s. BTW, I think the Jupyter Viewer XBlock is currently the best way to display code in an Open edX course.

Wes Turner

unread,
May 19, 2018, 9:15:09 PM5/19/18
to edx-...@googlegroups.com
Thanks!

--
You received this message because you are subscribed to a topic in the Google Groups "General Open edX discussion" group.

Lorena Barba

unread,
Jun 2, 2018, 1:45:34 PM6/2/18
to General Open edX discussion
Hi all,

Here's the video of our talk at the Open edX Conference, about these Jupyter integrations:

Here's the talk brief: http://sched.co/EUAl

Cheers,
Lorena.
Reply all
Reply to author
Forward
0 new messages