%META:TOPICINFO{author="TWikiContributor" date="1302479003" format="1.1" version="$Rev$"}%
---+!! !QuizPlugin
<!--
   Contributions to this plugin are appreciated. Please update the plugin page at
   http://twiki.org/cgi-bin/view/Plugins/QuizPlugin or provide feedback at
   http://twiki.org/cgi-bin/view/Plugins/QuizPluginDev.
   If you are a TWiki contributor please update the plugin in the SVN repository.

One line description, required for extensions repository catalog:
   * Set SHORTDESCRIPTION = Small Quiz generator
-->
<sticky><div style="float:right; background-color:#EBEEF0; margin:0 0 20px 20px; padding: 0 10px 0 10px;">
%TOC{title="Page contents"}%
</div></sticky>
%SHORTDESCRIPTION%

---++ Introduction

One of the things that training design people tell us is that "it's good to checkpoint" during a training course with quiz questions. This is a little quiz formatter that lets us embed a quiz into the training in the wiki, as we develop it. Of course, you can use it for other things as well....

The sort of quizzes we need are simple; multiple choice, or questions answerable with a single string. This plugin allows us to design such simple quizzes in a TWiki topic (these are just examples; they don't work):

=%<nop>QUIZ{"Why is the sea boiling hot?" type="select" choices="It isn't;Just because;42" correct="Just because"}%=

<div class='twikiAlert'> Q1: Why is the sea boiling hot?</div>
<input type='radio' name='field' value='It isn't'> It isn't <br />
<input type='radio' name='field' value='Just because'> Just because <br />
<input type='radio' name='field' value='42'> 42 <br />

<input type=button value="Submit Answer" onClick="Submit1()">
<input type=button value="Show Solutions" onClick="Cheat1()">
<p />
=%<nop>QUIZ{"Which of the following are English Counties?" type="select" choices="Peckham;Cheshire;Argyll;Wisconsin;Cornwall" correct="Cheshire;Cornwall"}%=

<div class='twikiAlert'> Q2: Which of the following are English Counties?</div>
<input type='checkbox' name='field' value='Peckham'> Peckham <br />
<input type='checkbox' name='field' value='Cheshire'> Cheshire <br />
<input type='checkbox' name='field' value='Argyll'> Argyll <br />
<input type='checkbox' name='field' value='Wisconsin'> Wisconsin <br />
<input type='checkbox' name='field' value='Cornwall'> Cornwall <br />

<input type=button value="Submit Answer" onClick="Submit2()">
<input type=button value="Show Solutions" onClick="Cheat2()">
<p />
=%<nop>QUIZ{"How long is a yard?" type="string" correct="3.5 pints" jump="TWikiAccessControl"}%=
<div class='twikiAlert'> Q3: How long is a yard?</div>
<input type='text' name='field' size='9' maxlength='9'>  <br />
</td></tr></table><input type=button value="Submit" onClick="Submit3()">
<input type=button value="Show Solutions" onClick="Cheat3()">

---++ Usage

=%<nop>QUIZ{ " _question_ " _attributes_ }%=

| *Attribute* | *Meaning* |
| =type= | =string= (string must be matched) or =select= (multiple choice) |
| =choices= | Semicolon separated list of choices for a multiple choice |
| =correct= | Semicolon separated list of correct answers |
| =jump= | |
| =units= | Short string put after the data entry field for string questions |

---++ Installation Instructions

You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server where TWiki is running.

Like many other TWiki extensions, this module is shipped with a fully
automatic installer script written using the Build<nop>Contrib.
   * If you have TWiki 4.2 or later, you can install from the =configure= interface (Go to Plugins->Find More Extensions)
      * See the [[http://twiki.org/cgi-bin/view/Plugins/BuildContribInstallationSupplement][installation supplement]] on TWiki.org for more information.
   * If you have any problems, then you can still install manually from the command-line:
      1 Download one of the =.zip= or =.tgz= archives
      1 Unpack the archive in the root directory of your TWiki installation.
      1 Run the installer script ( =perl &lt;module&gt;_installer= )
      1 Run =configure= and enable the module, if it is a plugin.
      1 Repeat for any missing dependencies.
   * If you are *still* having problems, then instead of running the installer script:
      1 Make sure that the file permissions allow the webserver user to access all files.
      1 Check in any installed files that have existing =,v= files in your existing install (take care *not* to lock the files when you check in)
      1 Manually edit !LocalSite.cfg to set any configuration variables.

%IF{"defined 'SYSTEMWEB'" else="<div class='twikiAlert'>%X% WARNING: SYSTEMWEB is not defined in this TWiki. Please add these definitions to your %MAINWEB%.TWikiPreferences, if they are not already there:<br><pre>   * <nop>Set SYSTEMWEB = %<nop>TWIKIWEB%<br>   * <nop>Set USERSWEB = %<nop>MAINWEB%</pre></div>"}%


If the plugin is installed, you will see a question here:
%QUIZ{"Is the QuizPlugin installed and working?" type="select" choices="yes;no;maybe" correct="yes"}%

---++ Plugin Info

|  Plugin Author: | TWiki:Main.CrawfordCurrie |
|  Copyright: | &copy; 2001 Motorola Ltd. and &copy; 2007 C-Dot Consultants http://c-dot.co.uk <br /> &copy; 2008-2011 TWiki:TWiki.TWikiContributor |
|  License: | [[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]] |
|  Plugin Version: | 2011-04-10 |
|  Change History: | <!-- versions below in reverse order -->&nbsp; |
|  2011-04-10: | TWikibug:Item6638: Doc improvements -- TWiki:Main.PeterThoeny |
|  2007-02-22: | Initial version |
|  Dependencies: | None |
|  Plugin Home: | http://twiki.org/cgi-bin/view/Plugins/QuizPlugin |
|  Feedback: | http://twiki.org/cgi-bin/view/Plugins/QuizPluginDev |
|  Appraisal: | http://twiki.org/cgi-bin/view/Plugins/QuizPluginAppraisal |

__Related Topics:__ %SYSTEMWEB%.TWikiPlugins, %SYSTEMWEB%.UserDocumentationCategory, %SYSTEMWEB%.TWikiPreferences
