v24
Powered By GitBook
Prediction Element
Implements all methods of the parent class.

State

1
enum State {
2
Started,
3
Stopped,
4
Revealed
5
}
Copied!

Callback

1
interface Callback {
2
void onStateChanged(State state);
3
void onResults();
4
void onVote();
5
}
Copied!

Get question

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

Get options

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

Get results

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

Get user vote

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

Get correct option

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

Is validated user required

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

Has user voted

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

Has results

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

Vote

Vote for specified option (zero-based numbering). Returns true on success.
1
boolean vote(int optionIndex)
Copied!
Last modified 2yr ago