File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 539539 },
540540 "outputs" : [],
541541 "source" : [
542+ " %pip install jupyterquiz\n " ,
542543 " from quizzes import display_quiz\n " ,
543544 " display_quiz(\" quizzes/datatypes.json\" )"
544545 ]
Original file line number Diff line number Diff line change 762762 },
763763 "outputs" : [],
764764 "source" : [
765+ " %pip install jupyterquiz\n " ,
765766 " from quizzes import display_quiz\n " ,
766767 " display_quiz(\" quizzes/datatypes.json\" )"
767768 ]
Original file line number Diff line number Diff line change 1- import sys
2-
3- from importlib .util import find_spec
4-
5- async def _ensure_dependencies ():
6- """Ensure jupyterquiz is installed in Pyodide."""
7- if find_spec ('jupyterquiz' ) is None :
8- import micropip
9- await micropip .install ('jupyterquiz>=2.9' )
10-
11- # Auto-install on import
12- if 'pyodide' in sys .modules : # Only in browser
13- import asyncio
14- # Check if we're in a running event loop
15- try :
16- loop = asyncio .get_running_loop ()
17- # Already in async context, can await directly
18- await _ensure_dependencies ()
19- except RuntimeError :
20- # No running loop, create one
21- asyncio .run (_ensure_dependencies ())
22-
23- # Now import normally
241import jupyterquiz
252
263def display_quiz (json_path ):
You can’t perform that action at this time.
0 commit comments