The Hanzi Quiz Program


This page is for the old, non-DHTML version of Hanzi Quiz. The new version is here.

I have written a JavaScript program to help me learn hanzi (Chinese Characters) that I'd like to share with you all, so I'm making it available under the GPL.

I have a list of hanzi, pinyin (pronunciation), and English meanings, comprising sort of a "deck of flashcards" (in the file hanzicards.js). The program randomly generates multiple-choice questions, by showing one hanzi and letting you guess the correct pinyin out of 5 randomly selected from the deck (well ... not quite randomly ... one is the correct answer!) Or you can see the English and guess the hanzi. Any combination of categories is possible.

This is version 0.2a of Hanzi Quiz. I almost called it 1.0, but the first day it was on the net, I got a bug report that the correct answer is never on the top of the list. Ooops. That's fixed, so I changed the version number from 0.2 to 0.2a. Keep those bug reports coming!

I've only tested it under my browser (Netscape 4.75 Linux) so far, so there may be fixes related to other browsers required. (I'm a die-hard Linux person, but I really hope this works for everyone. That's the true Linux spirit, don't let anyone tell you otherwise!)

New for version 0.2:

When I wrote this, my intent was to run it locally on my own computer. When I put it online, I found it was a lot slower. That's because every time it shows a new question, it reloads an html page -- which is not a problem when it's on your local hard disk, but may take some time to fetch over the net. The reason I did it that way instead of having the questions dynamically generated by JavaScript was so I could put a <meta ... > tag in the question frame which identifies the charset correctly. Even so, I find that when I run it from the server, I need to explicitly set my character set to Simplified Chinese (GB2312).

With that in mind, you may still want to run from here, just to take a look at it. I've put it inside an extra frame, so that it's easy to leave when you get bored. Check it out!

Here's the source code. It's in tar.gz format, which is the standard for us Linux folks. Windows users can extract the files with WinZip.