bigbluebutton-Github/bigbluebutton-html5/imports/api/polls/server/handlers/pollStarted.js
tibroc 828cf60cb2 Add option to hide individual answers in polls
This patch adds a new option to hide the individual answers to the presenter
when starting a poll. This includes hiding the answers for the presenter and
informing the other users that the current poll is anonymous.

See #9524
2021-06-07 10:56:14 +02:00

21 lines
576 B
JavaScript

import { check } from 'meteor/check';
import addPoll from '../modifiers/addPoll';
import setPublishedPoll from '../../../meetings/server/modifiers/setPublishedPoll';
export default function pollStarted({ body }, meetingId) {
const {
userId, poll, pollType, secretPoll, question,
} = body;
check(meetingId, String);
check(userId, String);
check(poll, Object);
check(pollType, String);
check(secretPoll, Boolean);
check(question, String);
setPublishedPoll(meetingId, false);
return addPoll(meetingId, userId, poll, pollType, secretPoll, question);
}