Quiz Widget

Quiz Widget

The current quiz slice is a Hugo-rendered widget backed by authored JSON or YAML source, with lightweight browser-side answer checking and a dedicated file-backed quiz editor path.

Architecture:

  • Hugo remains the render authority.
  • Authored quiz definitions live near content as JSON/YAML source files, or inline in the shortcode as a fallback.
  • Browser JS enhances the rendered form for local scoring only.
  • Submission storage is still out of scope.
  • The editor currently supports file-backed quiz definitions, not inline shortcode quiz bodies.

Entry points:

  • layouts/shortcodes/quiz.html
  • layouts/shortcodes/quiz.tex
  • layouts/partials/widgets/quiz-load.html
  • layouts/partials/widgets/quiz.html
  • assets/scss/components/_quiz.scss
  • cdn/custom/quiz.js

Recommended usage:

Quiz source "quizzes/cell-basics.json" was not found as a page resource or readable file.

If the current page is a page bundle, src is resolved against page resources first. If no src is given, the shortcode will parse inline YAML/JSON from its body.

Supported top-level fields:

  • id
  • title
  • eyebrow
  • intro or description
  • submit_label
  • reset_label
  • passing_score
  • questions or items

Supported question fields:

  • id
  • type: single or multiple
  • prompt or question
  • body
  • explanation
  • choices or options
  • correct_answer, correct_answers, or per-choice correct

Supported choice fields:

  • id
  • value
  • text, label, body, or title
  • correct

The runtime reads the rendered answer key from data-correct attributes and computes score in the browser when the user submits the quiz. It does not persist answers and it no-ops while the site is in edit mode.

Editor integration:

  • Rendered quiz widgets now emit data-ql-editable="quiz" plus a provider-readable data-ql-source-path when the shortcode uses src="...".
  • Clicking a rendered quiz in live edit mode opens the Quiz Editor special modal against the source JSON/YAML file.
  • Opening a quiz definition file directly from the file list also routes into the same special modal instead of replacing the markdown editor surface.
  • Inline shortcode quiz bodies currently keep the #quiz-inline sentinel path and remain raw-source only.

TutorLumin partners with QuantaLumin

You’re connecting to your QuantaLumin account on members.quantalumin.com.