Extension:Quiz

'''Quiz is a tool for creating quizzes. This extension aims at being :'''
 * Reliable and light.
 * Simple in its syntax and its use; powerful in its possibilities.
 * Open to suggestions and improvements (by facilitating the addition of new types of questions).

Help / Hilfe / Aide
Currently, the help pages are hosted on the wikiversities in order to allow working examples.
 * Please consult the help on the Quiz syntax.
 * Bitte, beraten Sie die Hilfe auf der Quiz syntax.
 * Veuillez consulter l'Aide sur la syntaxe Quiz.

Installation Instructions
require_once 'extensions/quiz/Quiz.php';
 * 1) Create a new directory named "quiz" in the "extensions" directory of your wiki.
 * 2) Copy the downloaded files into the new directory.
 * 3) Add this line at the end of the LocalSettings.php :

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 knowledges of PHP.

If you are not able yourself to create your new type of question, contact me and I'll see what I can do.

  The first thing that you must do is choose a syntax (the simplest possible) for your question type.

The restrictions are:   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': $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.
 * 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").

Name the function "questionTypeNameParseObject" and implement as follows : /** * Convert a basic type object from quiz syntax to HTML. * * @param  $input				A question object in quiz syntax * @param $quiz				The current quiz * @see   class Quiz * * @return $output				A question object in HTML. */ function questionTypeNameParseObject($input, $quiz) { // your code here. $this->setState(""); // Set the state if needed. return $output; }   Write down your syntax specifications which will be added to the Extension:Quiz/Help. Please read first the existing help.   Once this is all done, contact me to include officially your question type inside the extension.  

Reporting a bug

 * Use → instade of —› -- MichaelFrey 17:12, 29 March 2007 (UTC)
 * Corrected in 0.7b


 * Sometimes I see the source of the quiz instade of the "rendered quiz". A work-a-round is &action=purge or a simple null edit. -- MichaelFrey 06:02, 1 April 2007 (UTC)
 * I don't really know how it could be avoided.


 * I don't how critical it is, but it's possible to use more HTML in a quiz then on a normal wikipage: v:de:Benutzer:MichaelFrey/Spielwiese -- MichaelFrey 06:45, 1 April 2007 (UTC)
 * This XSS vulnerability is fixed with 0.7b Lrbabe 13:32, 2 April 2007 (UTC)


 * Currently javascript doesn't work on the wikiversity due to an uppercase in the extension's directory name.


 * It's not possible do use Templates in the questions, see . Templates in questions are, for example, usefull for link to mediafiles and to wikipedia. -- MichaelFrey 15:54, 4 April 2007 (UTC)
 * Corrected in 0.7b
 * Thanks -- MichaelFrey 14:29, 5 April 2007 (UTC)
 * Minor: If the } of the inclusion is the last sign in the question, it doesn't work:
 * It's not importent, but I it should be documentated.
 * -- MichaelFrey 08:07, 7 April 2007 (UTC)
 * Also Minor: Subst doesn't work. -- MichaelFrey 08:37, 7 April 2007 (UTC)


 * I can't set the points and/or ignore the coeffs with the syntax descripted in : -- MichaelFrey 08:07, 7 April 2007 (UTC)
 * Negative Coefs are possible but not logic: -- MichaelFrey 18:24, 10 April 2007 (UTC)
 * There is a hole which allow Javascript:  -- MichaelFrey 18:24, 10 April 2007 (UTC)
 * thanks to lrbabe -- MichaelFrey 16:18, 17 April 2007 (UTC)


 * . is the only possible Decimal separator, but in some countries use comma as decimal seperator (MichaelFrey 15:33, 19 April 2007 (UTC)


 * The new text/number input works with IE7, but it looks not good as FF2.0: -- MichaelFrey 15:33, 19 April 2007 (UTC)

Add found bugs here.

TODO
All suggestions on the extension and its future possibilities are welcome: Extension_talk:Quiz.
 * 1.0 :
 * Improving the layout of textfields with IE7.
 * Improving accessibility ( it requires an alternative to colors inorder to display questions's state as well as inputs's state ).
 * Allowing coma as a decimal separator.
 * Display caption colors even in display="simple" mode.
 * Possibility of defining area of questions that will not be shuffled. (ECMAscript).
 * 2.0
 * Export to SCORM possibility. A possibility of importation would be interesting also but seems difficult because of the complexity of SCORM.
 * Improving the feedback to make it conditionnal.
 * Improving the points counter (ie giving 1 point per right answer in a single question).

ChangeLog
  0.7b

</li>  0.5b
 * Improvements :
 * Possibility of shuffling the whole quiz (ECMAscript)
 * Syntax :
 * Questions can be separated by only one blank line.
 * Bugs fixed :
 * It is now possible to write a correction inside question's headings.
 * Removed an XSS vulnerability alowing to add unsafe HTML markup and script after the last question.
 * Other :
 * It is no more possible to write text betweens questions !

Thanks to Tim Starling code's reviews, several bugs have been cleaned up, the XSS holes removed and the extension is ready to be installed on the wikiversity.

</li>  0.1b
 * Improvements :
 * New question type : "categorical question"(take a look at the Extension:Quiz/Help).
 * Possibility to write text betweens questions.
 * Creation of a standard internationalisation file.
 * Possibilty of "unchecking" radio button on double-click.
 * Syntax :
 * For technical resons, questions must b separated by at least 2 blank lines.

First release ! </li> </ul>