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

+15
View File
@@ -450,6 +450,21 @@ class Slide extends Entity
$this->focus_response_id = null;
}
/**
* Whether the slide is in the state startFresh() sets (nothing started, closed or discussed yet).
* A reset has nothing to do for such a slide unless it has answers.
*
* @return bool
*/
public function isFresh(): bool
{
return $this->is_voting_open === !$this->isQuiz()
&& $this->voting_started_at === null
&& $this->voting_ends_at === null
&& $this->stage === ($this->isQa() ? self::QA_COLLECT : null)
&& $this->focus_response_id === null;
}
/**
* Opens or closes voting. Opening a quiz that is not running (re)starts its
* voting window and timer; opening a running quiz changes nothing.