Comments (6)
I am definitely open to ideas. A few comments:
-
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. -
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 bigif
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. -
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.
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.
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.
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.
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.
Closing this as there hasn't been any change in status on this for a long time.
from jupyterquiz.
Related Issues (13)
- Test with MathJax 3 HOT 1
- Jupterquiz in Jupyterlite notebook HOT 6
- How to Layout answers horizontally? HOT 7
- Jupyter polls? HOT 5
- Preserve Response in Variable HOT 5
- import error in jupyterlite HOT 4
- Parse question and answer from cell metadata HOT 17
- Javascript Error: MathJax.typeset is not a function HOT 10
- Issue with answer not wrapping HOT 1
- requirements.txt not defined! HOT 3
- Preserve_Quizzes_with_Student_Answers HOT 1
- the default answer HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jupyterquiz.