[title sub="Written by Chris Graham (ocProducts)"]Composr Tutorial: Quizzes[/title]

[media width="150" description="Viewing a quiz" float="right"]data_custom/images/docs/tut_quizzes/quiz_view.png[/media]
{!quiz:DOC_QUIZZES}

[contents]decimal,lower-alpha[/contents]

[title="2"]Managing quizzes[/title]

[media width="150" description="Adding a quiz" float="right"]data_custom/images/docs/tut_quizzes/quiz_add.png[/media]
Quizzes can be added/edited/deleted from Content Management > Quizzes.
You can delete a quiz from the bottom of its edit form.

Quiz results can be managed from Admin Zone > Audit > Quizzes.

[title="2"]Types of quiz[/title]

In summary:
 - Survey: collect results from entrants, no wrong answers
 - Test: entrants pass or fail
 - Competition: winners picked from those on top scores

[title="3"]Competitive[/title]

Competitions are entered by members and marked; winners may then be chosen from the Admin Zone.

Example:
[indent]The website of a computer games studio could run a competition asking questions about their latest game. The top entrant would win a tour of the games studio headquarters, and three runner ups could win a copy of any game of their choice from their back catalogue.[/indent]

[title="3"]Tests[/title]

Tests are marked as they're completed, and the results sent out as a staff notification.

Example:
[indent]The Mensa website could run a quiz to help determine if candidates have a high enough IQ to join Mensa. The quizzes would be automatically marked and the result given to both the visitor and the Mensa staff.[/indent]

Completed tests are shown on member profiles.

[title="3"]Surveys[/title]

Survey results are collected and available from the Admin Zone, and also staff notifications are sent. As survey results are stored in the database, experts may use [concept]SQL[/concept] to make statistical calculations on data.

Example:
[indent]A teen community could make a survey to find out teen attitudes on various social issues, to help them write a report to the government lobbying for changes to policy.[/indent]

Multiple-choice/single-choice inputs are collected under a statistics heading. Full responses (including free-input text fields) may be viewed individually.

[title="2"]Input syntax[/title]

The method of inputting quiz questions may seem a bit fiddly at first, but you'll find it is actually fairly straight-forward and makes it really quick to input new sets of questions.

The text should consist of question blocks, each question block having a blank line between it and the next. The first line of a question block is the question, and subsequent lines are a set of potential answers.

There are a few different types of question, indicated by a little tag after the question:
 - [tt][MULTIPLECHOICE][/tt] -- The user can pick any one answer from the answer set.
 - [tt][MULTIMULTIPLE][/tt] -- The user can pick multiple answers from the answer set.
 - [tt][LONG][/tt] -- A multi-line typed answer. the answer set will be ignored as it cannot be auto-marked.
 - [tt][SHORT][/tt] -- A single-line typed answer. If correct answers are provided then an inexact match is performed. The match is a case-insensitive punctuationless match for being within 75% closeness to the correct answer (25% of the characters may need to be added/removed/substituted) -- the user needs to hit a valid answer, and miss all invalid answers.
 - [tt][SHORT_STRICT][/tt] -- A single-line typed answer. If correct answers are provided then a case-sensitive exact match will be performed.

If a question is followed by [tt][REQUIRED][/tt] then Composr will force it to be filled in (unless you have set a timeout and the timeout is exceeded).

You may put line(s) starting with a [tt]:[/tt] immediately under the question, to provide a longer caption for the question.

You may also put line(s) starting with a [tt]:[/tt] and followed by an explanation, below each answer to a question, which will be displayed at completion for the explanation as to specifically why the given answer was correct or incorrect.

There is support for marking. If an answer is followed by [tt][*][/tt] then it is considered "correct" (this is very important for competitions and tests). If nothing is marked correct, the question will be considered as manually-marked (resulting in a quoted result range for the user, rather than a specific result), unless [tt][UNMARKED][/tt] is put after the question, in which case it will be collected but not count towards marking.

