jmshea / jupyterquiz Goto Github PK
View Code? Open in Web Editor NEWAn interactive Quiz generator for Jupyter notebooks and Jupyter Book
License: MIT License
An interactive Quiz generator for Jupyter notebooks and Jupyter Book
License: MIT License
when I run the sample code on jupyterlab, I get the following error:
File /lib/python3.11/site-packages/jupyterquiz/dynamic.py:158, in display_quiz(ref, num, shuffle_questions, shuffle_answers, preserve_responses, border_radius, question_alignment, max_width, colors)
156 url = ref
157 if sys.platform == 'emscripten':
--> 158 from pyodide import open_url
159 text = open_url(url).read()
160 script+=text
ImportError: cannot import name 'open_url' from 'pyodide' (/lib/python311.zip/pyodide/__init__.py)
import pyodide
jupyterlite==0.1.0
jupyterquiz==2.5.2
pyodide==0.23.0
For some homework assignments, I ask multiple choice questions (without any feedback and I set all answers as true) inside a Jupyter Notebook with the intent of grading the students' response when they submit their notebooks. However, when I open a notebook, the quiz resets and I can't see the output like I would from any other code cell.
First, I would like to thank you for such a great tool.
Since you randomize answers and this is always welcome, I think there is no need to set a number to correct answer. You can always set it to the first one.
Also, I wonder how can I include an image in my question or its answers
Thanks in advance
Mohamed Ali
This code has not yet been tested with MathJax 3, but I have tried to call the appropriate function to re-typeset the page when feedback is added.
Hii. Thanks for the awesome package.
Is it possible to change the layout of the answers?
I need to provide a wide range of answers (about ten options), so it would be great if they were spread horizontally instead.
I would like to implement my own UI in React.js. Looking at the source I see that the python code is generating the javascript
jupyterquiz/jupyterquiz/dynamic.py
Lines 185 to 209 in d51c154
Is there a way to decouple more Python from JavaScript so that 3rd party UI can be implemented on top of this library?
Is it possible to directly preserve the response in a variable instead of displaying it in the next cell?
Have you considered having polls? Something that, when you click on it, shows the distribution. Like Twitter or LinkedIn polls. I think having polls is a great way to hook students on a topic they are hesitant to learn. For example, if they see that the majority of people are thinking wrong about something after seeing the distribution, then they'd be psyched to want to learn to become the minority :)
I'd be very happy to help with this since we are planning to use it in our newly funded educational project at https://c4r.io/about-us/
It is not correct to assume that everyone is running the same version of all the libraries in their virtual environments. For example I tried running test.ipynb and got the following error. I am pretty sure either I have a later version of the importlib library that depreciated the files method or an earlier version that does not have it defined.
File ~/Documents/workspace/jupyterquiz/jupyterquiz/dynamic.py:126, in display_quiz(ref, num, shuffle_questions, shuffle_answers, preserve_responses, border_radius, question_alignment, max_width, colors)
124 styles+= "}\n\n"
125 #print(styles)
--> 126 f = importlib.resources.files(package).joinpath('styles.css')
127 css = f.read_bytes()
128 styles += css.decode("utf-8")
AttributeError: module 'importlib.resources' has no attribute 'files'
Please include requiremnts.txt so we know which library versions work with this framework. BTW I am macbook M1 Pro running Ventura 13.5.1
Thanks!
When authoring a self-contained notebook for rendering as a Jupyter Book, it's presumably easy enough to put question and answer definitions into a removed code cell in the final book output.
However, if the notebook is used as a notebook, the answers are evident in the code cell.
In such a case, it might be useful to pop the question and answer dictionary into the cell metadata as a JSON object and then render that into the multiple choice widget?
It's a bit of a faff for the notebook author having to edit the metadata cell, but it would keep the notebook self-contained and the answer source hidden to some extent.
I'm running a workshop in which students run JupyterLite inside their browser on their own laptops, which is much more convenient than having to sort out a running JupyterLab environment for them. Doe anyone have any experience of getting jupyterquiz to run within this enviroment? Is it even possible, given that things like urllib.request
don't work in the jupyterlite sandbox?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.