LabQuiz is a Python package that allows to integrate interactive quizzes directly into Jupyter notebooks — useful for labs, tutorials, practical assignments, continuous assessment, and controlled exams
Project description
Sponsor:
LabQuiz is a Python package that allows 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 streamlit app | src code - 📊
quiz_dash— Monitor, correct, and analyze results in real time streamlit app | src code
- 👉🏼
Live versionTry it in binder Installation:
# From source
pip install git+https://github.com/jfbercher/labquiz.git
# or from PyPI
pip install labquiz
🚀 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
🚠 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")
📸 Examples
Multiple-choice question (with hints & correction)
Numerical question
Template-based question (dynamic variables)
🧩 Question Types, Pedagogical modes, Logging
Question 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.
Pedagogical 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
📊 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...)
⚙️ Installation
From PyPI
pip install labquiz
From 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)
🛠 Additional Tools
✏️ quiz_editor — Build & Export Question Banks
Creating YAML files manually works — but quiz_editor is intended to makes it easier. It can also be useful outside ob LabQuiz as a general quiz-editor with export capabilities.
Key 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)
- 📝 HTML exam version (Google Sheet connected)
- 📄 AMC–LaTeX format (paper exams)
Online version: 👉 https://jfb-quizeditor.streamlit.app/
Install locally:
pip install quiz-editor
📊 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
- 🔄 Automatic recalculation
- 📥 CSV export of results
Online version: 👉 https://jfb-quizdash.streamlit.app/
🌍 Optional: Zero Installation with JupyterLite
LabQuiz can run entirely in the browser using JupyterLite (WASM). Perfect for fully web-based lab environments.
📦 Ecosystem
| Tool | Purpose |
|---|---|
| labquiz | Notebook quiz engine |
| quiz_editor | Question bank creation & export |
| quiz_dash | Monitoring & correction dashboard |
📦 Repositories:
- https://github.com/jfbercher/labquiz
- https://github.com/jfbercher/quiz_editor
- https://github.com/jfbercher/quiz_dash
Online tools:
🎯 Typical Workflow
- Prepare questions (YAML or
quiz_editor) - Optionally encrypt file
- Create Google Sheet backend
- Instantiate
QuizLabin notebook - Run lab / test / exam
- Monitor using a python console or with
quiz_dash - Post-correct with adjustable grading
🏁 Demonstration
See:
labQuizDemo.ipynbinextras/- 👉🏼
Live version👈 Try it in binder
📜 License
GPL-3.0 license
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file labquiz-0.8.10.tar.gz.
File metadata
- Download URL: labquiz-0.8.10.tar.gz
- Upload date:
- Size: 67.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab6242235167987c99368204d9ff76ef13fb1c6774ecb240e03b0b1ea8c5a3b3
|
|
| MD5 |
a4084bee0e41cceaf97b37423a12e244
|
|
| BLAKE2b-256 |
3fa527393641273b774aece35e0b3b6a51e7dd8a4384e6173eb8e22a95fa4f0e
|
File details
Details for the file labquiz-0.8.10-py3-none-any.whl.
File metadata
- Download URL: labquiz-0.8.10-py3-none-any.whl
- Upload date:
- Size: 86.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6642c4f5385f5575068b6f6d586cddd9f883e29538a379a9c0dad2cd5b106c44
|
|
| MD5 |
62977b23b723a49bd07eb0a64839496a
|
|
| BLAKE2b-256 |
b57109e225e26851a4a49932ab00eb0e6ffee2a961d9cdb63dd79bcc80b55f34
|