# QuizLib Plugin
## Content
The QuizLib Plugin for Dokuwiki embeds the JavaScript library QuizLib (https://alpsquid.github.io/quizlib/) of Andrew Palmer. The library offers functions to parse quizzes written in well-defined HTML syntax and to evaluate the user answers. Furthermore the plugin provide a simple XML-like syntax with a generic CSS styling as a all-round carefree package. Therefore 3 ways to write quizzes exist:
* XML syntax with generic styling and generic evaluation function (only one quiz per HTML page)
* HTML syntax with individual styling and generic evaluation function (only one quiz per HTML page)
* HTML syntax and individual evaluation function for total freedom
## Preconditions
The plugin is tested with:
* 2016-06-26a "Elenor of Tsort"
* 2015-08-10a "Detritus"
## Usage
There a three kinds of question formats you can use:
* plain text
* radio buttons (exactly one correct answer)
* checkbox (one or more correct answers)
### XML style
Every quiz starts with the tag "quizlib". This tag contains as attributes the array with the correct answers ("rightanswers") and the string for the submit button ("submit"). Each element of the rightanswers-array is either a string (for the plain text questions) or again an array with the zero-based indexes ('a0', 'a1', …) of the correct answers (for radio and checkbox). Please use double quotes for the rightanswers-array and single quotes inside.
The questions itself are child elements of the quizlib-tag. Each "question" has an attribute "title" with the content of the question and an attribute "type" (text, radio, checkbox). The possible answers are a list separated by a vertical bar. If you want to use characters that are protected in XML you have to work with entity references (http://www.w3schools.com/xml/xml_syntax.asp):
* `<` for <
* `>` for >
* `&` for &
* `'` for '
* `"` for "
```xml