Widget:Poll

De WikiEducator
Saltar a: navegación, buscar

Infrastructure for wiki-based poll. Only votes from logged in users are collected.

Usage

{{#widget:Poll|options=x,y,z|bars=c1,c2,c3...|disabled=reason}}

The #widget invocation must be immediately followed by a <div class="WEPoll">...</div>.

The div must contain two nested lists. The outer list can be either ordered (#) or unordered (*). Within each element of that outer list must be another list. Each of those inner lists can be either:

  • unordered - in which case each of its elements will be rendered as a radio button, allowing the user to choose only one of them
  • ordered - in which case each of its elements will be rendered as a checkbox, allowing selection of multiple choices

Example:

<div class="WEPoll">
# This question will only allow a single response to be chosen
#* option one
#* option two
# This question will allow multiple responses
## option one
## option two
</div>

options

options
optional comma separated list of options defining the poll that immediately follows the widget:
voters show the number of users that answered this question
count display number
or
percentage for each response
percent
after only display results after voting (implies never shown to users that are not logged in, since they can't vote)
or
only to users that have voted and to users that are not logged in
anon
bars show color bar graph
disabled don't show button to accept new votes
bars
optional comma separated list of colors that will be used cyclically for barchart colors, over-riding built-in colors (automatically sets bars option)
disabled
optional text string explaining that votes are no longer solicited