Mediawiki Extension Quiz
Source: | DataSource |
---|---|
Language: | English |
Topic: | Mediawiki |
SubTopic: | Mediawiki Extension |
Last Edit By: | DochyJP |
LastEdit: | 2021-04-14 |
Document type: | Documentation |
Status: | Active |
Access: | free |
Description
Installation
Download
Download and place the file(s) in a directory called Quiz in your extensions/ folder.
Activation
Add the following code at the bottom of your LocalSettings.php:
wfLoadExtension( 'Quiz' );
Create your Quiz
Adding a new question type
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").
- 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':
<pre> $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 :
- Add a parser function to Quiz.php.
/** * 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.
Back to top of page - Back to Welcome Page
Quiz documentation
This is the help page for the quiz extension.
The quiz extension consists of very simple markup. This page is long because of the many possibilities which the quiz extension opens up. For a simpler and colourful guide to quizzes suitable for beginners, try the simple quiz help page.
Overview
Version
- Version 1.0 of the quiz extension is now (20 May 2007) active on Wikiversity.
- This documentation covers all the major features and most of the minor ones.
- A few exotic features are not yet covered, such as shuffle control using {X} {!X} {/X} tags.
Pedagogical considerations
- Where are the strengths and weaknesses of Wikiversity quizzing?
- How can you best use the quiz extension as a teaching tool?
- Wikiversity compared to Moodle - offers a detailed consideration of the quiz feature differences between Moodle and Wikiversity, including suggestions as to how each is best used.
How to create a quiz
The quiz tag
wikitext (what you write) |
rendering (what you see) |
comments | |
---|---|---|---|
<quiz> insert questions here </quiz> |
|
The quiz tags do the following:
Theoretically it is possible to put quiz tags around each individual question, allowing a learner to mark each one in turn. Shuffling questions: if the shuffle questions button is shown, the questions can be shuffled by clicking the button. This only works so long as the quiz-taker has not started to answer the questions. Once the quiz-taker starts answering, the order is locked.Shuffle button is not shown if there is one or less questions in a quiz. | |
<quiz display=simple> insert questions here </quiz> |
|
| |
<quiz shuffle=none> insert questions here </quiz> |
|
| |
<quiz shuffleanswers=true> questions with proposal shuffled on reload here </quiz> |
|
Shuffling answers: The quiz also provides the option of automatic shuffling of answers on load.This can be achieved by using shuffleanswers parameter.When shuffleanswers parameter is set to true the answers are shuffled for each reload of the page. This only works so long as the quiz-taker has not started to answer the questions. Once the quiz-taker starts answering, the order is locked to the way it was before submission.
|
Inserting questions
The types of questions available are shown below.
An important point is that each question must be separated by a blank line, otherwise they are merged together into one question.
How to use the examples
In the examples on this page, there is both wikitext and rendering. The wikitext shows you the code, which you can copy and paste into your pages, or just learn and understand. The rendering shows you what the result will look like.
Copying and pasting
The markup has been slightly simplified in order to help understanding. If you copy and paste, you must insert <quiz> tags before and after the markup. You may wish to use the quiz tags with the "display=simple" option as shown above.
Note that the actual example below also use tables for clarity. If a quiz is inserted into a table, this modifies the appearance of a quiz - for example, boxes appear around some elements in the quiz. If you don't use a table, these boxes disappear and your quiz will look plainer.
When pasting, ensure that all the symbols are aligned with the beginning of the lines of the page - i.e. if any line begins with a space, formatting errors may occur.
Live demos
All the examples below should work. Don't be afraid to try them out. Hitting the correction button is OK - it won't change or damage this page.
Basic question types
- Note: For multiple choice questions(MCQs) with negative(-) sign and positive(+) sign, the positive sign(+) signifies the correct answer while the negative(-) sign(s) signifies the wrong answer and this is how Quiz know which answer is correct and which one is wrong.
Multiple choice / single response
wikitext | rendering | comments | |
---|---|---|---|
{Question |type="()"} + The correct answer. - Distractor. - Distractor. - Distractor. |
|
|
True/false questions
wikitext | rendering | comments | |
---|---|---|---|
{Bulgaria and Romania joined the European Union in 2007. |type="()"} + TRUE. - FALSE. {Switzerland is a member of the European Union. |type="()"} - TRUE. + FALSE. {Anyone can be a Citizen Journalist. |type="()"} + TRUE. - FALSE. |
|
|
Multiple choice / multiple response
wikitext | rendering | comments | |
---|---|---|---|
{Question |type="[]"} + Correct answer. - Incorrect answer. + Correct answer. - Incorrect answer. |
|
|
Typed response (short answer)
wikitext | rendering | comments | |
---|---|---|---|
{ |type="{}"} Where was Aristotle born? { Stageira } { |type="{}"} Name Aristotle's famous mentor. { Plato } { |type="{}"} { Alexander } was Aristotle's most famous pupil. |
|
| |
{ |type="{}"} Name a famous Greek philosopher. { Aristotle|Plato } |
|
| |
{ |type="{}"} Name Aristotle's famous mentor. { Plato _6 } |
|
| |
{ Complete each box with a synonym of the following words |type="{}"} #free: { gratis _6 } #well: { good _4 } |
|
| |
{ |type="{}"} Where did Aristotle die? { Chalcis (i) } |
|
|
Gapfill / cloze
wikitext |
{Complete the text from the Wikipedia article on [[w:Aristotle|Aristotle]]. |type="{}"} Aristotle was born in { Stageira _8 } in Chalcidice. His parents were { Phaestis _8 } and { Nicomachus _10 }, who became physician to King Amyntas of Macedon. Aristotle was educated as a member of the aristocracy. At about the age of { eighteen|18 _8}, he went to { Athens _6 } to continue his education at { Plato _5 }'s Academy. Aristotle remained at the Academy for nearly twenty years, not leaving until after Plato's death in { 347 _3 } BC. | |
rendering |
| |
comments |
|
Numerical response
wikitext | rendering | comments | |
---|---|---|---|
{In which year was Plato born? |type="{}"} He was born in { 427-428 _5 } BC. |
|
| |
{How far is the earth from the sun? |type="{}"} { 91-95 _3 } million miles. |
|
| |
{What is 10*10? |type="{}"} { 100 5% _3 } |
|
| |
|
|
Tabular response type with radio buttons
wikitext | rendering | comments | |
---|---|---|---|
{Question |type="()"} | A | B | C +-- A is correct. -+- B is correct. --+ C is correct. |
|
|
Tabular response type with checkboxes
wikitext | rendering | comments | |
---|---|---|---|
{Question |type="[]"} | Option A | Option B | Option C ++- Question 1 (Clue: A and B are correct). -++ Question 2 ( Clue: B and C are correct). --+ Question 3 (Clue: C is correct). |
|
|
Advanced stuff
Inserting feedback
wikitext | rendering | comments | |
---|---|---|---|
{Question |type="()"} + The correct answer. || Feedback for correct answer. - Distractor. || Feedback for distractor. - Distractor. || Feedback for distractor. - Distractor. || Feedback for distractor. |
|
|
Inserting blocks of text between questions
wikitext | rendering | comments | |
---|---|---|---|
{This is the first question. |type="()"} + The correct answer. - Distractor. - Distractor. {This is a block of text.} {This is the second question. |type="()"} + The correct answer. - Distractor. - Distractor. |
|
|
Using images as answers
wikitext | rendered | comments | |
---|---|---|---|
<quiz display=simple> { Which of these are not nuts? } - [[Image:Walnut03.jpg|100px]] + [[Image:Peanuts.jpg|100px]] + [[Image:Malus-Idared on tree.jpg|100px]] - [[Image:Pistachios in a bag.jpg|100px]] - [[Image:Chestnut.jpg|100px]] + [[Image:P10802511.JPG|100px]] </quiz> |
|
|
Using images in the question
wikitext | rendered | comments | |
---|---|---|---|
<quiz display=simple> { What is this? [[Image:Butterfly tongue.jpg|100px| ]] | type="()" } - Tiger + Butterfly - Bee - Fly </quiz> |
|
In this example, the image is part of the question. You just use normal wiki-markup to insert the image(s). |
Using animations
The section adds no new technical tricks, but it looks pretty.
|
|
|
Hyperlinks and other markup
Markup that works inside quizzes
- Hyperlinks: [[....]].
- Images: [[Image:....]].
- Other media: [[....]].
- Bold and italic.
- <big> and <br>
Markup that partly works inside quizzes
- Templates: {{....}}.
- subst doesn't work.
- Tables: {|....|}.
- Headings: e.g. ===....===.
- Warning: At the moment there is a problem with the toc.
- Lists and indents: using #, * and :
Adding music and sound effects
This is similar to insertion of images. Standard wiki markup is used.
Configuring points
wikitext (what you write) |
rendering (what you see) |
comments | |
---|---|---|---|
<quiz points="3/1!"> {Try this question now.} + Plus 3 points for this one. - Minus 1 point for this one. </quiz> |
|
| |
<quiz display=simple> {Try this question now. |type="()" } + 1 points for this one. - 0 points for this one. {Try this question now. |type="()" coef="2"} + 2 points for this one. - 0 points for this one. {Try this question now. |type="()" coef="4"} + 4 points for this one. - 0 points for this one. {Try this question now. |type="()" coef="0.5"} + 1/2 point for this one. - 0 points for this one. </quiz> |
|
|
Shuffle Control Tags
wikitext | rendered | comments | |
---|---|---|---|
<quiz> {X} { Sample Question 2 {!X} { Sample Question 4 </quiz> |
|
Conditional shuffling using tags:It can be achieved by using {X},{!X} and {/X} tags inside quiz.Any questions that are within {X} and {/X} are treated as a block and will be shuffled.The questions that are within {!X} and {/X} are not shuffled internally, i.e the order of questions inside {!X} and {/X} remain the same.
In the example Sample Question 1 and 2 can be shuffled but Sample Question 3 and 4 are always in the same order. |
Troubleshooting
- You cannot test out the quiz while editing a page, because the submit button is grayed out. If you wish to test your new quiz, then create a sandbox page somewhere else first (e.g. as a subpage of your user page), then test the quiz there, and finally transfer the quiz to its final location (and test it again anyway).
- The quiz was developed for IE6, IE7, Firefox (and Opera?), but display quality on Opera may not be optimal, and there may be display differences between browsers.
- A reminder: each question must be separated by a blank line, otherwise the questions are merged together into one question.
Future stuff
Information about future developments is mainly available at the project space on MediaWiki. Lots of things are in planning.