Extension:Quiz/zh
![]() Category:Stable extensions/zh |
|
---|---|
![]() |
|
Category:Tag extensions/zh, Category:Hook extensions/zh | |
描述 | 提供测验工具 |
作者 | Lrbabe留言 |
最新版本 | 1.2.0 (2015-12-08) |
MediaWiki | 1.25+Category:Extensions with manual MediaWiki version/zh |
GNU通用公眾授權條款2.0或更新版本 | |
下載 | Category:Extensions in Wikimedia version control/zh |
and format documentation: v:Help:Quiz | |
前往translatewiki.net翻譯Quiz | |
問題 | 开启的任务 · |
Quiz扩展是一个被维基学院采用的测验工具。 此扩展旨在:
- 语法简单,易于使用;具有强大的可能性。
- 对建议和改进持开放态度(便于添加新类型的问题)。
用法
- Learning project on quizzes at the English Wikiversity
- Wikiversity:Help:Quiz – documentation for the quiz extension (full) (on Wikiversity).
- Wikiversity:Help:Quiz-Simple – a simpler and colourful documentation intended for beginners, younger users and anyone else who does not need the full version (on Wikiversity).
Other help pages are hosted on the Wikiversities in order to allow for working examples.
安装
- 下载,并将解压后的
Quiz
移动到extensions/
目录中。
开发者和代码贡献人员应从Git安装扩展,输入:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Quiz
- 将下列放置在您的LocalSettings.php 的底部:
wfLoadExtension( 'Quiz' );
完成 – 在您的wiki上至Special:Version,以验证已成功安装。
开发
- 添加新问题类型
Quiz was conceived to facilitate the addition of new question types. If the basic types (multiple choice with single/multiple responses) are not enough for you, you have the possibility of easily creating and integrating the type of questions which you need. For that you must have some knowledge of PHP.
-
The first thing that you must do is choose a syntax (the simplest possible) for your question type.
The restrictions are:
- The syntax of the question's header is fixed. The question has to be placed between curly brackets - i.e.
{
and}
. - For consistency, it is recommended to use
||
to mark the beginning of the feedback section ("correction").
- The syntax of the question's header is fixed. The question has to be placed between curly brackets - i.e.
-
Choose a new code name for your question type (example: "questionTypeName") as well as a symbol (currently the symbol
()
is used for single response multiple choice because it looks like a radio button, and the symbol[]
is used for multiple response multiple choice because it looks like a checkbox).
-
Add a "case" at the beginning of the parseParameters's "switch", as follows:
case 'symbol': $this->mType = "questionTypeName"; break;
-
Add a parser function to Quiz.php
This function must convert a question object from quiz syntax to HTML and set a state to the question (right, wrong, error, NA or unmarked), according to syntax errors and eventually posted answers. Name the function "questionTypeNameParseObject" and implement as follows :/** * Convert a basic type object from quiz syntax to HTML. * * @param $input A question object in quiz syntax * * @return $output A question object in HTML. */ function questionTypeNameParseObject($input) { // your code here. $this->setState(""); // Set the state if needed. return $output; }
- Write down your syntax specifications which will be added to the help. Please read first the existing help.
- Once this is all done, contact me to include officially your question type inside the extension.
另请参阅
![]() | 此用于一个或多个维基媒体项目。 这可能意味着足够稳定、运作足够良好,可以用在这样的高流量的网站上。 请在维基媒体的CommonSettings.php和InitialiseSettings.php中查找此的名称以查看哪些网站安装了该。 特定wiki上的已安装的的完整列表位于Special:Version页面。 |
![]() | 此在以下wiki农场/托管网站和/或软件包中提供: 這不是一份權威名單。 即使某些wiki农场/托管网站和/或软件包未在这里列出,它们也可能提供此。 请检查你的wiki农场/托管网站或软件包以确认提供情况。 |
Category:All extensions/zh
Category:Extensions in Wikimedia version control/zh
Category:Extensions included in Miraheze/zh
Category:Extensions included in MyWikis/zh
Category:Extensions included in WikiForge/zh
Category:Extensions used on Wikimedia/zh
Category:Extensions with manual MediaWiki version/zh
Category:GPL licensed extensions/zh
Category:Hook extensions/zh
Category:On-line learning extensions/zh
Category:ParserAfterTidy extensions/zh
Category:ParserFirstCallInit extensions/zh
Category:Poll extensions/zh
Category:Stable extensions/zh
Category:Tag extensions/zh