Offer reset when slides were touched, not only when answers exist
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:
1 parent
0eb054ed29
commit
9c6a19f0de
6 files changed
+81
-10
No files matched your search
@@ -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'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user