I’m new to open edx and I’m currently using edx platform to create a programming course. We put jupyterhub notebook link into iFrame xblock which allows the user to access, write and execute the code without manually logging into jupyterhub. Currently after several configurations on jupyterhub in another server, we are able to load jupyterhub properly.
However, another issue comes up. Since we need to provide a notebook URL when setting up the iframe, all users will access the same notebook and see each other’s work. We hope to give a unique jupyterhub notebook URL to each individual user, something like: jupyterhub/username/folder1/notebook1.ipynb. This design allows each user run their own notebook and be able to keep their notebook.
Is there any way to access username in cookies or API in iframe xblock, and programmatically put it in to iframe src?
username = <“code to get username”>
<src = “domain.com/” + username + “/folder/notebook1.ipynb”>
(sorry I had to add quotes in tags, otherwise we will see an empty iframe :P)
Any help or advice is much appreciated!