Add internal feedback and comments to choice slides
CI / Deploy / test (push) Successful in 55s
CI / Deploy / deploy (push) Skipped

Same options as for scales: "private" shows only the number of votes on
the stage, "comments" adds an optional comment field whose comments
rotate in the presentation, "comment_ratings" shows the chosen answer(s)
next to each comment. With multiple choice the comment is stored on the
participant's first row. Settings and participant fields are shared
elements for scale and choice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Opus 5.5 committed 2026-11-08 18:57:35 +01:00
1 parent 3e09906830
commit 547b564e32
18 files changed
+485 -108

No files matched your search

+2
View File
@@ -307,6 +307,8 @@ class AdminController extends AdminAppController
$answer = match (true) {
$slide->isOrder() => $this->orderAnswer($slide, $labels, (string)$response->text_value),
$response->parent_id !== null => __('Upvote: {0}', $texts[$response->parent_id] ?? ''),
$response->slide_option_id !== null && $response->text_value !== null
=> __('{0} (Kommentar: {1})', $labels[$response->slide_option_id] ?? '', $response->text_value),
$response->slide_option_id !== null => $labels[$response->slide_option_id] ?? '',
$response->text_value !== null && $response->numeric_value === VoteService::DOWNVOTE
=> __('Downvote: {0}', $response->text_value),
+4 -2
View File
@@ -164,7 +164,7 @@ class SlidesController extends AdminAppController
}
/**
* All answers of an open question or the ratings of a scale
* All answers of an open question, the ratings of a scale or the votes of a choice
* (also anonymous/internal feedback, which is never shown on the stage).
*
* @param string $id Slide id
@@ -173,13 +173,15 @@ class SlidesController extends AdminAppController
public function answers(string $id): void
{
$slide = $this->loadSlide($id);
if (!in_array($slide->type, [Slide::TYPE_OPEN, Slide::TYPE_SCALE], true)) {
if (!in_array($slide->type, [Slide::TYPE_OPEN, Slide::TYPE_SCALE, Slide::TYPE_CHOICE], true)) {
throw new NotFoundException(__('Folie nicht gefunden.'));
}
$results = new ResultsService();
$this->set('slide', $slide);
$this->set('answers', $slide->type === Slide::TYPE_OPEN ? $results->answers($slide) : []);
$this->set('scale', $slide->type === Slide::TYPE_SCALE ? $results->scaleResults($slide) : null);
$this->set('choice', $slide->type === Slide::TYPE_CHOICE ? $results->choiceResults($slide) : null);
$this->set('participants', $this->Slides->Responses->countParticipants($slide->id));
$this->set('comments', $slide->hasComments() ? $results->comments($slide) : []);
}