Git Product home page Git Product logo

Comments (6)

jmshea avatar jmshea commented on May 20, 2024

I am definitely open to ideas. A few comments:

  1. That particular code is from capture_resonses() and is non-functional -- that was something that I was trying to get to work but couldn't because of the way that Jupyter Lab stores HTML from cell operations right after the cell is run but not later if that HTML is updated via Javascript. I left it in for now, but will probably delete it from the main branch for clarity.

  2. I am outputting Javascript in display_quiz() in order to allow the Python code to pass the quiz data to Javascript in lots of different ways (list of dicts, file name, URL, ...). This is implemented in the big if statement starting a line 67. One really important component to this is that in Jupyter Book, if the quiz data is specified to be pulled from a file, the quiz data from when the Jupyter notebook was run will be saved and used as a fallback if the page is accessed offline in the future.

  3. In addition, I'm creating a new HTML DIV from Python that will be in the output cell, and I am passing the ID of that div to the Javascript function by hard-coding it into the Javascript when the Python is run (lines 129, 148, and 151).

I am definitely a hack at all of the different components (Python, Javascript, HTML, CSS) that make this library work, so I am interested in any ideas you have.

from jupyterquiz.

echarles avatar echarles commented on May 20, 2024

Thx for the inputs @jmshea. I need a bit more time to try and look at the internals.

To be sure, the library is running on jupyter notebook, jupyterlab and jupyterbook, right?

Have you considered ipywidgets as solution to implement the functionality? That may be a big machinery not needed, just curious if you have thoughts on that.

from jupyterquiz.

jmshea avatar jmshea commented on May 20, 2024

This has been tested with Jupyter Notebook, Jupyter Lab, and Jupyter Book.

This library was made primarily to satisfy my own needs for embedding quizzes in a Jupyter Book document. That requires that the quiz can be delivered without any Python running. It does this by embedding JavaScript into the Jupyter Book page. As an additional requirement, I want it to be styleable so that I can make my online book look nice. I don't know if ipywidgets can achieve those goals.

from jupyterquiz.

luukalt avatar luukalt commented on May 20, 2024

Hi All,

I think your package is very interesting and you guys deliver awesome work. Although I cannot help you solve this problem I was curious about the plugin you (@jmshea) mention in the README:

The requirement that the student copy and paste the text output to preserve it is because of limitations in the exchange of information from the JavaScript side to the Python side. As far as I know, the only way around this requires a plug-in, and I do not want to require that. I will continue to investigate solutions to this in the future.

Is this an existing plugin? And does this plugin work in combination with Jupyter Book?

Thanks in advance.

from jupyterquiz.

jmshea avatar jmshea commented on May 20, 2024

There is not a Jupyter plugin to do this (as far as I know). I am just trying to convey that I don't think I can achieve the requested behavior with just Python and/or Javascript.

I don't understand what you mean about working in combination with Jupyter Book. The plug-in mentioned would be for saving responses in a Jupyter Notebook. But Jupyter Book is typically for making a web or pdf version of the Notebook. Where would the responses be saved? (I could save them in local web storage, but the original point of saving the responses was to allow them to be submitted for grading.)

from jupyterquiz.

jmshea avatar jmshea commented on May 20, 2024

Closing this as there hasn't been any change in status on this for a long time.

from jupyterquiz.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.