This notebook tests and demonstrates the jupyterquiz library and its use. It draws from a set of example questions that show the supported capabilities of the jupyterquiz library.
In particular, this notebook also serves to test different ways for the library to load questions:
jupyterquiz supports drawing a random subset of questions, and that is also tested.
$$ \begin{bmatrix} 7 \end{bmatrix}$$from jupyterquiz import display_quiz
git_path="https://raw.githubusercontent.com/jmshea/jupyterquiz/main/examples/"
$~$
display_quiz(git_path+"questions.json")
Using the 'fdsp' color scheme: $1 +1 $
display_quiz(git_path+"questions.json", colors='fdsp')
display_quiz("examples/questions.json",
)
display_quiz("examples/questions.json",
colors={
'--jq-many-choice-bg': '#224dea',
'--jq-multiple-choice-bg': '#a45995'
}
)
import json
with open("examples/questions.json", "r") as file:
questions=json.load(file)
display_quiz(questions, border_radius=0)
# #Leave this here for when doing question development
# import json
# with open("examples/questions.json", "w") as file:
# json.dump(questions, file, indent=4)
display_quiz(git_path+"questions.json",2)
github_preview=[questions[0]]+[questions[2]]
display_quiz(github_preview)
display_quiz(git_path+"questions.json", border_radius=0, question_alignment='center', max_width=1000)