Add ordering slide type
Participants bring shuffled items into the correct order and submit it once. The admin enters the items in the correct order and can reorder them by drag & drop or arrow keys. Closing the voting reveals the solution: how many got it completely right and how often each item was placed correctly; participants see whether their order was right. The drag & drop mechanics of the slide list are extracted into a reusable makeSortable() helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4eed568a64
commit
918e077734
17 files changed
+922
-95
No files matched your search
@@ -179,6 +179,7 @@ h3 { font-size: 1.05rem; margin-top: 1.6em; }
|
||||
.badge--type-quiz { background: #f1e3fb; color: #7a2fb0; }
|
||||
.badge--type-youtube { background: #fde4e1; color: #b3261e; }
|
||||
.badge--type-qa { background: #dff1fb; color: #0b5f8a; }
|
||||
.badge--type-order { background: #e6f4dc; color: #3d6b12; }
|
||||
|
||||
.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); }
|
||||
@@ -287,6 +288,19 @@ textarea { resize: vertical; }
|
||||
.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); }
|
||||
|
||||
/* ordering slide editor (rows in the correct order, sortable) */
|
||||
.order-options { border: 0; padding: 0; margin: 0 0 16px; }
|
||||
.order-options legend { font-weight: 600; margin-bottom: 4px; }
|
||||
.order-options__list { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 8px; }
|
||||
.order-option { display: flex; gap: 6px; align-items: center; background: var(--surface); border-radius: 8px; }
|
||||
.order-option input[type=text] { flex: 1; margin: 0; }
|
||||
.order-option__pos { min-width: 2em; text-align: right; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
|
||||
.order-options.error .order-options__list input[type=text] { border-color: var(--danger); }
|
||||
|
||||
/* shared by sortable form lists */
|
||||
.is-sorting, .is-sorting * { cursor: grabbing !important; user-select: none; }
|
||||
.is-dragging { position: relative; z-index: 2; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
|
||||
|
||||
.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; }
|
||||
.copy-field { display: flex; gap: 8px; }
|
||||
@@ -341,6 +355,30 @@ textarea { resize: vertical; }
|
||||
.verdict--correct { color: var(--ok); }
|
||||
.verdict--wrong { color: var(--danger); }
|
||||
|
||||
/* ordering slide (participant) */
|
||||
.order-list { list-style: none; padding: 0; margin: 16px 0 8px; display: grid; gap: 8px; }
|
||||
.order-item {
|
||||
display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 4px;
|
||||
background: var(--surface); border: 2px solid var(--border); border-left: 8px solid var(--c0); border-radius: 10px;
|
||||
}
|
||||
.order-item.choice--c1 { border-left-color: var(--c1); }
|
||||
.order-item.choice--c2 { border-left-color: var(--c2); }
|
||||
.order-item.choice--c3 { border-left-color: var(--c3); }
|
||||
.order-item.choice--c4 { border-left-color: var(--c4); }
|
||||
.order-item.choice--c5 { border-left-color: var(--c5); }
|
||||
.order-item.is-dragging { border-color: var(--primary); }
|
||||
.order-item__pos { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; font-size: .9rem; }
|
||||
.order-item__label { flex: 1; min-width: 0; font-weight: 600; word-break: break-word; }
|
||||
.order-item__moves { display: flex; gap: 4px; flex: none; }
|
||||
.order-move {
|
||||
width: 44px; height: 44px; padding: 0; border: 1px solid var(--border); border-radius: 8px;
|
||||
background: var(--surface-2); color: var(--text); font-size: 1rem; cursor: pointer;
|
||||
}
|
||||
.order-move:hover { border-color: var(--primary); }
|
||||
.order-move:focus-visible { outline: 3px solid var(--primary); outline-offset: 1px; }
|
||||
.order-item:first-child .order-move[data-move=up], .order-item:last-child .order-move[data-move=down] { opacity: .35; }
|
||||
.order-item .drag-handle { height: 44px; }
|
||||
|
||||
/* ---------------------------------------------------------------- results (shared) */
|
||||
.results-empty { color: var(--muted); font-style: italic; }
|
||||
.is-hidden { visibility: hidden; }
|
||||
@@ -417,6 +455,11 @@ textarea { resize: vertical; }
|
||||
.bar--wrong .bar__fill { background: var(--muted); opacity: .6; }
|
||||
.bar.is-mine .bar__label { text-decoration: underline; text-underline-offset: 3px; }
|
||||
|
||||
/* ordering results */
|
||||
.order-solution { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
|
||||
.order-solution__pos { display: inline-block; min-width: 1.6em; color: var(--muted); font-variant-numeric: tabular-nums; }
|
||||
.order-solution .bar__fill { background: var(--ok); }
|
||||
|
||||
.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; }
|
||||
|
||||
@@ -523,6 +566,7 @@ body.present {
|
||||
.stage .quiz-tile { font-size: clamp(1.2rem, 2.2vw, 2rem); }
|
||||
.stage .quiz-summary strong, .stage .bar--correct .bar__label { color: var(--stage-ok); }
|
||||
.stage .bar--correct .bar__fill { background: var(--stage-ok); }
|
||||
.stage .order-solution .bar__fill { background: var(--stage-ok); }
|
||||
.stage .qa-steps { font-size: .7em; }
|
||||
.stage .qa-steps__step { border-color: rgba(var(--tint), .25); }
|
||||
.stage .qa-item { background: rgba(var(--tint), .06); }
|
||||
|
||||
Reference in new issue
Block a user