Help:Extension:PollNY

From Linux Web Expert

File:PD-icon.svg Note: When you edit this page, you agree to release your contribution under the CC0. See Public Domain Help Pages for more info. File:PD-icon.svg

Polls are a lot like quizzes, but unlike quizzes, polls do not have a single "right" answer. Users can choose whichever option they want out of the defined answer options (up to 10 answer options per poll) and see how others have voted.

A poll can also have an associated image. You can either upload a new image or using an existing image, either from the local wiki or Wikimedia Commons, if the InstantCommons feature is enabled on the wiki.

Note that on uploading a new image, you will not be able to customize the file name or supply any additional metadata (e.g. on the creator, copyright status, etc.) at this point. To prevent potential file name collisions, the uploaded file will be automatically prefixed with the current Unix time (e.g. the output of PHP's time() function at the upload) and a hyphen, followed by the original file name to ensure uniqueness. This may result in a lot of files with ugly file names and inadequate metadata, so be aware of this.

You can start taking polls at Special:ViewPoll. Creating new polls happens via Special:CreatePoll. The Special:RandomPoll page takes you to a randomly chosen poll. The administrative interface at Special:AdminPoll is actually not admin-only, but only poll admins (those with the polladmin user right) will be able to view all users' polls on that page; regular users will only be able to view the polls they've created and filter them by status.

Inappropriate polls can be flagged as such by clicking on the "flag" link and providing a reason. Flagging removes the poll from circulation temporarily and enables poll admins to take appropriate action. Poll admins can also delete polls. All of these actions can be taken via the aforementioned Special:AdminPoll special page.

Polls are essentially just regular wiki pages in the new Poll: namespace with a slightly different, specialized creation mechanism to them. Poll: pages have commenting available to users, provided that the Comments extension is installed.

Poll administration

By default administrators are given the polladmin user right, which is required to leverage the full potential of the poll admin panel, Special:AdminPoll. Via this UI these privileged users can view flagged polls and, if needed, unflag them, close the voting on them, and also delete them. (Note that poll creators can also close a poll they've created.)

The polls are saved to the categories defined at:

  • MediaWiki:Poll-category — general top-level category for all polls
  • MediaWiki:Poll-user-category — per-user category

Restricting who can create new polls

It's possible to restrict the creation of new polls so that users will need, for example, five edits or need to have two friends before they are allowed to create new polls. This is similar to the same feature present in QuizGame ($wgCreateQuizThresholds) and PictureGame ($wgCreatePictureGameThresholds) for restricting who can create new polls and picture games, or in SocialProfile ($wgUserProfileThresholds) restricting who can edit their social profile page. (Note that SocialProfile's $wgUserProfileThresholds uses edit instead of edits that PictureGame uses.)

For example:

$wgCreatePollThresholds = [
	'edits' => 5,
	'comments' => 3
];

This would mean that users must have made five edits (to pages in the namespaces listed in $wgNamespacesForEditPoints array in the wiki's LocalSettings.php) and three comments before they would be allowed to create a new poll.

All supported values for restriction:

  • edits — edits made to pages in the namespaces listed in $wgNamespacesForEditPoints array
  • comments — # of comments left on pages using the Comments extension (such as blog pages)
  • comment_score_plus — # of times your comment got upvoted
  • comment_score_minus — # of times your comment got downvoted
  • recruits — # of users referred to the wiki via special referral links
  • friend_count — # of friends you have
  • foe_count — # of foes you have
  • weekly_wins — times you've been the weekly winner
  • monthly_wins — times you've been the monthly winner
  • only_confirmed_email — self-explanatory, isn't it?
  • poll_votes — # of polls you've voted in
  • picture_game_votes — # of picture games you've voted in
  • quiz_created — # of quizzes created
  • quiz_answered — # of quizzes answered in total
  • quiz_correct — # of points gotten by taking quizzes and getting the answer correct
  • quiz_points — # of points gotten by taking quizzes

In practise, one or two restrictions are probably sufficient enough to curb abuse. All of the available restrictions are documented here for completeness' sake, but it would likely be highly impractical to use restrictions like weekly_wins or monthly_wins.

Points

It's possible to give out points for taking polls. A system administrator should define the following variable in the wiki's LocalSettings.php file for that:

  • $wgUserStatsPointValues['poll_votes'] — the amount of points received for taking a poll

See also