Allow upvoting own Q&A questions as an opt-in setting
The new Q&A setting allow_self_upvote (off by default) lets participants spend their upvote budget on their own questions, e.g. for prioritizing topics. Without it, participants now see a short hint why their own questions cannot be upvoted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ec0b13cae8
commit
affc9a5ece
10 files changed
+59
-12
No files matched your search
@@ -26,8 +26,9 @@ use Cake\Utility\Security;
|
||||
* - Q&A (see QaService for the stages): `question` (text) only while collecting,
|
||||
* at most MAX_QA_QUESTIONS per participant, the same question (case-insensitive)
|
||||
* only once per slide. `vote=up|remove` + `question_id` only while voting: upvote
|
||||
* questions of others, at most `max_upvotes` in total, freely distributed (several
|
||||
* on one question are allowed); `remove` withdraws one own upvote of the question.
|
||||
* questions of others (own ones too with setting `allow_self_upvote`), at most
|
||||
* `max_upvotes` in total, freely distributed (several on one question are allowed);
|
||||
* `remove` withdraws one own upvote of the question.
|
||||
* - ordering: `order` = all option ids, each exactly once, in the participant's order.
|
||||
* Stored as one row with the ids comma separated in `text_value` (see parseOrder()).
|
||||
*/
|
||||
@@ -270,7 +271,7 @@ class VoteService
|
||||
if ($vote !== 'up') {
|
||||
throw new VoteException(__('Ungültige Stimme.'));
|
||||
}
|
||||
if (in_array($id, $own['questions'], true)) {
|
||||
if (!$slide->setting('allow_self_upvote') && in_array($id, $own['questions'], true)) {
|
||||
throw new VoteException(__('Deine eigene Frage kannst du nicht unterstützen.'));
|
||||
}
|
||||
// Several upvotes on the same question are allowed (push important questions).
|
||||
|
||||
Reference in new issue
Block a user