Extension:QPoll

From MediaWiki.org
Jump to: navigation, search
· Main page · Terminology and Syntax · Developing scripts · Installation and administration · Examples


MediaWiki extensions manual
Crystal Clear action run.png
QPoll

Release status: beta

QPoll.png
Implementation Parser function, Tag, Special page, Database
Description Allows to create chains of multipage polls and to provide the statistics at the custom special page
Author(s) Dmitriy Sintsov <questpc256@gmail.com> (QuestPCtalk)
Latest version 0.8.1 (March 2014)
MediaWiki 1.15, 1.16, 1.17, 1.22, 1.23
License GNU General Public License
Download
Example [1] (available in Russian)

[2]

Parameters

qp_Setup::$cache_control qp_Setup::$global_showresuls qp_Setup::$anon_forwarded_for

Tags
qpoll
Hooks used
ParserFirstCallInit

LanguageGetMagic
LoadAllMessages

Translate the QPoll extension if it is available at translatewiki.net

Check usage and version matrix; code metrics

Purpose[edit | edit source]

This extension allows to create polls embedded into wikipages. One page may contain multiple polls. Each poll may contain one or more question of different type. The polls can be "chained" - when the dependent poll will be available for voting only after successful submission of the "dependance" poll. Questions may have various types: with unique, single or multiple category selections and text type (since v0.8.0). Questions contain categories - possible user choices. These can be grouped together as metacategories (also known as category spans) to make "subquestions" inside a question. User choice of category from any of previously voted polls can be retrieved in subsequent polls to change next question proposal text. Since v0.8.0 it is possible to bind and run server-side interpretation scripts to analyze user input. Invalid user input can be refused with exact error message provided by interpretation script. Valid user input can be processed and stored as "structured data" to be further processed by future dependent polls.

Terminology and Syntax[edit | edit source]

Click at section header to read about logical structure of polls, how these can be defined.

Developing scripts[edit | edit source]

Click at section header to read about how to:

  • process user submitted data via {{#qpuserchoice}} parser function
  • develop server-side interpretation scripts (since v0.8.0)

Installation and administration[edit | edit source]

Click at section header to read how to:

  • install extension
  • use Special:PollResults special page
  • which settings in LocalSettings.php are available

Examples[edit | edit source]

Click at section header to check working samples of polls. One may quickly copy/paste these as examples into their wiki.

Todo[edit | edit source]

  1. Statistical diagrams.
  2. Improve "mixed" question type.
  3. Make it possible to delete polls.

History[edit | edit source]

This extension has originally grew out of the existing stable Quiz extension, taking it as the code base. After some revisions, when the majority of code was changed, it became apparent that Quiz compatibility should be dropped, because the purposes of both extensions are quite different, thus the storage scheme can't be easily made unified. Also, since v0.8.0 QPoll allows to implement quizes via interpretation scripts attached to the polls. Besides that, nested and rotating tables layout require html class renderer which uses arrays and objects to interpret the tags instead of simple string output buffer provided by default, which originally caused a lot of tag nesting errors and ugly code.