Add quiz slide type
CI / Deploy / test (push) Successful in 41s
CI / Deploy / deploy (push) Skipped

Quiz slides have predefined answers with one or more marked as correct.
The presenter starts the quiz, which then runs until its optional time
limit expires or the presenter ends it. Counts and correct answers are
only revealed once the quiz is finished; participants then see whether
their answer was right.

- migration: slide_options.is_correct, slides.voting_started_at/voting_ends_at
- Slide::isVotingOpen() includes the quiz deadline, expired quizzes are
  closed lazily when the state is read
- presenter countdown, quiz tiles and reveal with correct-answer summary
- CSV export marks quiz answers as right/wrong

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Opus 5.5 committed 2026-11-07 14:39:21 +01:00
1 parent 04cbc5bcd3
commit fd8da4c16c
18 files changed
+999 -43

No files matched your search

+52
View File
@@ -143,6 +143,7 @@ h3 { font-size: 1.05rem; margin-top: 1.6em; }
.badge--type-open { background: #dcf5f0; color: #0b7766; }
.badge--type-scale { background: #fdeed8; color: #9a5a00; }
.badge--type-content { background: #e3eefb; color: #1f6bb0; }
.badge--type-quiz { background: #f1e3fb; color: #7a2fb0; }
.message { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; cursor: pointer; background: var(--surface-2); border-left: 4px solid var(--muted); }
.message.success { border-color: var(--ok); }
@@ -207,6 +208,18 @@ textarea { resize: vertical; }
.type-card--open { border-top-color: var(--c2); }
.type-card--scale { border-top-color: var(--c3); }
.type-card--content { border-top-color: var(--c4); }
.type-card--quiz { border-top-color: var(--c5); }
/* ---------------------------------------------------------------- slide form: quiz answers */
.quiz-options { border: 0; padding: 0; margin: 0 0 16px; }
.quiz-options legend { font-weight: 600; margin-bottom: 4px; }
.quiz-options__list { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 8px; }
.quiz-option { display: flex; gap: 10px; align-items: center; }
.quiz-option input[type=text] { flex: 1; margin: 0; }
.quiz-option__correct { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; padding: 8px 10px; border: 2px solid var(--border); border-radius: 8px; cursor: pointer; font-weight: 600; }
.quiz-option__correct:has(input:checked) { border-color: var(--ok); color: var(--ok); }
.quiz-option__correct input { width: 18px; height: 18px; margin: 0; accent-color: var(--ok); }
.quiz-options.error .quiz-options__list input[type=text] { border-color: var(--danger); }
.join-code { font-size: 2rem; font-weight: 800; letter-spacing: .12em; text-align: center; margin: 0 0 12px; }
.qr { display: block; margin: 0 auto 16px; background: #fff; border-radius: 8px; padding: 6px; }
@@ -247,6 +260,21 @@ textarea { resize: vertical; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(75, 63, 224, .5); } 100% { box-shadow: 0 0 0 24px rgba(75, 63, 224, 0); } }
.prose { font-size: 1.1rem; }
/* quiz (participant) */
.choice--quiz { border-left-width: 8px; border-left-color: var(--c0); font-size: 1.1rem; }
.choice--c1 { border-left-color: var(--c1); }
.choice--c2 { border-left-color: var(--c2); }
.choice--c3 { border-left-color: var(--c3); }
.choice--c4 { border-left-color: var(--c4); }
.choice--c5 { border-left-color: var(--c5); }
.choices--quiz { border: 0; padding: 0; }
.countdown { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin: 8px 0 0; color: var(--muted); }
.countdown__value { font-size: 2rem; font-variant-numeric: tabular-nums; color: var(--text); }
.countdown.is-urgent .countdown__value { color: var(--danger); }
.verdict { font-size: 1.6rem; font-weight: 800; margin: 12px 0 0; }
.verdict--correct { color: var(--ok); }
.verdict--wrong { color: var(--danger); }
/* ---------------------------------------------------------------- results (shared) */
.results-empty { color: var(--muted); font-style: italic; }
.is-hidden { visibility: hidden; }
@@ -304,6 +332,25 @@ textarea { resize: vertical; }
.cloud__word.is-mine .cloud__vote--up, .cloud__word.is-down .cloud__vote--down { background: var(--surface-2); }
.cloud__word.is-down .cloud__vote--up { opacity: .55; }
/* quiz results */
.quiz-status { color: var(--muted); font-style: italic; margin: 0 0 1em; }
.quiz-timer { margin: 0 0 .6em; font-size: 2.6em; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--c5); }
.quiz-timer.is-urgent { color: var(--danger); }
.quiz-timer.is-over { opacity: .5; }
.quiz-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.quiz-tile { padding: .8em 1em; border-radius: 10px; background: var(--surface-2); border-left: .4em solid var(--c0); font-weight: 700; word-break: break-word; }
.quiz-tile--c1 { border-left-color: var(--c1); }
.quiz-tile--c2 { border-left-color: var(--c2); }
.quiz-tile--c3 { border-left-color: var(--c3); }
.quiz-tile--c4 { border-left-color: var(--c4); }
.quiz-tile--c5 { border-left-color: var(--c5); }
.quiz-summary { margin: 0 0 1em; font-size: 1.2em; }
.quiz-summary strong { color: var(--ok); }
.bar--correct .bar__fill { background: var(--ok); }
.bar--correct .bar__label { color: var(--ok); }
.bar--wrong .bar__fill { background: var(--muted); opacity: .6; }
.bar.is-mine .bar__label { text-decoration: underline; text-underline-offset: 3px; }
.answers { list-style: none; padding: 0; margin: 0; columns: 280px; column-gap: 12px; }
.answer { break-inside: avoid; background: var(--surface-2); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; word-break: break-word; }
@@ -339,6 +386,11 @@ body.present {
.stage .average__track { height: 1em; box-shadow: none; background: linear-gradient(90deg, var(--surface-2), var(--c1)); }
.stage .cloud { font-size: clamp(1.4rem, 2.6vw, 2.6rem); }
.stage .answers { columns: 340px; }
.stage .quiz-timer { font-size: clamp(3rem, 7vw, 6rem); }
.stage .quiz-tile { font-size: clamp(1.2rem, 2.2vw, 2rem); }
/* brighter green for contrast on the dark stage */
.stage .quiz-summary strong, .stage .bar--correct .bar__label { color: #3ddc97; }
.stage .bar--correct .bar__fill { background: #3ddc97; }
.stage__controls { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; opacity: .35; transition: opacity .2s; padding-top: 12px; }
.stage__controls:hover, .stage__controls:focus-within { opacity: 1; }