Reset poll to "not started" and keep prepared Q&A questions
Resetting a poll now also clears the live/paused slide so the presentation starts over. Questions entered beforehand on Q&A slides are kept by default (only their upvotes are removed); the dashboard offers a checkbox to delete them too. Resetting a single slide always keeps them. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
19320f01c4
commit
97a60290b4
7 files changed
+119
-22
No files matched your search
@@ -59,7 +59,9 @@ class AdminController extends AdminAppController
|
||||
// Created on first visit, so every slide has its embed URL ready to copy.
|
||||
$embedKey = $this->Polls->ensureEmbedKey($this->poll);
|
||||
|
||||
$this->set(compact('slides', 'responseCounts', 'typeLabels', 'typeDescriptions', 'joinUrl', 'embedKey'));
|
||||
$hasPrepared = $this->Responses->hasPrepared($this->poll->id);
|
||||
|
||||
$this->set(compact('slides', 'responseCounts', 'hasPrepared', 'typeLabels', 'typeDescriptions', 'joinUrl', 'embedKey'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -117,15 +119,17 @@ class AdminController extends AdminAppController
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all responses of all slides; slides, settings and the presentation are kept
|
||||
* (e.g. to run the poll with another group).
|
||||
* Deletes all responses of all slides and puts the presentation back to "not started"; slides and settings
|
||||
* are kept (e.g. to run the poll with another group). Prepared Q&A questions stay unless
|
||||
* `keep_prepared` is sent as 0.
|
||||
*
|
||||
* @return \Cake\Http\Response|null
|
||||
*/
|
||||
public function reset(): ?Response
|
||||
{
|
||||
$this->request->allowMethod(['post']);
|
||||
(new ResetService())->poll($this->poll);
|
||||
$keepPrepared = $this->request->getData('keep_prepared', '1') !== '0';
|
||||
(new ResetService())->poll($this->poll, $keepPrepared);
|
||||
$this->Flash->success(__('Alle Antworten wurden gelöscht.'));
|
||||
|
||||
return $this->redirect($this->adminUrl());
|
||||
|
||||
Reference in new issue
Block a user