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:
β Multiple-choice and numerical questions
π§© Template-based parameterized questions
π Configurable number of attempts
π‘ Hints and detailed feedback
π Automatic scoring
π Optional remote logging (Google Sheets)
π Real-time monitoring dashboard (if logging)
π Integrity checks and anti-tampering mechanisms
And it comes with two optional companion tools:
βοΈ
quiz_editorβ Create, edit, encrypt, and export question banksπ
quiz_dashβ Monitor, correct, and analyze results in real time
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.
ππΌ
Live versionTry it in binderInstallation: All packages can be installed at once (labquiz,quiz_editorandquiz_dash)
# From PyPI
pip install labquizbundleor individually, e.g.
pip install labquizThey can also be installed from source e.g.
# From source
pip install git+https://github.com/jfbercher/labquiz.git#subdirectory=quiz_editorwith 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:
Increase student engagement with embedded exercises
Provide structured feedback during lab sessions
Monitor progress in real time
Run controlled tests and exams
Detect configuration tampering or integrity violations
It helps students:
Learn through interaction and immediate feedback
Track their progress
Work within structured assessment modes
1.2π What LabQuiz DoesΒΆ
Inside your notebook, you can:
β Add multiple-choice questions (
mcq)π’ Add numerical questions with tolerance (
numeric)π§© Create parameterized template questions
π Limit attempts
π‘ Provide hints and corrections
π Compute automatic scores
π Log all activity to a Google Sheet backend (optional)
π Enable exam mode with integrity checks
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)ΒΆ

1.3.2Numerical questionΒΆ

1.3.3Template-based question (dynamic variables)ΒΆ



1.4π§© Question Types, Pedagogical modes, LoggingΒΆ
1.4.1Question typesΒΆ
LabQuiz supports four types:
| Type | Description |
|---|---|
mcq | Standard multiple-choice |
numeric | Numerical answers with tolerance |
mcq-template | Context-dependent MCQ |
numeric-template | Context-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:
Learning mode (hints + correction available, score display)
Test mode (limited attempts, score display but no correction)
Exam mode (no feedback, secure logging)
Quizzes are defined in simple YAML format and support
Logical constraints (XOR, IMPLY, SAME, IMPLYFALSE)
Bonuses and penalties
Relative and absolute tolerances
Variable generation for templates
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 labquiz1.5.2From sourceΒΆ
pip install git+https://github.com/jfbercher/labquiz.gitImport:
import labquiz
from labquiz import QuizLabInstantiate:
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:ΒΆ
Visual question editing (MCQ, numeric, templates)
Categories & tags
Variable generation for templates
Bonus / malus configuration
Logical constraints (XOR, IMPLY, SAME, etc.)
One-click export to:
β YAML
π Encrypted version
π Interactive HTML (training mode), with dynamic support for regenerating variable values in template questions
π HTML exam version (Google Sheet connected)
π AMCβLaTeX format (paper exams), static and dynamic versions (using pythonTeX)
Online version:
π https://
Install locally:
pip install 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:
π Live tracking of submissions
Live class overview
π€ Student-by-student monitoring
π Integrity checks (mode changes, retries tampering, hash verification)
β Adjustable grading weights and scale
π Automatic recalculation
π Full individual corrections available for download
π₯ CSV export of results
Online version:
π https://


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ΒΆ
| Tool | Purpose |
|---|---|
| labquiz | Notebook quiz engine |
| quiz_editor | Question bank creation & export |
| quiz_dash | Monitoring & correction dashboard |
π¦ Repositories:
https://
Online tools:
1.8π― Typical WorkflowΒΆ
Prepare questions (YAML or
quiz_editor)Optionally encrypt file
Create Google Sheet backend
Instantiate
QuizLabin notebookRun lab / test / exam
Monitor using a python console or with
quiz_dashPost-correct with adjustable grading
1.9π DemonstrationΒΆ
See:
labQuizDemo_en.ipynbinextras/ππΌ
Live versionπ Try it in binder
1.10π LicenseΒΆ
GPL-3.0 license