Extension:AJAXPoll

This page is a translated version of the page Extension:AJAXPoll and the translation is 100% complete.
MediaWiki 拡張機能マニュアル
AJAXPoll
リリースの状態: 安定
実装 パーサー拡張機能
説明 ‎<poll>タグを使ったAJAXベースの投票を可能にする
作者
最新バージョン 2.3.0 (2020-02-24)
MediaWiki 1.39.6+
テーブル ajaxpoll_info
ajaxpoll_vote
ライセンス GNU 自由文書ライセンス
ダウンロード
Any ShoutWiki site
Quarterly downloads 22 (Ranked 125th)
translatewiki.net で翻訳を利用できる場合は、AJAXPoll 拡張機能の翻訳にご協力ください
問題点 未解決のタスク · バグを報告

AJAXPoll拡張機能は‎<poll>タグを持つMediaWikiページで1つまたは複数のAJAXベースの投票を可能にします。

インストール

  • ダウンロードして、ファイルをextensions/フォルダー内のAJAXPollという名前のディレクトリ内に配置します。
    開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/AJAXPoll
  • 以下のコードを LocalSettings.php ファイルの末尾に追加します:
    wfLoadExtension( 'AJAXPoll' );
    
  • 更新スクリプトを実行します。このスクリプトは、この拡張機能が必要とするデータベーステーブルを自動的に作成します。 お好みで設定を変更してください
  •   完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。

設定

# if you want to restrict the poll
# use the following code lines after calling the AJAXPoll extension
# to restrict to user group (example)

# The 'ajaxpoll-view-results-before-vote' group permission allows the specified
# group members to view poll results even without having voted
# but only if the high-level group permission 'ajaxpoll-vote' allows to view
# results in general.
#
# This 'ajaxpoll-view-results-before-vote' can be overwritten with the specific
# per-poll setting "show-results-before-voting" which takes precedence over the
# group permission.
#
# permission 'ajaxpoll-view-results' >>
# >> per-poll setting "show-results-before-voting" (if present)
# >> permission 'ajaxpoll-view-results-before-vote'

# anons
# default: anons cannot vote and will never see results
$wgGroupPermissions['*']['ajaxpoll-vote'] = false;
$wgGroupPermissions['*']['ajaxpoll-view-results'] = false;
$wgGroupPermissions['*']['ajaxpoll-view-results-before-vote'] = false;

# users
# default: users can vote and can see poll results - when they have voted
$wgGroupPermissions['user']['ajaxpoll-vote'] = true;
$wgGroupPermissions['user']['ajaxpoll-view-results'] = true;

自動追跡カテゴリを無効にしたい場合は、Wikiのシステムメッセージ「MediaWiki:Ajaxpoll-tracking-category」のテキストを「-」(マイナス)に設定してください。

使用法

構文

<poll>
Question
Choice 1
Choice 2
Choice 3
Choice 4
</poll>

<poll>
Do you like this poll ?
Yes, it is awesome.
Yes.
No, I do not like polls.
I have no idea, what this means.
</poll>

 

これが必要な場合は、開始タグに投票前の結果の表示パラメーターを追加することにより、投票ごとに投票する前に結果の表示を許可または拒否できます。

<poll show-results-before-voting>
<poll show-results-before-voting=1>
<poll show-results-before-voting=0>

もし‎<poll>の後の最初の行が "STATS" であれば、wikiとその投票に関するいくつかの統計が表示されます。 これらの統計はローカライズできないので、この機能全体は将来的に削除される(少なくともリファクタリングはされるが、おそらくは削除される)だろう。