Read Me

quizzy is a PHP library that uses jQuery to deliver an nice looking animated quiz to visitors to your page
and is distributed under the GNU Affero General Public License v3. This means that you are free to use quizzy
as you desire on any of your pages. However, if you make any changes to quizzy, your source code must be made
available.
It loads quiz data from XML files stored on the server and loads all the data in small increments using AJAX.
This decreases the amount of data that needs to be loaded with the page to add the quiz and prevents users
from cheating by simply looking at the source of the page. Quizzy supports multiple-choice questions, select-all-
that-apply type questions, text input questions, and number input questions (see description of question types)
below.
quizzy requires PHP 5 (for simplexml) and either the PHP json extension (in PHP 5.2.0) or the Zend JSON framework.
jQuery does not support effects in Internet Explorer in quirks mode so the first line on the PHP page containing
quizzy must be a Strict DOCTYPE like the following:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
quizzy still functions correctly in quirks mode in Internet Explorer, there are just several more issues (see below).
------------------------------------- Instructions for use of quizzy ----------------------------------------------
0. Make sure that you have the json extension enabled in your php configuration.
You may have to edit /etc/php/php.ini and uncomment or add the line 'extension json.so'.
If you do not have the json extension available. You can use the Zend JSON framework:
a. Go to http://framework.zend.com/download/current/ and download the "Zend Framework Full" tar.gz file (4th option).
b. Create a folder called 'Zend' in your quizzy directory.
c. Extract the Zend framework tar ball you got somewhere. Copy the following files into the Zend folder in quizzy
Zend/Json.php
Zend/Json/*
1. Extract quizzy and put the 'quizzy' directory into the same folder as your webpage.
2. Drop <?php include 'quizzy/quizzy_header.php';?> in your <head> section
3. Put <?php include 'quizzy/quizzy.php'; ?> in your <body> section where you want the quiz
4. Edit quizzy_config.php to your liking
5. Create some quizzes and drop them into $quiz_folder (probably 'quizzy/quizzes/')
You can either do this by hand using the XML structure described below or use the quizzyBuilder
available at http://quizzy.sf.net/quizzyBuilder
------------------------------------------- Browser compatibility -------------------------------------------------
Tested and confirmed working in the following browsers:
IE 6, 7, and 8
Firefox 1.5, 2, 3, and 3.5
Opera 8, 9, and 10
Safari 4 and 5
Chrome
Konqueror 4.3
IE issues:
- Images are constrained by having a width or height set, since max-width & max-height do not work (6)
- Images specified for a quiz are not placed correctly so they are disabled (6 and 7)
- Images specified for quiz descriptions disappear after the description scrolls down so they are disabled (6)
- Scrollbars do not work and are disabled. (6 and 7)
- Loading message does not work so users will not be told when AJAX calls are being loaded. (6, 7, and 8)
- If IE does not see a Strict DOCTYPE on the first line, it will revert to quarks mode and there are the following issues:
- scrollUp animations will not look very good.
- The loading plugin will try to work but be broken.
Opera issues:
- When scrolling to the second question (and only that one) the first question scrolls from off the
right side of the screen (instead of its current location). I have no idea why.
Overall issues:
- Quizzes with descriptions that have pictures will not slide down in a smooth fashion.
This issue is being worked on.
- If you skin the quiz to be position: absolute, the jQuery loading plugin stops working.
----------------------------------------- Quiz XML Formatting --------------------------------------------------
Any line in [square brackets] is optional, lines that have ... are places you can add more of that type
of element. Any picture you add has to be under the quizzes/[pictures directory] folder.
See quizzy_config.php.
<?xml version="1.0" encoding="utf-8"?>
<quizzes>
<quiz>
<title>Quiz title</title>
[<img src="foo.jpg" alt="bar" />]
<description>
<text>Quiz description</text>
[<img src="foo.jpg" alt="bar" />]
</description>
<grading>
<range start="0" end="60">
<grade>F</grade>
<rank>Rank</rank>
[<img src="foo.jpg" alt="bar" />]
</range>
...
</grading>
<question>
<text>Question Text</text>
[<img src="foo.jpg" alt="bar" />]
<option>
<text>Option Text</text>
[<img src="foo.jpg" alt="bar" />]
<score>3</score>
<explanation>
<text>Explanation text</text>
[<img src="foo.jpg" alt="bar" />]
</explanation>
</option>
...
</question>
...
</quiz>
...
</quizzes>