Skip to main content

LabQuiz bundle that includes labquiz, quiz-editor, and quiz-dash.

Project description

PyPI version Python versions License Binder Documentation Status

Sponsor:

ESIEE Paris

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.

  • ๐Ÿ‘‰๐Ÿผ Live version Try it in binder !

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

flowchart LR
    %% Nodes
    A["YAML Quiz<br/>(Quiz-as-Code)"]
    B["quiz_editor<br/>Authoring Interface<br/>(optional)"]
    C["Jupyter Notebook<br/>+ Interactive Quizzes"]
    D["Remote Backend<br/>(e.g., Google Sheets)"]
    E["quiz_dash<br/>Monitoring Dashboard"]
    F[Analytics]
    G[Marks Table]
    H[Student Reports]
    I[Exports: <br/>Web-based Training Quizzes <br/>AMC / LaTeX Paper Quizzes]

    %% Flows
    B -.-> A
    A ---> C
    C -.-> D
    D --> E
    E --> F
    E --> G
    E --> H
    A -.-> I
    

    %% Styles
    classDef authoring fill:#e3f2fd,stroke:#1e88e5,stroke-width:1px;
    classDef runtime fill:#e8f5e9,stroke:#43a047,stroke-width:1px;
    classDef backend fill:#fff3e0,stroke:#fb8c00,stroke-width:1px;
    classDef dashboard fill:#f3e5f5,stroke:#8e24aa,stroke-width:1px;
    classDef outputs fill:#fce4ec,stroke:#d81b60,stroke-width:1px;
    classDef export fill:#e0f7fa,stroke:#00838f,stroke-width:1px;

    %% Assign classes
    class A,B authoring;
    class C runtime;
    class D backend;
    class E dashboard;
    class F,G,H outputs;
    class I,J export;

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.


  • 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)

MCQ Example

Numerical question

Numeric Example

Template-based question (dynamic variables)

Template Example


๐Ÿงฉ 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 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/

Dashboard


๐ŸŒ 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:

Online tools:


๐ŸŽฏ 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

๐Ÿ Demonstration

See:

  • labQuizDemo.ipynb in extras/
  • ๐Ÿ‘‰๐Ÿผ Live version ๐Ÿ‘ˆ Try it in binder

๐Ÿ“œ License

GPL-3.0 license

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

labquizbundle-1.0.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

labquizbundle-1.0.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file labquizbundle-1.0.0.tar.gz.

File metadata

  • Download URL: labquizbundle-1.0.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.23

File hashes

Hashes for labquizbundle-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6d7aafee539af1b57e9c31a515b64d23352c1e604c14b5a93bf45c7f19b46e90
MD5 6b57ff4b5c46033d077e0f438f89cbca
BLAKE2b-256 17dce9726af961429c60db6eca66b2aed620ad6b4e4e2bdb98c43b23070a612a

See more details on using hashes here.

File details

Details for the file labquizbundle-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: labquizbundle-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.23

File hashes

Hashes for labquizbundle-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e147587c4d3dbd3db067e9c76f90318a6e739a4e4cab981514440d03ff882692
MD5 2c32aeb2588bceb5e1d2611cba7a02ca
BLAKE2b-256 047f3f168b73c76b0cedeb641a58fe9b11299debf4bb9500fae8512bdfd78a21

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page