Crossword Puzzle Code - Optimized
October 6, 2001
NOTE:
What follows worked for Hot Potatoes 4 when I did it.
It may or may not work for Hot Potatoes 5.
I have not checked it.
A Quick-Start Guide to
An Optimized Version of the Hot Potatoes Multiple-choice Quiz Code
Charles Kelly's rewrite of Hot Potatoes 5.0 (Preview Version) Code
Rewrite Version 0.08, December 30, 2000.
This Page Only | This Page Framed with Quiz
Introduction
From this page, you can download an alternative "source" file that will allow you to create quizzes using the Hot Potatoes's JBC (Version 4) application. This alternative "source" file, will allow you to create quizzes that have a smaller file size as well as a few other improvements. See a Sample 10 Question Quiz - 2 Versions
After trying these quizzes, click your browser's Back button 3 times to retun to this page. - Optimized Code (About Half the Size)
- The "Original" Hot Potatoes Code
How to Use It
- Download:
- Download Hot Potatoes verson 4, if you don't have it. (Conditional Freeware)
- Download hp5ck08.zip (14 Kb)
- This file includes this web page, the 2 samples quizzes and the optimized djbc.ht_ file.
- Unzip hp5ck08.zip. (Get unzipping sofware if you need it.)
- Read the "Read Me" file that is inside the zip file.
More Details and Options
Who Might Want to Use This Code?
- If your site gets a lot of traffic, this will help reduce the load on your server.
- If you want to be kind to those with slow and/or expensive Internet connections, this will help those visitors get your quizzes more quickly.
- If your students take quizzes home on a floppy disk, this will allow them to put more quizzes on a disk.
- If you would like your site to be as fast as possible, then this smaller filesize will speed up your site.
- If you like to write long quizzes, this smaller code means that you can include more questions while still keeping the total file size reasonable.
Notes on My "Tweakng" of the Code
I was able to optimize the code by doing the following things. - I eliminated all unnecessary "white space" in the HTML. This optimization has no affect on how the quizzes look.
- I renamed all variable names to shorter names. This also has no affect on how the quizzes work.
- I removed a lot of the HTML code that was used for cosmetic purposes. I felt that this was a worthwhile sacrifice since it allowed reducing the file size.
- I rewrote some of the JavaScript code. This helped to reduce the file size and perhaps also made the code more efficient.
- I eliminated some options, and coded them in as defaults. This allowed reducing the file size.
Notes on My "Tweakng" of the Code
If you already have a set of multiple-choice quizzes generated by the JBC of Hot Potatoes and you have kept the the original Hot Potatoes data files, then all you need to do is regenerate the HTML with this djbc.ht_ file in Hot Potatoes source folder and you will have the same quizzes with this optimized code. Thanks to the Hot Potatoes Crew
Thanks to Half-Baked Software for offering their quizzes as open source code and allowing "tweaking" of their code.
http://www.aitech.ac.jp/~ckelly/hp/
Comments appreciated: ckelly @ ge.aitech.ac.jp