Extension:QuizTabulate

The QuizTabulate extension tabulates user input for the quiz extension. It allows transclusion of a quiz from the Quiz namespace. It then displays the tabulated results of that quiz on the quiz's page. In other words, it records and displays the number of times that quiz's answers were chosen.

Note: This extension has been tested to work well. However, it is experimental because it currently only works with the quiz extension's "Multiple choice" question type.

Installation
Note: The quiz extension must first be installed properly and working!

Hook installation
If you are using an older version of the quiz extension, you must add one line of code to it for tabulation to work. In the file named, make the following change to the   function (around line 290): ...	function parseQuestion( $matches ) { $question = new Question(			$this->mBeingCorrected,			$this->mCaseSensitive,			$this->mQuestionId,			$this->mParser		); wfRunHooks( 'QuizQuestionCreated', array( $this, &$question ) ); //*** INSERT THIS LINE! ***		$buffer = $question->parseHeader( $matches[1] ); ...

The latest master branch of the Quiz extension already has this code inserted and does not require modification.

Configuration parameters
$wgQuizNamespace = NS_MY_NAMESPACE; //Where NS_MY_NAMESPACE is a constant equal to, for example: 140
 * $wgQuizNamespace: The extension creates a custom namespace called "Quiz". By default, quiz results are only displayed on pages in this namespace. You can change the special Quiz namespace to any namespace you'd like. For example:

User rights
$wgGroupPermissions['*'           ]['viewquiztabulate'] = false; $wgGroupPermissions['user'        ]['viewquiztabulate'] = false; $wgGroupPermissions['autoconfirmed']['viewquiztabulate'] = false; $wgGroupPermissions['bot'         ]['viewquiztabulate'] = true; // registered bots $wgGroupPermissions['sysop'       ]['viewquiztabulate'] = true;
 * viewquiztabulate: Which users are allowed to see the tabulated results? By default this is:

Usage

 * 1) Create a quiz in the Quiz namespace.
 * 2) Transclude that quiz on some other page by using the   parser function. (optional)
 * 3) Submit some answers.
 * 4) View your answers on the quiz's page in the Quiz namespace.

Example
Create a page called  with the following contents: {Bulgaria and Rumania joined the European Union in 2007. + TRUE. - FALSE.  Create a page called  with the following contents:  Submit some answers. Navigate to. Assuming you have the appropriate User rights, you will see the Quiz's results.
 * type=""}

Resetting a quiz
Important: If anyone edits the Quiz page's source, it will reset the data for that quiz. Quiz data is tabulated for each individual revision of the Quiz page. This makes sense because if the quiz is changed, the old data is usually invalid. So navigating to a Quiz page will only show data for the current revision. To see data for a previous revision, load that revision (use the history tab).

Known issues

 * $wgQuizNamespace should allow an array.
 * The extension won't work properly if more than one Quiz is on a page. The Quiz extension is currently buggy under those circumstances anyway.
 * The extension needs to record more question types.
 * The extension does not track which answer(s) were correct.
 * Answer submissions are displayed in the order they were submitted. They should probably be shown in the order they were displayed to the users. On a related note, Answers that were never selected and submitted will not be displayed at all in the Quiz results.