#ACL VdCGroup:read,write All:read

{{{#!raw
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!--
   hanziquiz.html
   version 0.3.1
   Copyright (C) 2003 by Forrest Cahoon (hanziquiz@abstractfactory.org)

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Hanzi Quiz</title>
<style type="text/css">
#score { visibility:hidden; text-align:center }
#question { visibility:hidden; width:100%; text-align:center }
#end_quiz { visibility:hidden; width:100%; text-align:center; font-size:18pt }
/*
** The following styles determine how the questions are displayed.
** They are of the form <Category>_question and <Category>_choice
** where <Category> is the category name from hanzicards.js with
** all spaces removed.
**
** <Category>_question is the style for the question display, and
** <Category>_choice is the style for the choice buttons.
**
** It may be necessary to adjust the font sizes here to accomodate
** different screen resolutions.
*/
.Pinyin_choice, .English_choice {
     width:50%; text-align:center; 
     padding-top:12px; padding-bottom:12px;
   font-size:24pt; 1280x1024 resolution */
/*     font-size:16pt; /* 1024x768 resolution */
}
.Pinyin_question, .English_question {
     width:50%; text-align:center; 
     padding-top:12px; padding-bottom:12px; font-style:bold;
   font-size:24pt; 1280x1024 resolution */
/*     font-size:18pt; /* 1024x768 resolution */
}
.SimplifiedHanzi_question, .SimplifiedHanzi_choice,
.TraditionalHanzi_question, .TraditionalHanzi_choice {
     width:50%; text-align:center;  font-style:bold;
   padding-top:12px; padding-bottom:12px; font-size:36pt; 1280x1024 */
/*     padding-top:6px; padding-bottom:6px; font-size:20pt; /* 1024x768 */
}
</style>
<script type="text/javascript">
// hanzicards.js    -*- mode:C; coding: utf-8 -*-
// version 0.3.1
// Copyright (C) 2003 by Forrest Cahoon (hanziquiz@abstractfactory.org)
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
var Category = new Array("Simplified Hanzi", "Traditional Hanzi", 
                         "Pinyin", "English", "Français");
var Qsel_default_index = 4;
var Asel_default_index = 1;
var Deck = new Array(
   new Array(      
      new Array( "暗", "暗",  "àn",     "dark",                "sombre"),
      new Array( "北", "北",  "běi",    "north",               "nord"),
      new Array( "茶", "茶",  "chá",    "tea",                 "thé"),
      new Array( "长", "長",  "cháng",  "long",                "long"),
      new Array( "车", "車",  "chē",    "vehicle",             "véhicule"),
      new Array( "橙", "橙",  "chén",   "orange",              "orange"),
      new Array( "吃", "吃",  "chī",    "eat",                 "manger"),
      new Array( "大", "大",  "dà",     "big",                 "grand"),
      new Array( "电", "電",  "diàn",   "electric",            "électrique"),
      new Array( "东", "東",  "dōng",   "east",                "est"),
      new Array( "短", "短",  "duǎn",   "short",               "court"),
      new Array( "风", "風",  "fēng",   "wind",                "vent"),
      new Array( "狗", "狗",  "gǒu",    "dog",                 "chien"),
      new Array( "好", "好",  "hǎo",    "good",                "bien"),
      new Array( "黑", "黑",  "hēi",    "black",               "noir"),
      new Array( "红", "紅",  "hóng",   "red",                 "rouge"),
      new Array( "坏", "壞",  "huài",   "bad, broken",         "mauvais, cassé"),
      new Array( "火", "火",  "huǒ",    "fire",                "feu"),
      new Array( "家", "家",  "jiā",    "home",                "maison"),
      new Array( "江", "江",  "jiāng",  "river",               "fleuve"),
      new Array( "看", "看",  "kàn",    "look",                "voir"),
      new Array( "蓝", "藍",  "lán",    "blue",                "bleu"),
      new Array( "老", "老",  "lǎo",    "old",                 "vieux"),
      new Array( "雷", "雷",  "léi",    "thunder",             "éclair"),
      new Array( "妈", "媽",  "mā",     "mother",              "mère"),
      new Array( "马", "馬",  "mǎ",     "horse",               "cheval"),
      new Array( "猫", "貓",  "māo",    "cat",                 "chat"),
      new Array( "门", "門",  "mén",    "door, gate",          "porte"),
      new Array( "明", "明",  "míng",   "bright",              "brillant"),
      new Array( "南", "南",  "nán",    "south",               "sud"),
      new Array( "男", "男",  "nán",    "male",                "mâle"),
      new Array( "能", "能",  "néng",   "to be able",          "être capable de"),
      new Array( "你", "你",  "nǐ",     "you",                 "tu"),
      new Array( "女", "女",  "nǚ",     "female",              "femelle"),
      new Array( "人", "人",  "rén",    "person",              "personne"),
      new Array( "日", "日",  "rì",     "sun",                 "soleil"),
      new Array( "肉", "肉",  "ròu",    "meat, flesh",         "viande"),
      new Array( "山", "山",  "shān",   "hill, mountain",      "montagne"),
      new Array( "上", "上",  "shàng",  "above, up, towards",  "dessus"),
      new Array( "水", "水",  "shuǐ",   "water",               "eau"),
      new Array( "天", "天",  "tiān",   "day, sky, heaven",    "jour"),
      new Array( "西", "西",  "xī",     "west",                "ouest"),
      new Array( "下", "下",  "xià",    "down",                "dessous"),
      new Array( "小", "小",  "xiǎo",   "small",               "petit"),
      new Array( "谢", "謝",  "xiè",    "thank",               "merci"),
      new Array( "心", "心",  "xīn",    "heart",               "âme"),
      new Array( "要", "要",  "yào",    "want",                "vouloir"),
      new Array( "有", "有",  "yǒu",    "have",                "avoir"),
      new Array( "月", "月",  "yuè",    "moon, month",         "lune, mois"),
      new Array( "再", "再",  "zài",    "again",               "encore"),
      new Array( "在", "在",  "zài",    "at",                  "à"),
      new Array( "中", "中",  "zhōng",  "middle",              "milieu")
   ),
      new Array(
      new Array( "聪明", "聰明",  "cōng míng",   "intelligent",           "intelligent"),
      new Array( "电话", "電話",  "diàn huà",    "telephone",             "télephonne"),
      new Array( "电视", "電視",  "diàn shì",    "television",            "télévision"),
      new Array( "东西", "東西",  "dōng xī",     "thing",                 "quelque chose"),
      new Array( "法国", "法國",  "fǎ guó",      "France",                "France"),
      new Array( "房子", "房子",  "fáng zi",     "house, building",      "maison, construction"),
      new Array( "非常", "非常",  "fēi cháng",   "extraordinary",         "extraordinaire"),
      new Array( "飞机", "飛機",  "fēi jī",      "airplane",              "avion"),
      new Array( "高兴", "高興",  "gāo xìng",    "happy",                 "heureux"),
      new Array( "公司", "公司",  "gōng sī",     "company, corporation",  "société"),
      new Array( "公园", "公園",  "gōng yuán",   "park",                  "parc"),
      new Array( "火车", "火車",  "huǒ chē",     "train",                 "train"),
      new Array( "结婚", "結婚",  "jié hūn",     "marry",                 "Mariage"),
      new Array( "今天", "今天",  "jīn tiān",    "today",                 "aujourd'hui"),
      new Array( "咖啡", "咖啡",  "kā fēi",      "coffee",                "café"),
      new Array( "老虎", "老虎",  "lǎo hǔ",      "tiger",                 "tigre"),
      new Array( "美国", "美國",  "měi guó",     "The United States",     "Amérique"),
      new Array( "明天", "明天",  "míng tiān",   "tomorrow",              "demain"),
      new Array( "漂亮", "漂亮",  "piào liàng",  "pretty, handsome",      "joli"),
      new Array( "苹果", "蘋果",  "píng guǒ",    "apple",                 "pomme"),
      new Array( "上班", "上班",  "shàng bān",   "go to work",            "aller au travail"),
      new Array( "时间", "時間",  "shí jiān",    "time (n.)",             "le temps"),
      new Array( "随便", "隨便",  "suí biàn",    "casual",                "Occasionnel"),
      new Array( "天气", "天氣",  "tiān qì",     "weather",               "météo"),
      new Array( "下班", "下班",  "xià bān",     "leave work",            "quitter le travail"),
      new Array( "现在", "現在",  "xiàn zài",    "now",                   "maintenant"),
      new Array( "休息", "休息",  "xiū xi",      "rest (v.)",             "se reposer"),
      new Array( "英国", "英國",  "yīng guó",    "England",               "Angleterre"),
      new Array( "中国", "中國",  "zhōng guó",   "China",                 "Chine"),
      new Array( "中文", "中文",  "zhōng wén",   "Chinese language",      "langue Chinoise"),
      new Array( "昨天", "昨天",  "zuó tiān",    "yesterday",             "hier")
   ),
   new Array(
      new Array( "先生", "先生",  "xian sheng",  "mister",                "monsieur"),
      new Array( "你好", "你好",  "Nǐ hǎo",      "hello",                 "bonjour"),
      new Array( "忙",   "忙",   "Máng",        "busi",                  "occupé"),
      new Array( "不",   "不",   "Bù",          "not",                   "non"),
      new Array( "都",   "都",   "Dōu",        "all",                   "tout, entierement"),
      new Array( "这",   "這",   "Zhè",         "this",                  "ce"),
      new Array( "书",   "書",   "Shū",         "book",                  "livre"),
      new Array( "支笔",  "枝筆", "zhī bǐ",      "pen",               "stylo"),
      new Array( "毛笔",  "毛筆",  "Máo bǐ",     "painting pen",         "pinceau"),
      new Array( "铅笔",  "鉛筆",  "Qiān bǐ",    "pencil",               "crayon"),
      new Array( "钢笔",  "鋼筆",  "Gāng bǐ",    "Steel brush",          "stylo plume")
   ),
   new Array(
      new Array( "我", "我",  "wǒ",     "I,me",                "je"),
      new Array( "你", "你",  " ni",     "you",                 "tu"),
      new Array( "他", "他",  "tā",     "he, him",             "il"),
      new Array( "她", "她",  "tā",     "she, her",            "elle"),
      new Array( "我们", "我們",  "wǒ men",     "I,me",                "nous"),
      new Array( "你们", "你們",  " ni men",     "you",                 "vous"),
      new Array( "他们", "他們",  "tā men",     "he, him",             "ils"),
      new Array( "她们", "她們",  "tā men",     "she, her",            "elles"),
      new Array( "你们", "你們",  " ni men",     "you",                   "vous"),

      new Array( "我", "我",  "wǒ",     "I,me",                "je"),
      new Array( "你", "你",  " ni",     "you",                 "tu"),
      new Array( "他", "他",  "tā",     "he, him",             "il"),
      new Array( "她", "她",  "tā",     "she, her",            "elle"),
      new Array( "我们", "我們",  "wǒ men",     "I,me",                "nous"),
      new Array( "你们", "你們",  " ni men",     "you",                 "vous"),
      new Array( "他们", "他們",  "tā men",     "he, him",             "ils"),
      new Array( "她们", "她們",  "tā men",     "she, her",            "elles"),
      new Array( "你们", "你們",  " ni men",     "you",                   "vous")
   )
);
// hanzifuncs.js    -*- mode:C; coding: utf-8 -*-
// version 0.3.1
// Copyright (C) 2003 by Forrest Cahoon (hanziquiz@abstractfactory.org)
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
////////////////////////////////////////////////////////////////////////
var Qcat; // questions are of type Category[Qcat]
var Acat; // answer choices are of type Category[Acat]
var Qnum; // Question[Qnum] is displayed, then Qnum is incremented
var Numchoices = 5; // Number of choices displayed for each question
var Question = new Array(); // an array of objects with this structure:
    // Question[].deck_idx : index of Deck array for this question's Deck
    // Question[].card : Card which is the correct answer
    // Question[].choice[] : Array of Numchoices guesses
var Recent_answers = new Object(); // Store correct answers here while
    // constructing the questions to avoid presenting them as choices in
    // subsequent questions.  Structure:
    // Recent_answers.deck : Array containing an array of recent answers
    //                       for each deck (indexed by Deck array index)
    // Recent_answers.max_length : Array containing the max number of
    //                             recent answers to store for each deck
    // Recent_answers.insert_point : Array containing, for each deck i,
    //                               the index of Recent_answers.deck[i] to
    //                               which the next answer should be written.
var Display = new Object(); // Contains the textNodes whose values
			    // we want to update:
    // Display.question is the question textNode
    // Display.choice[] is an array of the textNodes for the choices
var Starttime; // start time for timing stats
var Rightcount = 0, Wrongcount = 0; // right and wrong counts for stats
var Wronglist = new Array(); // list of incorrectly guessed cards to
			     // display at the end of the quiz
////////////////////////////////////////////////////////////////////////
function setup()
{
   var i;
  // Initialize Recent_answers
   Recent_answers.max_length = new Object();
   Recent_answers.insert_point = new Object();
   Recent_answers.deck = new Array();
   for (i=0; i<Deck.length; i++) {
      Recent_answers.deck[i] = new Array();
      if (Deck[i].length < 2*Numchoices) {
         alert("Sorry, not enough questions have been provided\n" +
               "deck " + (i+1) + " to run this program");
         window.location = "about:blank"; // change to error page
      }
      Recent_answers.max_length[i] = 
         Math.min(Math.round(Deck[i].length/2), Deck[i].length - 2*Numchoices);

      Recent_answers.insert_point[i] = 0;
   }
   // Build the selection lists for questions and answers
   var Qsel_list = document.getElementById("Qsel");
   var Asel_list = document.getElementById("Asel");
   var q_selected, a_selected;
   for (i=0; i<Category.length; i++) {
      q_selected = (i == Qsel_default_index);
      Qsel_list.options[i] = new Option(Category[i], "",
                                        q_selected, q_selected);
      a_selected = (i == Asel_default_index);
      Asel_list.options[i] = new Option(Category[i], "",
                                        a_selected, a_selected);
   }
}
////////////////////////////////////////////////////////////////////////
function begin_quiz()
{
   Qcat = document.getElementById("Qsel").selectedIndex;
   Acat = document.getElementById("Asel").selectedIndex;

   if (Qcat == Acat) {
      alert ("The question and answer categories can't be the same!");
      window.location = "hanziquiz.html";
      return;
   }
   // Build the question <table>
   var table = document.getElementById("question");
   var tbody = document.createElement("tbody") // IE requires this.
   var tr = document.createElement("tr");
   var td = document.createElement("td");
   td.className = Category[Qcat].replace(/\W/,"") + "_question";
   Display.question = document.createTextNode("");
   td.appendChild(Display.question);
   tr.appendChild(td);
   tbody.appendChild(tr);
   Display.choice = new Array();
   for (i=0 ; i<Numchoices ; i++) {
      tr = document.createElement("tr");
      td = document.createElement("td");
      var button = document.createElement("button");
      button.className = Category[Acat].replace(/\W/,"") + "_choice";
      Display.choice[i] = document.createTextNode("");
      button.appendChild(Display.choice[i]);
      button.name = i; // Set the name attribute to the array index so
		       // the event handler can determine which button
		       // was clicked.
      button.onclick = process_answer;
      td.appendChild(button);
      tr.appendChild(td);
      tbody.appendChild(tr);
   }
   table.appendChild(tbody);
   buildQuestion();
// err404 
// Qnum = 0 ;
   Qnum = 72;
   Starttime = new Date().getTime();
   display_question();
   document.getElementById("setup").style.display="none";
   document.getElementById("question").style.visibility="visible";
}
///////////////////////////////////////////////////////////////////
function buildQuestion()
{
   var num = 0;
   for (var i=0 ; i<Deck.length ; i++) {
      for (var j=0 ; j<Deck[i].length ; j++) {
	 Question[num] = new Object();
	 Question[num].deck_idx = i;
	 Question[num].card = Deck[i][j];
	 num++;
      }
   }
   shuffle(Question);
   for (i=0 ; i<Question.length ; i++) {
      buildChoice(Question[i]);
   }
}
///////////////////////////////////////////////////////////////////
function in_recent_answers(answer, deck_idx) 
{
   for (var i=0 ; i<Recent_answers.deck[deck_idx].length ; i++) {
      if (answer == Recent_answers.deck[deck_idx][i]) return true;
   }
   return false;
}
///////////////////////////////////////////////////////////////////
function add_to_recent_answers(answer, deck_idx)
{
   Recent_answers.deck[deck_idx][Recent_answers.insert_point[deck_idx]] = 
      answer;
   Recent_answers.insert_point[deck_idx]++;
   if (Recent_answers.insert_point[deck_idx] >= 
              Recent_answers.max_length[deck_idx]) {
      Recent_answers.insert_point[deck_idx] = 0;
   }
}
///////////////////////////////////////////////////////////////////
function buildChoice(Q)
{
   var allowed_choices = new Array();
   var i, j, k, test_card;
   j = 0;
   for (i=0; i<Deck[Q.deck_idx].length; i++) {
      test_card = Deck[Q.deck_idx][i];
      if (!in_recent_answers(test_card, Q.deck_idx) &&
          Q.card[Qcat] != test_card[Qcat] &&
	  Q.card[Acat] != test_card[Acat]) {
	 allowed_choices[j] = test_card;
	 j++;
      }
   }
   Q.choice = new Array();
   Q.choice[0] = Q.card;
   for (i=1 ; i<Numchoices ; i++) {
      var good_choice = false;
      while (!good_choice) {
	 Q.choice[i] = allowed_choices[Math.floor(Math.random() *
						  allowed_choices.length)];
	 good_choice = true;
	 for (j = 1; j<i ; j++) {
	    if (Q.choice[i][Acat] == Q.choice[j][Acat]) {
	       good_choice = false;
	       break;
	    }
	 }
      }
      // remove the choice we just used from allowed_choices
      k=0;
      while (allowed_choices[k] != Q.choice[i] &&
             k < allowed_choices.length) k++;
      // Argh!  This should be a one-liner:
      //
      // if (k < allowed_choices.length) allowed_choices.splice(k,1);
      //
      // But NoooOOoo! Mac IE doesn't implement the splice method of
      // Array and *just*goes*into*outer*space* when you try to use it.
      //
      // We implement our own.  Thanks, Microsoft!

      while (k < allowed_choices.length - 2) {
         allowed_choices[k] = allowed_choices[k+1];
         k++;
      }
      allowed_choices.length = k+1;
   }
   shuffle(Q.choice);
   add_to_recent_answers(Q.card, Q.deck_idx);
}
///////////////////////////////////////////////////////////////////
function shuffle(arr)
{
   for (var i=arr.length-1 ; i>0 ; i--) {
      var j = Math.floor(Math.random() * (i + 0.999));
      var tmp = arr[i];
      arr[i] = arr[j];
      arr[j] = tmp;
   }
}
///////////////////////////////////////////////////////////////////
function time_stat_string()
{
//Deck[Q.deck_idx].length
   var count = Qnum + 1;
   var usecs = (new Date().getTime()) - Starttime;
   var leftcount = count - Deck.length
// err404
//   return count + ' questions answered in ' +
   return ""
// + ' questions left in ' +
//      Math.round(usecs/100)/10 + ' seconds (' +
//      Math.round(usecs/(100*Rightcount))/10 +
//      ' secs/right answer)';
}
///////////////////////////////////////////////////////////////////
function display_question()
{
   var Q = Question[Qnum];
   Display.question.nodeValue = Q.card[Qcat];
   for (var i=0 ; i<Numchoices ; i++) {
      Display.choice[i].nodeValue = Q.choice[i][Acat];
   }
}
///////////////////////////////////////////////////////////////////
function process_answer(e)
{
// err404
//   if (!e) e = window.event; // IE event model
//   var ansnum;
   if (e.target) {
      ansnum = e.target.name; // W3C event model
//   } else {
//      ansnum = e.srcElement.name; // IE event model
   }
   // We know choice[ansnum] was chosen, because that's how we set the
   // name attribute of the choice buttons.
   var Q = Question[Qnum];
   var right_or_wrong = document.getElementById("right_or_wrong");
   var correct_answer = document.getElementById("correct_answer");
   var right_count = document.getElementById("right_count");
   var wrong_count = document.getElementById("wrong_count");
   var time_stats = document.getElementById("time_stats");
   if (Display.choice[ansnum].nodeValue == Q.card[Acat]) {
      Rightcount++;
      right_or_wrong.style.color = "green";
      right_or_wrong.firstChild.nodeValue = "Right";
      right_count.firstChild.nodeValue = Rightcount;
   } else {
      Wrongcount++;
      right_or_wrong.style.color = "red";
      right_or_wrong.firstChild.nodeValue = "Wrong";
      wrong_count.style.color = "red";
      wrong_count.firstChild.nodeValue = Wrongcount;
      Wronglist[Wronglist.length] = Q.card;
   }
   correct_answer.firstChild.nodeValue =
      "The correct " + Category[Acat]  + " for " +
      Q.card[Qcat] + " is " + Q.card[Acat];
   time_stats.firstChild.nodeValue = time_stat_string();
   document.getElementById("score").style.visibility = "visible";
   if (Qnum < Question.length - 1) {
      Qnum++;
      display_question();
   } else {
      display_end_quiz();
   }
}
///////////////////////////////////////////////////////////////////
function display_end_quiz()
{
   document.getElementById("question").style.display = "none";
   var endtable = document.getElementById("end_quiz");
   var tbody, tr, td, textnode, button;
   var cellwidth =  (100.0/Category.length) + "%";
   tbody = document.createElement("tbody");
   tr = document.createElement("tr");
   td = document.createElement("td");
   td.colSpan = Category.length;
   if (Wronglist.length) {
      textnode =
	 document.createTextNode("You missed:");
   } else {
      textnode =
	 document.createTextNode("Congratulations on your perfect score!");
   }
   td.appendChild(textnode);
   tr.appendChild(td);
   tbody.appendChild(tr);
   for (var i=0 ; i<Wronglist.length ; i++) {
      tr = document.createElement("tr");
      if (i % 2 == 0) tr.style.backgroundColor = "#cccc99"
      for (var j=0 ; j<Category.length ; j++) {
	 td = document.createElement("td");
	 td.style.width = cellwidth;
	 textnode = document.createTextNode(Wronglist[i][j]);
	 td.appendChild(textnode);
	 tr.appendChild(td);
      }
      tbody.appendChild(tr);
   }
   tr = document.createElement("tr");
   td = document.createElement("td");
   td.colSpan = Category.length;
   button = document.createElement("button");
   button.onclick = function () { window.location = "Err404-quizz"; };
   textnode = document.createTextNode("Try Again!");
   button.appendChild(textnode);
   td.appendChild(button);
   tr.appendChild(td);
   tbody.appendChild(tr);
   endtable.appendChild(tbody);
   endtable.style.visibility = "visible";
}
///////////////////////////////////////////////////////////////////
</script>
</head>
<body onload="setup()">
<div id="setup">
<form name="f">
<table><tr>
<td>Show me <select id="Qsel" name="Qsel"></select></td>
<td>and let me guess the correct <select id="Asel" name="Asel"></select></td>
<td><input type="button" value="begin" onclick="begin_quiz()"></td>
</tr></table>
</form>
</div>
<div id="score">
<!-- The bogus text is needed to get the spacing right at the start
of the quiz, when this div is hidden. -->
<h1 id="right_or_wrong">Right </h1>
<p id="correct_answer">The correct answer is blah blah blah </p>
<table align="center">
<tr><th align="right">Right:</th>
<td align="left" id="right_count">0</td>
<th align="right" width="200">Wrong:</th>
<td align="left" id="wrong_count">0</td></tr>
</table>
<p id="time_stats">Successfully answered nothing in no time flat</p>
<hr>
</div>
<table id="question">
</table>
<table id="end_quiz">
</table>
</body>
</html>

}}}

J'ai utilisé le quizz présent ici: http://abstractfactory.org/forrest/hanziquiz/index.html que j'ai adapté pour qu'il tienne en un seul fichier,

J'ai rajouté le français et j'ai changé le choix des langues par defaut.

Si vous ne pouvez pas choisir les systèmes d'écriture, alors veuillez utiliser la version présente sur abstractfactory.org ou alors utilisez un vrai navigateur web (Firefox, Iceweasel, seamonkey, ...)
