Offer reset when slides were touched, not only when answers exist
CI / Deploy / PHP 8.5 (push) Successful in 1m6s
CI / Deploy / PHP 8.4 (push) Successful in 1m7s
CI / Deploy / test (push) Successful in 2s
CI / Deploy / deploy (push) Skipped

The dashboard and per-slide reset buttons only checked for responses, so a
started quiz without votes, a closed slide or a running presentation could
not be reset. Check Slide::isFresh() and Poll::isStarted() as well.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Sonnet 5.5 committed 2026-11-13 10:26:44 +01:00
1 parent 0eb054ed29
commit 9c6a19f0de
6 files changed
+81 -10

No files matched your search

+6 -1
View File
@@ -61,7 +61,12 @@ class AdminController extends AdminAppController
$hasPrepared = $this->Responses->hasPrepared($this->poll->id);
$this->set(compact('slides', 'responseCounts', 'hasPrepared', 'typeLabels', 'typeDescriptions', 'joinUrl', 'embedKey'));
// Answers are not the only thing a reset undoes: a started quiz, closed slides or a running presentation too.
$canReset = $responseCounts !== []
|| $this->poll->isStarted()
|| array_filter($slides, fn(Slide $slide) => !$slide->isFresh()) !== [];
$this->set(compact('slides', 'responseCounts', 'canReset', 'hasPrepared', 'typeLabels', 'typeDescriptions', 'joinUrl', 'embedKey'));
}
/**