Prediction Element

Implements all methods of the parent class.


enum State {


interface Callback {
void onStateChanged(State state);
void onResults();
void onVote();

Get question

Returns poll question.
List<Option> getOptions();
Question getQuestion();

Get options

Returns poll options.
List<Option> getOptions();

Get results

Returns JSON array of results.
JsonArray getResults();
Returns results for each source.
JsonArray getResultsPerSource();

Get user vote

Returns array with single element that represents option user voted for.
int[] getUserVote();

Get correct option

Returns correct option index if vote has been revealed.
int getCorrectOption();

Is validated user required

Returns true if validated user required.
boolean isValidatedUserRequired();

Has user voted

Returns true if user already voted.
boolean hasUserVoted();

Has results

Returns true if results present and state of the element satisfies reveal mode.
boolean hasResults();


Vote for specified option (zero-based numbering). Returns true on success.
boolean vote(int optionIndex)