Keep results off participant devices
CI / Deploy / test (push) Successful in 1m9s
CI / Deploy / deploy (push) Skipped

Results belong on the stage. Participants only get results where they
interact with them (word cloud with upvotes) and, once resolved, the
solution of quiz and ordering slides with their own verdict, without
counts or distribution. Removes the per-poll setting
show_results_to_participants (column stays unused).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Opus 5.5 committed 2026-11-08 20:02:36 +01:00
1 parent ecb8f9d31c
commit cfb445123e
14 files changed
+86 -59

No files matched your search

+7
View File
@@ -465,6 +465,13 @@ textarea { resize: vertical; }
.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; }
/* quiz solution on the participant device (no counts) */
.quiz-solution { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.quiz-solution__item { padding: 8px 12px; border-radius: 8px; background: var(--surface-2); }
.quiz-solution__item.is-correct { color: var(--ok); font-weight: 700; }
.quiz-solution__item.is-wrong { color: var(--muted); }
.quiz-solution__item.is-mine { outline: 2px solid currentColor; outline-offset: -2px; }
.quiz-solution__mine { font-weight: 400; }
/* ordering results */
.order-solution { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
+23 -4
View File
@@ -626,6 +626,21 @@
return el('div', { class: 'quiz-results quiz-results--' + results.phase }, children);
}
if (results.correctCount === undefined) {
// Participant device: the solution only, the distribution is for the stage.
return el('ul', { class: 'quiz-solution' }, results.options.map(function (option) {
var mine = answerId !== null && answerId !== undefined && option.id === answerId;
return el('li', {
class: 'quiz-solution__item ' + (option.correct ? 'is-correct' : 'is-wrong') + (mine ? ' is-mine' : '')
}, [
el('span', { 'aria-hidden': 'true', text: option.correct ? '✓ ' : '✗ ' }),
document.createTextNode(option.label),
el('span', { class: 'sr-only', text: option.correct ? ' – richtig' : ' – falsch' }),
mine ? el('span', { class: 'quiz-solution__mine', text: ' (deine Antwort)' }) : null
]);
}));
}
var max = Math.max.apply(null, results.options.map(function (o) { return o.count; }).concat([1]));
var percent = results.participants > 0 ? Math.round(results.correctCount / results.participants * 100) : 0;
var summary = el('p', { class: 'quiz-summary' }, [
@@ -663,13 +678,17 @@
}
var children = [];
if (results.participants > 0) {
// Participant device (no correctCount): only the solution with the own placements,
// the verdict above it is part of the page.
var onStage = results.correctCount !== undefined;
var withCounts = onStage && results.participants > 0;
if (withCounts) {
var percent = Math.round(results.correctCount / results.participants * 100);
children.push(el('p', { class: 'quiz-summary' }, [
el('strong', { text: results.correctCount + ' von ' + results.participants }),
el('span', { text: ' komplett richtig (' + percent + ' %)' })
]));
} else {
} else if (onStage) {
children.push(el('p', { class: 'results-empty', text: 'Keine Antworten – so wäre es richtig gewesen:' }));
}
children.push(el('ol', { class: 'order-solution' }, results.items.map(function (item, index) {
@@ -684,10 +703,10 @@
text: mine ? ' – von dir richtig platziert' : ' – von dir an anderer Stelle'
})
]),
results.participants > 0 ? el('div', { class: 'bar__track' }, [
withCounts ? el('div', { class: 'bar__track' }, [
el('div', { class: 'bar__fill', style: 'width:' + item.percent + '%' })
]) : null,
results.participants > 0 ? el('div', {
withCounts ? el('div', {
class: 'bar__value',
text: formatNumber(item.percent) + ' % an dieser Stelle (' + item.placed + ')'
}) : null