Comcode is supported, so you could include images using code such as:
[code="Comcode"]
[url="/example.png" target="_blank"][img]/example_thumb.png[/img][/url]
[/code]

[title="2"]Time limits[/title]

You can set a time limit for a quiz, and also how frequently quizzes can be reattempted.

Note that if you change the time limit while someone is using the quiz then the limit will not properly be reflected for them unless they refresh their browser. Specifically:
 - If the limit is lengthened, JavaScript would not know and give an error too early.
 - If the limit is shortened, JavaScript would not know and give no error when it should have -- but a server-side error would be given when submitting.

[title="2"]Accessing/linking quizzes[/title]

Quizzes may be accessed via the [tt]quiz[/tt] module ([tt]site:quiz[/tt] page-link, Content > Quizzes on the default menus).

If you don't have the default menus you may want to create a menu link direct to your quiz. To add your quiz to a menu, use the Sitemap tool within the menu editor. You will find your quiz is available as a link underneath Site\Quiz.

[title="2"]Scoring[/title]

There are a number of features for scoring and rewarding members, and for using quizzes as an educational tool.

You can mark which answers are correct (not applicable to surveys), and write out custom explanations for why incorrect responses are incorrect.

You can reward members with points for passing a test.

Questions that aren't multi-choice will be either:
[list="a"]
[*] manually-marked
[*] unmarked
[/list]

Manually marked questions result in a percentage range being shown to the user, as the system won't know the true percentage. There's no feature to put in the mark, the expectation would be that it would happen elsewhere (e.g. when picking a competition winner, when contacting the student manually, etc).

Unmarked questions just don't count toward anything. So if you had 5 questions and 1 was unmarked, it would be marked out of 4.

[title="2"]Security and difficulty[/title]

You can determine the level of security or difficulty on quizzes:
 - Restrict them only to newsletter subscribers
 - Restrict them by usergroup
 - Randomly shuffle questions and/or answers, to make copying from a cheat-sheet (or thoughtless answering) less likely
 - Time limits (explained above)
 - Limiting open time range
 - Validation (to hide quizzes that are not yet ready)

[title="2"]Quiz sets (advanced)[/title]

If you prefix quiz names with "Example: " then you can create quiz sets.

This is mainly just a convention and won't affect how the system works. However, for tests, it will result in running scoring/percentages for the whole test set, when viewing past results on a member's profile screen.

Often surveyors will want to create long multi-part questionnaires. You could link parts together in a chain by putting a follow-up link in each quizzes end-text. Use of the naming convention will help you (and users) intuitively recognise that particular quizzes are designed to go together.

[title="2"]Exporting to CSV[/title]

You can export quiz results to a CSV file which is very useful for data analysis purposes. In particular, if some test/competition questions need to be manually marked, doing so in spreadsheet software works well.

Many marketing agencies prefer to pick competition winners from raw CSV data, as well as processing the data for further marketing purposes.

[title="2"]Advanced quiz interfaces (advanced)[/title]

You may want quizzes that span multiple screens, or take the user in different directions as they answer questions.
It's not really feasible for us to allow the quiz system to build arbitrarily complex quiz systems. There would be too many assumptions / deviations between different project requirements, and such a system would be too complex to configure. Generally these will therefore require a programmer to construct. We do have a "decision tree" framework in Composr that can aid in building complex multi-screen form systems. It takes out most of the work of building the screens, the forms, the state management, and the UI -- just leaving the programmer to declaratively specify the question structure and bind it to some actualiser code.

[title="2"]See also[/title]

 - [page="_SEARCH:tut_featured"]Featuring content[/page]
 - [page="_SEARCH:tut_sql"]Manually editing your database with phpMyAdmin[/page]

{$SET,tutorial_tags,quizzes,Feedback features,Content,novice}{$SET,tutorial_add_date,Aug 2008}{$SET,tutorial_summary,How to add competitions, surveys, and tests.}[block]main_tutorial_rating[/block]
