# Help:Quiz/How to create a quiz using the quiz tool

 Quiz

The WikiEducator quiz feature offers functionality to create multiple-choice (single response and multiple response), true-false, short answer (typed response), cloze (providing missing word(s) in a phrase), numerical response, and tabular response questions using wikitext. In addition, the quiz feature includes a feedback option (e.g., for each option in a multiple-choice question), as well as the ability to include images, animations, audio, and hyperlinks.

## How to insert a quiz into your page

The quiz feature has two components: 1) the quiz tag with optional attributes and 2) the question text and wikitext to specify the question type.

### The quiz tag

The <quiz> </quiz> wikitext tags implement the basic quiz functioning (see first row in the table below.) The second row in the table displays the code to suppress the display of the scoring table; the quiz score is then displayed as #right/total following the quiz. The third row displays the code to suppress the question shuffle feature.

wikitext
(what you write)
rendering
(what you see)
<quiz>
insert questions here
</quiz>
This is where questions would appear.

Your score is 0 / 0
The quiz feature parses the text between the quiz tags, to the extent possible, to create quiz questions. The quiz tags create the following quiz elements:
• a table for displaying/entering scoring points to award for right and wrong responses as well as for indicating to use or ignore coding for differentially weighted questions (i.e., questions' coefficients); displayed at the top prior to the first question in the quiz
• a Shuffle questions button, which must be used prior to answering any of the questions; once the quiz-taker starts answering questions, the order is locked; displayed at the top prior to the first question in the quiz
• a Submit button for use by the learner to score his/her responses; displayed below the last question in the quiz .
• Once scored, a colour-key indicating assigned colours for right, wrong, and not-answered responses; displayed at the top.

Note that at this time, it is not possible to score, separately, questions occurring on the same page, even if placed in separate quiz tags.

<quiz display=simple>
insert questions here
</quiz>
 This is where questions would appear. Your score is 0 / 0

Use "display=simple" as an attribute in the quiz tag to remove the "scoring points" table at the top. Consider using this option when:

• the quiz is for self-assessment and scoring is only for personal information.
• it is unlikely that users will want to revise the points awarded for rights/wrongs and the quiz doesn't use differentially weighted questions in the scoring.
<quiz shuffle=none>
insert questions here
</quiz>
This is where questions would appear.

Your score is 0 / 0

Use "shuffle=none" as an attribute in the quiz tag to remove the Shuffle questions button.

### Inserting questions

The basic structure of the question component includes

• The question text (or the characters "&nbsp;", called the non-breaking space code, because some text is required at this point).
• The type of question, which indicates the type of response area:
1. type="()" displays a radio button next to each option (only one choice allowed)
2. type="[]" displays a check box next to each item(two or more choices allowed)
3. type="{}" displays a textbox (the size of the text box can be adjusted larger or smaller)
• The answer choices, if displayed, as in multiple-choice and true/false questions
• An indication or listing of the right answer(s)
• Feedback text for a text box or each answer choice (optional)

How you arrange these few features creates the various question types which may be included in a quiz.

Tip: Adjacent questions must be separated by a blank line, otherwise the two separate questions will be interpreted, and potentially displayed, as one.

The next section includes instructions for how to code for each of the basic question types.

## Basic question types

The basic question types are described below by example. Both wikitext and rendering are provided. The wikitext shows you the code, which you may copy and paste into your pages, or just read and understand. The rendering shows you what the result will look like.

The wikitext has been slightly simplified in order to help understanding. If you copy and paste, you must insert the quiz tags, <quiz> and </quiz>, before and after the markup. You may wish to use the quiz tags with the "display=simple" option as described above.

For clarity, the examples provided below are displayed in a table. However, when a quiz is inserted into a table, the appearance of a quiz is modified, for example, boxes appear around some elements in the quiz. When a page includes a quiz not in a table, the boxes are not displayed and the format of the quiz appears simpler.

Tip: When pasting a question's wikitext onto a page, ensure that all the symbols are aligned with the leftmost edge of the editing window. If any line begins with a space, formating errors may occur.

All the examples below are functioning quizzes. Don't be afraid to try them out. Hitting the Submit button is OK - it won't change or damage this page.

### Multiple choice / single response

{Question
|type="()"}
- Distractor.
- Distractor.
- Distractor.


1. Question

 The correct answer. Distractor. Distractor. Distractor.

Your score is 0 / 0
• This type of question allows a single correct response and any number of distractors (3 distractors are shown, but it could be one, or nine, or any other number).
• The correct answer may be in any position, and is marked by a plus sign. Distractors are marked by minus signs.
• The wikitext shown should be inserted between <quiz> tags as shown above.
• Answers appear in the same order as in the markup, so it is advisable to shuffle them before exporting into markup.
• Every symbol, i.e. |, +, - and any other symbols listed further down, must be on a new line.
• The symbols must begin the newline - no spaces before them.
• The borders are a result of the border around the wiki table. They are optional.
• A distractor is the standard term for a multiple choice option which is wrong.
• The () symbol in the type attribute is supposed to look like a radio button.
• To see the full colour code (with four colours), try doing the quiz and clicking the correction button.
• A second click on a radio button (i.e. a click on an already clicked radio button) will deselect it.

### Multiple choice / single response

{Question
|type="()"}
- Distractor.
- Distractor.
- Distractor.


1. Question

 The correct answer. Distractor. Distractor. Distractor.

Your score is 0 / 0

### True/false questions

{Bulgaria and Rumania 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.


1. Bulgaria and Rumania joined the European Union in 2007.

 TRUE. FALSE.

2. Switzerland is a member of the European Union.

 TRUE. FALSE.

Your score is 0 / 0

{Anyone can be a Citizen Journalist.

type="()"}

+ TRUE. - FALSE. </quiz>

• In many quiz systems, true/false questions are listed as a separate kind of question, although they are really nothing more than a variety of multiple choice with a single response. The Wikiversity quiz extension correctly treats true/false questions as multiple choice with a single response. They are implemented in exactly the same way as above.
• The first of the two examples shows a true/false question where the correct answer is "true".
• The second of the two examples shows a true/false question where the correct answer is "false".
• The examples are live and can be tried out now.
• If you have a large number of true/false questions, a more efficient way to lay them out would be to use the tabular response type with radio buttons documented below.

### Multiple choice / multiple response

{Question
|type="[]"}


1. Question

Your score is 0 / 0
• This type of question is a multiple choice where more than one answer could be correct.
• Correct answers are indicated by plus signs, incorrect ones by minus signs.
• The wikitext shown should be inserted between <quiz> tags as shown above.
• Answers appear in the same order as in the markup, so it is advisable to shuffle them before exporting into markup.
• Every symbol, i.e. |, +, - and any other symbols listed further down, must be on a new line.
• The symbols must begin the newline - no spaces before them.
• The borders are a result of the border around the wiki table. They are optional.
• The [] symbol in the type attribute is supposed to look like a checkbox.

{ &nbsp;
|type="{}"}
Where was Aristotle born?
{ Stageira }

{ &nbsp;
|type="{}"}
Name Aristotle's famous mentor.
{ Plato }

{ &nbsp;
|type="{}"}
{ Alexander } was Aristotle's most
famous pupil.



1.

 Where was Aristotle born?

2.

 Name Aristotle's famous mentor.

3.

 was Aristotle's most famous pupil.

Your score is 0 / 0
• In a typed response the quiz-taker types an answer into a textfield using the keyboard.
• The question type is signalled using "{}" as the argument of the type.
• A textfield is inserted using curly brackets at the desired position of the textfield.
• Note that curly brackets alone don't create a textfield. The curly brackets must have spaces between them and the enclosed text. { Answer } works, but {Answer} doesn't work.
• The correct answer must be inserted between the curly brackets.
• The textfield can be positioned anywhere in the text. Text before and after the text field will display as normal text.
• The borders are a result of the border around the wiki table. They are optional.
• A non-breaking space was inserted between { and |type= because some text is required at that position (slightly buggy thing).
{
|type="{}"}
Name a famous Greek philosopher.
{ Aristotle|Plato }


1.

 Name a famous Greek philosopher.

Your score is 0 / 0
• Typed responses often have more than one possible answer. You can list all the possible answers inside the curly brackets using a pipe to separate them.
• In the example, there are two possible answers. Try it - the demo is live.

{
|type="{}"}
Name Aristotle's famous mentor.
{ Plato _6 }


1.

 Name Aristotle's famous mentor.

Your score is 0 / 0
• To modify the size of the textfield, add an underscore and an integer following the answer within the curly brackets to represent the number of glyph spaces you need.
• This number depends, however it should be around n+2 (where n is the number of glyphs in the answer)
{ Complete each box with a synonym
of the following words
|type="{}"}
<ol>
<li>free: { gratis _6 }</li>
<li>well: { good _4 }</li>
</ol>


1. Complete each box with a synonym of the following words

 free: well:

Your score is 0 / 0
• You can group the items into one only question.
• Do not use line breaks between </li> and <li>.
{
|type="{}"}
Where did Aristotle die?
{ Chalcis (i) }


1.

 Where did Aristotle die?

Your score is 0 / 0
• Case-sensitivity: typed responses are case-sensitive unless you add (i) at the position shown. The (i) stands for case-insensitive.
• If some question have more than one possible answer, you should include one (i) for each of them.

### 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

1. Complete the text from the Wikipedia article on Aristotle.

 Aristotle was born in in Chalcidice. His parents were and , who became physician to King Amyntas of Macedon. Aristotle was educated as a member of the aristocracy. At about the age of , he went to to continue his education at 's Academy. Aristotle remained at the Academy for nearly twenty years, not leaving until after Plato's death in BC.

Your score is 0 / 0
• Gapfills (or cloze exercises) are created in almost exactly the same way as typed responses. The difference is that you just write a bit more text and add a few more textfields.
• The gapfill above was additionally placed in a box and centered using a wiki table.

### Numerical response

{In which year was Plato born?
|type="{}"}
He was born in { 427-428 _5 } BC.


1. In which year was Plato born?

 He was born in BC.

Your score is 0 / 0
• At Wikiversity, numerical responses are a subtle modification of typed responses. The syntax is identical, except for some additions which allow numerical ranges and numerical tolerances if the answer is a number.
• In the example to the right, the uncertainty over Plato's date of birth is reflected in the answer by using a range. A simple hyphen between the numbers permits all numbers inbetween.
{How far is the earth from the sun?
|type="{}"}
{ 91-95 _3 } million miles.


1. How far is the earth from the sun?

 million miles.

Your score is 0 / 0
• This is another example of a range.
• The _3 ensures that the textfield doesn't get too wide.
{What is 10 times 10?
|type="{}"}
{ 100 5% _3 }


1. What is 10 times 10?

Your score is 0 / 0
• This is an example of specifying a tolerance. The critical part is "5%", which specifies the expected tolerance of 5%. In this example, values between 95 and 105 should work, but try it.
• At the time of writing, the underscore method of limiting the size of the textfield does not yet work in combination with a tolerance specification, so a range may be a better method of specifying numerical accuracy.

1. Complete the following text, inserting words and numbers as appropriate.

 The Earth formed around billion years ago and its only known natural satellite, the , began orbiting it around billion years ago. At present, the Earth orbits the once for every roughly times it rotates about its axis.

Your score is 0 / 0
• Because numerical responses are, programmatically, a sub-variety of typed response, numerical and text responses can be freely mixed in a gapfill as shown to the left.

### Tabular response type with radio buttons

 {Question
|type="()"}
| A | B | C
+-- A is correct.
-+- B is correct.
--+ C is correct.


1. Question

A B C
A is correct.
B is correct.
C is correct.

Your score is 0 / 0
• Add extra radio buttons by reduplicating the +/- signs at the beginning of each row.
• Specify columns headers by using pipes at the top.

### Tabular response type with checkboxes

{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).


1. Question

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).

Your score is 0 / 0
• This type of question has multiple everything.
• Correct answers are indicated by plus signs, incorrect ones by minus signs. By reduplicating the +/- signs at the beginning of each row, extra checkboxes can be added.
• The column headers are defined using pipes at the top as shown.

### Inserting feedback

 {Question
|type="()"}
- Distractor.
|| Feedback for distractor.
- Distractor.
|| Feedback for distractor.
- Distractor.
|| Feedback for distractor.


1. Question

 The correct answer. → Feedback for correct answer. Distractor. → Feedback for distractor. Distractor. → Feedback for distractor. Distractor. → Feedback for distractor.

Your score is 0 / 0
• Feedback is text which is initially hidden, and then shown to the user when they submit the quiz for correction. Feedback typically serves the purposes of encouragement, explanation, congratulation and commiseration.
• Feedback is set with all types by using a double vertical line || immediately after a response.
• The pipes beginning the feedback section must be on a new line.
• Unlike some other quiz systems, all feedback items are displayed on correction. With other quiz systems, the norm is to display the feedback only for those items which were selected by the user.
• To try out the feedback effect, choose a response and click the correction button. The feedback will then appear.

### Inserting blocks of text between questions

{This is the first question.
|type="()"}
- Distractor.
- Distractor.

{This is a block of text.}

{This is the second question.
|type="()"}
- Distractor.
- Distractor.


1. This is the first question.

The Arctic Tern is a seabird of the tern family Sternidae. This bird has a circumpolar distribution, breeding colonially in Arctic and sub-Arctic regions of Europe, Asia, and North America (as far south as Brittany and Massachussets).

2. This is the second question.

Your score is 0 / 0
• Text blocks can be inserted between questions by placing it between curly brackets {....}.
• The text blocks can contain wiki markup, such images, hyperlinks and formatting tags, as shown in this example.

<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>


1. Which of these are not nuts?

Your score is 0 / 0
• Unfortunately there does not yet seem to be a way of putting these into a row or tabularising the layout.
• Although this has not been done here for reasons of space, it is generally good practice to specify some kind of tooltip text for the images, but try to avoid text which gives away the answer.

### Using images in the question

<quiz display=simple>
{ What is this? [[Image:Butterfly tongue.jpg|100px| ]]
| type="()" }
- Tiger
+ Butterfly
- Bee
- Fly
</quiz>


1. What is this?

 Tiger Butterfly Bee Fly

Your score is 0 / 0

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.

1.
What kind of fish are these?

 Herring Salmon Tunafish Goldfish

Your score is 0 / 0
1.
What's this?

 a boxer engine a wankel engine a radial engine

Your score is 0 / 0
1.
How many balls are there here?

Your score is 0 / 0

#### Markup that works inside quizzes

• Images: [[Image:....]].
• Other media: [[....]].
• Bold and italic.
• <big> and <br />

#### Markup that partly works inside quizzes

• Templates: {{....}}.
• subst doesn't work.
• Tables: {|....|}.
• 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)
<quiz points="3/1!">
{Try this question now.}
+ Plus 3 points for this one.
- Minus 1 point for this one.
</quiz>


1. Try this question now.

 Plus 3 points for this one. Minus 1 point for this one.

Your score is 0 / 0
• By default, there is 1 point for a correct answer and 0 for a wrong answer.
• You can change this for the whole quiz by using a points attribute for the quiz tag.
• The format is "X/Y!", where X gives the points for a correct answer and Y the points for a wrong answer. The Y points are expressed as a positive integer but are subtracted from the score.
• Due to a bug, the points attribute has no effect if display=simple is used (version 0.9.2).
• Values like 1.25 or 2.5 are allowed
<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>


1. Try this question now.

 1 point for this one. 0 points for this one.

2. Try this question now.

 2 points for this one. 0 points for this one.

3. Try this question now.

 4 points for this one. 0 points for this one.

4. Try this question now.

 1/2 point for this one. 0 points for this one.

Your score is 0 / 0
• A coefficient is a way of giving a weighting to a specific question. Normally all the questions have the same number of points. By default, they all have one point. By specifying a coefficient for each or any question, you can multiply the number of points for that question by the coefficient.
• Coefficients can be both numbers above one and numbers between 0 and 1. If the coefficient is above 1, the question will receive greater weighting. If the coefficient is less than 1, the question will receive less weighting.
• You must put inverted commas around the argument of the coef attribute.

## 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.

## About the WikiEducator quiz feature

The quiz feature is powered by MediaWiki's quiz extension; see the WikiMedia project page for specifics about the extension, as well as discussion and development of future functionality.