Add personal ranking mode to order slides and show image placement only with an image
CI / Deploy / PHP 8.4 (push) Failing after 1m28s
CI / Deploy / PHP 8.5 (push) Failing after 1m31s
CI / Deploy / test (push) Failing after 2s
CI / Deploy / deploy (push) Skipped

Order slides get a "ranking" setting without a correct solution: the stage shows
the live average ranking, participants only get a confirmation. The image
placement question in the slide form is only shown for an existing image or a
chosen file.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Sonnet 5.5 committed 2026-11-17 09:15:49 +01:00
1 parent 85627b364d
commit 0aac113f30
15 files changed
+239 -15

No files matched your search

+14 -2
View File
@@ -137,7 +137,9 @@ class Slide extends Entity
// allow_self_upvote: upvotes on own questions (for prioritizing topics, off by default)
self::TYPE_QA => ['upvote_share' => 25, 'max_upvotes_per_question' => 0, 'allow_self_upvote' => false],
// The correct order is the order of the slide_options (position), revealed when voting closes.
self::TYPE_ORDER => [],
// ranking: no correct order, everyone sorts by personal preference; the presenter sees the
// average ranking live (nothing to hide), participants never get results
self::TYPE_ORDER => ['ranking' => false],
];
/**
@@ -342,7 +344,17 @@ class Slide extends Entity
*/
public function isOrderRevealed(): bool
{
return $this->isOrder() && !$this->isVotingOpen();
return $this->isOrder() && !$this->isRanking() && !$this->isVotingOpen();
}
/**
* Ordering slide without a correct order (personal ranking, e.g. "sort by your importance").
*
* @return bool
*/
public function isRanking(): bool
{
return $this->isOrder() && (bool)$this->setting('ranking');
}
/**
+4 -1
View File
@@ -180,8 +180,11 @@ class SlidesTable extends Table
$view = $input['scale_view'] ?? null;
$settings['scale_view'] = in_array($view, Slide::SCALE_VIEWS, true) ? $view : Slide::SCALE_VIEW_BOTH;
break;
case Slide::TYPE_ORDER:
$settings['ranking'] = filter_var($input['ranking'] ?? false, FILTER_VALIDATE_BOOLEAN);
break;
case Slide::TYPE_QUIZ:
$limit = (int)($input['time_limit'] ?? $settings['time_limit']);
$limit =(int)($input['time_limit'] ?? $settings['time_limit']);
if (in_array($limit, Slide::QUIZ_TIME_LIMITS, true)) {
$settings['time_limit'] = $limit;
}