Add anonymous feedback option for open questions
Open questions can be marked private: the presenter screen and embeds only show the number of answers, participants never see results, and the texts are readable on a new admin answers page and in the CSV. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
07a292d109
commit
367ff8548d
14 files changed
+310
-12
No files matched your search
@@ -81,7 +81,8 @@ class Slide extends Entity
|
||||
self::TYPE_CHOICE => ['multiple' => false],
|
||||
// allow_downvotes only takes effect together with allow_upvotes
|
||||
self::TYPE_WORDCLOUD => ['allow_upvotes' => true, 'allow_downvotes' => true],
|
||||
self::TYPE_OPEN => [],
|
||||
// private: anonymous feedback, answers only visible in the admin area (never on the stage)
|
||||
self::TYPE_OPEN => ['private' => false],
|
||||
self::TYPE_SCALE => ['scale_min' => 1, 'scale_max' => 5, 'min_label' => '', 'max_label' => ''],
|
||||
self::TYPE_CONTENT => [],
|
||||
// time_limit in seconds, 0 = no limit (presenter ends the quiz)
|
||||
@@ -327,4 +328,15 @@ class Slide extends Entity
|
||||
{
|
||||
return $this->getSettings()[$key] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Open question collecting anonymous feedback: answers are never shown on the
|
||||
* presenter screen or to participants, only in the admin area and the CSV export.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isPrivate(): bool
|
||||
{
|
||||
return $this->type === self::TYPE_OPEN && (bool)$this->setting('private');
|
||||
}
|
||||
}
|
||||
@@ -145,6 +145,9 @@ class SlidesTable extends Table
|
||||
$settings['allow_upvotes'] = filter_var($input['allow_upvotes'] ?? true, FILTER_VALIDATE_BOOLEAN);
|
||||
$settings['allow_downvotes'] = filter_var($input['allow_downvotes'] ?? true, FILTER_VALIDATE_BOOLEAN);
|
||||
break;
|
||||
case Slide::TYPE_OPEN:
|
||||
$settings['private'] = filter_var($input['private'] ?? false, FILTER_VALIDATE_BOOLEAN);
|
||||
break;
|
||||
case Slide::TYPE_SCALE:
|
||||
$min = max(0, min(1, (int)($input['scale_min'] ?? 1)));
|
||||
$max = max(2, min(10, (int)($input['scale_max'] ?? 5)));
|
||||
|
||||
Reference in new issue
Block a user