PollConfig

constructor(name: String, options: List<PollOption>, description: String = "", votingVisibility: VotingVisibility = VotingVisibility.PUBLIC, enforceUniqueVote: Boolean = true, maxVotesAllowed: Int = 1, allowUserSuggestedOptions: Boolean = false, allowAnswers: Boolean = false, extraData: Map<String, Any> = emptyMap())

Alternative constructor to create a PollConfig with a list of options with extra data.

Parameters

name

The name of the poll.

options

The list of options (with optional extra data) for the poll.

description

The description of the poll. Default: empty.

votingVisibility

The visibility of the votes. Default: VotingVisibility.PUBLIC.

enforceUniqueVote

If set to true, a user can only vote once. Default: true.

maxVotesAllowed

The maximum number of votes a user can cast. Default: 1.

allowUserSuggestedOptions

If set to true, users can suggest new options. Default: false.

allowAnswers

If set to true, users can send answers. Default: false.

extraData

Any additional data associated with the poll.


constructor(name: String, options: List<String>, description: String = "", votingVisibility: VotingVisibility = VotingVisibility.PUBLIC, enforceUniqueVote: Boolean = true, maxVotesAllowed: Int = 1, allowUserSuggestedOptions: Boolean = false, allowAnswers: Boolean = false)

Deprecated

This constructor doesn't allow passing extra data for options. Use the constructor with List<PollOption> instead.

Constructor to create a PollConfig with a list of option texts.

Parameters

name

The name of the poll.

options

The list of option texts for the poll.

description

The description of the poll. Default: empty.

votingVisibility

The visibility of the votes. Default: VotingVisibility.PUBLIC.

enforceUniqueVote

If set to true, a user can only vote once. Default: true.

maxVotesAllowed

The maximum number of votes a user can cast. Default: 1.

allowUserSuggestedOptions

If set to true, users can suggest new options. Default: false.

allowAnswers

If set to true, users can send answers. Default: false.