Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

labquiz is a Python package that allows you to seamlessly integrate interactive quizzes directly into Jupyter notebooks β€” useful for labs, tutorials, practical assignments, continuous assessment, and controlled exams.

It combines:

And it comes with two optional companion tools:

Together, these components make up the LabQuiz ecosystem, which is distributed as a bundle, labquizbundle.


Figure: Overview of the LabQuiz ecosystem. Dashed arrows indicate optional components. YAML quizzes drive both interactive notebooks and exports, monitored via a dashboard producing analytics, marks tables, and student reports.


# From PyPI
   pip install labquizbundle

or individually, e.g.

   pip install labquiz

They can also be installed from source e.g.

# From source
pip install git+https://github.com/jfbercher/labquiz.git#subdirectory=quiz_editor

with subdirectories meta (the bundle) , quiz_nb (for labquiz), quiz_editor and quiz_dash.


1.1πŸš€ Why LabQuiz?ΒΆ

LabQuiz is designed for active learning and controlled assessment in computational notebooks.

It helps instructors:

It helps students:


1.2🚠 What LabQuiz Does¢

Inside your notebook, you can:

Example:

from labquiz import QuizLab

quiz = QuizLab(URL, "my_quiz.yml", retries=2, exam_mode=False)
quiz.show("quiz1")

1.3πŸ“Έ ExamplesΒΆ

1.3.1Multiple-choice question (with hints & correction)ΒΆ

MCQ Example

1.3.2Numerical questionΒΆ

Numeric Example

1.3.3Template-based question (dynamic variables)ΒΆ

Template ExampleTemplate ExampleTemplate Example

1.4🧩 Question Types, Pedagogical modes, Logging¢

1.4.1Question typesΒΆ

LabQuiz supports four types:

TypeDescription
mcqStandard multiple-choice
numericNumerical answers with tolerance
mcq-templateContext-dependent MCQ
numeric-templateContext-dependent numerical questions

Template questions allow dynamic evaluation based on runtime variables β€” ideal for practical lab computations.

Example:

quiz.show("quiz54", a=res1, b=res2)

Variables can also be generated dynamically

quiz.show("quiz54", autovars=True)

The expected solution is dynamically computed using Python expressions.

1.4.2Pedagogical modesΒΆ

LabQuiz supports three pedagogical modes:

Quizzes are defined in simple YAML format and support

1.4.3πŸ“Š Remote Logging & DashboardΒΆ

All data can be stored in a Google Sheet backend.

LabQuiz can log: Validation events, Parameters, User answers, Integrity hashes... LabQuiz also includes multiple anti-cheating mechanisms (Machine fingerprinting, Source hash verification, Detection of parameter tampering, Optional encrypted question files, Runtime integrity daemon...)


1.5βš™οΈ InstallationΒΆ

1.5.1From PyPIΒΆ

pip install labquiz

1.5.2From sourceΒΆ

pip install git+https://github.com/jfbercher/labquiz.git

Import:

import labquiz
from labquiz import QuizLab

Instantiate:

quiz = QuizLab(URL, QUIZFILE,
               retries=2,
               needAuthentication=True,
               mandatoryInternet=False)

1.6πŸ›  Additional ToolsΒΆ

1.6.1✏️ quiz_editor β€” Build & Export Question BanksΒΆ

Creating YAML files manually is possible β€” but quiz_editor is intended to make it easier. It can also be useful outside of LabQuiz as a general quiz-editor with export capabilities and large markdown support (including images, tables, equations, etc).

1.6.1.1Key features:ΒΆ

Online version: πŸ‘‰ https://jfb-quizeditor.streamlit.app/

Install locally:

pip install quiz-editor
Quiz Editor

1.6.2πŸ“Š quiz_dash β€” Real-Time Monitoring & CorrectionΒΆ

quiz_dash is the companion dashboard for instructors.

It connects to your Google Sheet backend and provides:

Online version: πŸ‘‰ https://jfb-quizdash.streamlit.app/

DashboardDashboard

1.6.3🌍 Optional: Zero Installation with JupyterLite¢

LabQuiz can run entirely in the browser using JupyterLite (WASM). Perfect for fully web-based lab environments.

1.7πŸ“¦ EcosystemΒΆ

ToolPurpose
labquizNotebook quiz engine
quiz_editorQuestion bank creation & export
quiz_dashMonitoring & correction dashboard

πŸ“¦ Repositories:

https://github.com/jfbercher/labquiz is a multipackage repository, that includes the bundle, and

Online tools:


1.8🎯 Typical Workflow¢

  1. Prepare questions (YAML or quiz_editor)

  2. Optionally encrypt file

  3. Create Google Sheet backend

  4. Instantiate QuizLab in notebook

  5. Run lab / test / exam

  6. Monitor using a python console or with quiz_dash

  7. Post-correct with adjustable grading


1.9🏁 Demonstration¢

See:


1.10πŸ“œ LicenseΒΆ

GPL-3.0 license