Allow resetting the whole poll from the dashboard
CI / Deploy / test (push) Successful in 51s
CI / Deploy / deploy (push) Skipped

Deletes all responses of all slides, puts every slide back to its
initial state and restarts the presentation. Slides, settings, links
and the join code are kept. The per-slide reset shares the logic via
ResetService and now also reopens closed slides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Opus 5.5 committed 2026-11-08 20:30:03 +01:00
1 parent ee593da0e6
commit e1b327899f
8 files changed
+247 -15

No files matched your search

+16
View File
@@ -10,6 +10,7 @@ use App\Model\Table\SlidesTable;
use App\Service\PollStateService;
use App\Service\QaService;
use App\Service\ReportService;
use App\Service\ResetService;
use App\Service\SlideControlService;
use App\View\PdfView;
use Cake\Core\Configure;
@@ -121,6 +122,21 @@ class AdminController extends AdminAppController
return $this->redirect($this->adminUrl() + ['#' => 'embed']);
}
/**
* Deletes all responses of all slides and starts the presentation over,
* slides, settings and links are kept (e.g. to run the poll with another group).
*
* @return \Cake\Http\Response|null
*/
public function reset(): ?Response
{
$this->request->allowMethod(['post']);
(new ResetService())->poll($this->poll);
$this->Flash->success(__('Die Umfrage wurde zurückgesetzt: Alle Antworten sind gelöscht, die Präsentation beginnt wieder bei der ersten Folie.'));
return $this->redirect($this->adminUrl());
}
/**
* Deletes the whole poll incl. slides and responses.
*