Add personal ranking mode to order slides and show image placement only with an image
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:
1 parent
85627b364d
commit
0aac113f30
15 files changed
+239
-15
No files matched your search
@@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user