Elements Common API
Votable polls are subclasses of BasePoll class. This class should be used in code for generalization.
BasePoll encapsulates element state, voting logic contains code for State of the parent class. state manipulation, results, and notify subscribers about changes…
Elements which can be revealed are derived from RevelablePoll class.
RevelablePoll class contains methods for accessing Revealed state, if a poll has it.
Get id
Returns element id.
Get type
Returns element type.
Get content type
Returns element content type.
Get custom fields
Returns element custom fields as JSON.
Get duration
Returns element duration in seconds.
Get published time
Returns time element was published as UNIX time in seconds.
Has fixed duration
Returns true if element has fixed duration.
Prompt during/ after voting
For a child of RevelablePoll Element:
Voting and results
Children elements overwrite, use basic method
Returns array where each element is an option index you've voted for.
Closures
Subscribe to element's changes.
Results
If results are available they can be determined by
Returned dictionaries might have keys from the structure:
Questions & Answers
Usually there is one question in a poll, but there can be several, in case of sliced poll Question index is defined by the following property:
Current question is determined by:
All questions are determined by:
Options for current question are defined by:
All answer options could be accessed by:
Options for specific question index can be accessed by:
State
If element can be in revealed state, it has Revealed state. Otherwise the state is not accessible.
For state detection there are some helper properties:
Last updated