Copyright: Helpfile Generated by VB HelpWriter!


Introduction

Martin's Javascript Quiz Generator is a simple Windows 95 program which enables you to create interactive quizzes for the World Wide Web without any knowledge of Javascript or HTML  coding. All you need to do is enter the questions and answers for your quizzes, and the program will automatically generate the Web pages for you. The quizzes can be viewed in any Web browser  program which supports Javascript. You can make your quizzes available through the World Wide Web, through an intranet, or by loading them on standalone computers.

You can access this help file at any time from within the program by pressing the F1 key. JQuiz Generator help is fully context-sensitive, so you should see a help page which is relevant to the operation you are currently dealing with.

©Martin Holmes 1997 - Helpfile generated by VB HelpWriter.


What is Javascript?

(Note: You don't need to understand this in order to use the JQuiz Generator.)

Javascript is a simple computer language that can be used to write mini-programs inside HTML  (World Wide Web) pages. Using Javascript, Web pages can be made interactive, as if they were basic computer applications. The pages this program creates use Javascript to check students' answers and give feedback on whether they are right or wrong, or show a correct answer if the student wants help. All of the interactivity takes place within the browser  program, so nothing special has to be done on the server side.

Javascript was created by Netscape, and these quizzes work best in Netscape Navigator. However, Microsoft Internet Explorer has a similar language called JScript. With certain limitations, quizzes can be created which work well in both browsers. See Netscape and Internet Explorer for more information about the differences between Javascript and JScript.

Of course, you don't have to understand Javascript (or even HTML, the language of Web pages) in order to use this program. The JQuiz Generator creates the pages automatically for you. All you have to do is to upload them to a server or place them on a local machine where your students can access them.

©Martin Holmes 1997 - Helpfile generated by VB HelpWriter.


How does a quiz work?

The best way to find out how a quiz works is to do one. Start up Netscape Navigator or Internet Explorer and load the sample.htm page from the JQuiz program folder. (Make sure you don't load sample1.htm.) Then try doing the quiz. When you have experimented, come back and finish reading this page.

The quiz is divided into two frames, as in this diagram:

The bottom frame, which is larger, contains the quiz questions and answer boxes. Feedback to the student appears in the top frame.

The document you loaded, sample.htm, is called the frameset document. It tells Netscape Navigator (or Internet Explorer) how to set up the frames, and then tells it which pages to load into each frame. When you first load this quiz, it tells the browser  to load a file called welcome.htm into the top frame, and sample1.htm into the bottom frame. After that, when the user interacts with the page, Javascript routines "write to" the top frame, replacing "Welcome" with whatever message the user needs to see.

If the user is having difficulty understanding what to do, he or she can press the Help button near the top of the page. This loads a fourth file, help.htm, into the top frame. You can edit both welcome.htm and help.htm in a text editor if you wish, so that you can give your users information which is appropriate for them.

In order for the quiz to work properly, then, four files must be in the same directory or folder: the frameset document and the quiz document (both created by the program whenever you make a new quiz) and the welcome.htm and help.htm documents.

An acknowledgement

The format of these quizzes is based on an example created by Robert Godwyn-Jones. You can see his original example, along with a great deal of detailed information on Javascript, at this Web site:

http://www.fln.vcu.edu/cgi/js.html

I borrowed the basic ideas that Robert explains on his site, and made some modifications to allow multiple correct answers and let the student see a correct answer if necessary. However, I happily acknowledge that he was the first begetter (to my knowledge, anyway) of this type of quiz, and I'm very grateful to him for publicizing his example.

©Martin Holmes 1997 - Helpfile generated by VB HelpWriter.


How to create a quiz

Creating a quiz is easy. First, enter a title in the Title box at the top of the JQuiz Generator window. The title will make the heading of your quiz like this:

Self-Test Quiz: Your Title

Next, enter a question in the Question box. You question can be up to 256 characters long, and may include returns if you wish.

You can enter up to three correct answers for each question. These are not multiple-choice answers --  each answer will be accepted as correct. The reason that there are three answer slots is so that you can allow for variations in your students' answers. You might, for example, want to allow right, Right and RIGHT. Each answer can be up to 256 characters in length. Note that the answer in the Answer 1 box will be the answer that is shown if the student clicks on "Show me a correct answer", so if you have a preferred answer, it should go in this box. When entering answers, it's usually a good idea to avoid single quotes, double quotes or apostrophes, so that the quiz will work in Microsoft Internet Explorer. See Netscape and Internet Explorer for more information on this.

When you have finished entering the question and answers, click on the spin button to go to the next question. There is no limit to the number of questions a quiz may have.

When you have entered all your questions, it makes sense to save your quiz, using the Save button or Save As on the File Menu. Then you are ready to make your quiz. Simply click on the Make Web page button. If you have used quotation marks or apostrophes in any of your answers, the program will let you know so you can change them. Otherwise, the JQuiz Generator will tell you the names of the files it has created. You can load the frameset document into your browser  to test your quiz.

©Martin Holmes 1997 - Helpfile generated by VB HelpWriter.


Buttons and menus

The five Command Buttons at the bottom of the JQuiz window give access to the most common and important operations in the program.

The File Menu contains the most common file operations.

The Edit Menu contains standard editing operations which act on the text of the currently active text box.

The Options Menu enables you to toggle the Internet Explorer Safe option on and off. See Netscape and Internet Explorer for more information on this.

The Help Menu gives access to this help file and to an "About" box giving details of the program.

©Martin Holmes 1997 - Helpfile generated by VB HelpWriter.


Netscape and Internet Explorer

Almost all people currently browsing the World Wide Web do so with one of two browser  progams: Netscape Navigator or Microsoft Internet Explorer. Javascript was invented by Netscape. Microsoft has implemented a version of it called JScript, but unfortunately JScript (in Internet Explorer 3) does not implement all the features of Javascript. If you expect your quizzes to be used by people running Microsoft Internet Explorer, therefore, you should leave the "Internet Explorer Safe" option in the Options menu enabled.

If, on the other hand, you are fairly certain that your users will only use Netscape Navigator to view your quizzes (for example, if you are serving them only on an intranet within your institution or company, and you know only Netscape is available to your users) then you can switch this option off. There are two main differences, one important and one merely cosmetic:

1.	Internet Explorer 3 is not able to handle the answer-checking functions in quizzes if apostrophes or single or double quotation marks are included in any of the answers. This means that you need to avoid using these characters in your answers. However, if you forget, the program will warn you when you try to compile the quiz.

2.	Internet Explorer 3 is apparently not able to handle recursive function calls. If you compile a quiz with the Internet Explorer Safe option off, then try the quiz in Netscape Navigator, you will find that when you answer the final question correctly, the feedback says "Well done! Thanks for taking the quiz." This is done by calling another function from within the answer-checking function on the final question. However, this will not work in Internet Explorer, so if you have the IESafe option on, this call will be disabled, and the final question will act just like any other question, giving a "Correct! Well done" response. This is a trivial variation.

If you don't want to worry about any of this, you can simply leave the IESafe option on at all times, and avoid using quotes or apostrophes in your answers (which is easy enough to do). Meanwhile, future versions of Internet Explorer may be better at handling Javascript, so the problem may eventually disappear.

©Martin Holmes 1997 - Helpfile generated by VB HelpWriter.


Contacting the author

The JQuiz Generator was written by Martin Holmes using Delphi 2.0. If you have any questions, comments or bug reports, please send e-mail to the author at

76717.2477@compuserve.com

or visit my homepage at this address:

http://ikra.call.uvic.ca/LangCen/Special/martin.htm

©Martin Holmes 1997 - Helpfile generated by VB HelpWriter.


Contents

Introduction

What is Javascript?

How does a quiz work?

How to create a quiz

Buttons and menus

Saving a quiz

Netscape and Internet Explorer

Using non-English characters

About JQuiz

Contacting the author

©Martin Holmes 1997 - Helpfile generated by VB HelpWriter.


About JQuiz

Martin's Javascript Quiz Generator was written in Delphi 2.0 by Martin Holmes. This is version 1.0.

The JQuiz Generator can also be customized to produce quizzes for your institution or company, including special graphics, backgrounds or other modifications. Contact the author for more information.

©Martin Holmes 1997 - Helpfile generated by VB HelpWriter.


Command Buttons

The five command buttons give access to the most common operations of the program. They function as follows:

The Load quiz button (which is the same as the Open command on the File menu) allows you to load a quiz which you have previously saved to disk. Quizzes are saved in a special file format, with the extension *.jqz. When you have created a quiz, you should save it as a jqz  file. Later, if you discover that you want to change something in the quiz, you can reload it and make the change, then generate new Web pages from the changed version. Note that you cannot reload Web pages directly into the program.

The Save quiz button lets you save a quiz in *.jqz format, so that you can reload it later and make changes if necessary. The first time you press this button (before the quiz has a file name) you will see a Save As dialog box allowing you to choose a file name (the same as the Save As command on the File Menu). Subsequently, the button will simply save the quiz to disk with the filename you have given it (the same as the Save command on the File Menu).

The Make Web page button (the same as Make Web page on the File Menu) allows you to compile your quiz into Web pages. First it will ask you for a file name using a standard Save dialog box. Then, if the compile operation is successful, it will save two files, filename.htm and filename1.htm. See

How does a quiz work? for more information on this.

The New button clears current work from the program, allowing you to start work on a new quiz. This is the same as New on the File Menu.

The Quit button exits the program. This is the same as Exit on the File Menu.

©Martin Holmes 1997 - Helpfile generated by VB HelpWriter.


The File Menu

This menu has the following commands:

New... clears the program and allows you to begin creating a new quiz.

Open allows you to open a previously-saved file. Quizzes are saved in a special file format, with the extension *.jqz. When you have created a quiz, you should save it as a jqz  file. Later, if you discover that you want to change something in the quiz, you can reload it and make the change, then generate new Web pages from the changed version. Note that you cannot reload Web pages directly into the program.

Save lets you save a quiz in *.jqz format, so that you can reload it later and make changes if necessary. The first time you select this command (before the quiz has a file name) you will see a Save As dialog box allowing you to choose a file name (the same as the Save As command). Subsequently, this command will simply save the quiz to disk with the filename you have given it.

Save As... allows you to choose a filename for your quiz before saving it to disk.

Make Web page allows you to compile your quiz into Web pages. First it will ask you for a file name using a standard Save dialog box. Then, if the compile operation is successful, it will save two files, filename.htm and filename1.htm. See How does a quiz work? for more information on this.

Exit closes the program.

©Martin Holmes 1997 - Helpfile generated by VB HelpWriter.


The Edit Menu

This menu has a set of standard cut, copy, paste and select commands for editing text. These commands will apply to the text box in which the cursor is currently located.

Note that you can also right-click on any text box to bring up a pop-up menu with the same commands.

©Martin Holmes 1997 - Helpfile generated by VB HelpWriter.


The Options Menu

The Options menu has only one item: Internet Explorer Safe. This item is enabled by default (it has a check mark next to it). You can click on it to remove the check mark and disable the option. While it is enabled, the program will prevent you from compiling quizzes which contain quotation marks or apostrophes in the answers, because current versions of Microsoft Internet Explorer cannot handle these. See Netscape and Internet Explorer for more information on this.

The current state of the Internet Explorer Safe option is also shown in the Status Bar at the bottom of the JQuiz window, as IESafe: On or IESafe: Off:

©Martin Holmes 1997 - Helpfile generated by VB HelpWriter.


The Help Menu

This menu gives you access to this help file, and also to an About box giving details of the JQuiz program.

©Martin Holmes 1997 - Helpfile generated by VB HelpWriter.


Saving a quiz

There are two kinds of files that the JQuiz Generator produces:

JQZ files are the native format of the program. You should save all your quizzes in this format so that you can reload them later and make changes if necessary.

HTM files are the Web pages that your students will see when they do the quiz in their browsers. Note that these cannot be reloaded into the program and changed later. If you need to make changes to a quiz, reload the JQZ file, make your changes, and then re-generate the HTM files.

©Martin Holmes 1997 - Helpfile generated by VB HelpWriter.


Using non-English characters

The JQuiz Generator was written for English language quizzes. If you wish to use it with other languages, there are some limitations to bear in mind.

Non-English characters such as those with accents and umlauts are available within the ASCII character set. However, the Macintosh OS and Windows map many of these characters differently. In other words, non-English characters you enter into a quiz on a Windows computer will look the same when viewed in a Web browser  on another Windows machine, but the characters may display differently on a Macintosh. There is a solution to this: each special character has an HTML  escape code sequence which can be used in a Web page to ensure that the character is displayed correctly on all platforms. For example, the character Ä can be encoded as &Auml; in HTML. If you need to use special characters, you will have to edit the HTML files of your quiz manually to replace all the characters with their escape-code sequences in order to ensure that they display correctly on non-Windows machines.

Future versions of JQuiz may include the ability to deal with these characters automatically.

©Martin Holmes 1997 - Helpfile generated by VB HelpWriter.


Glossary

B

browser

H

HTML

J

jqz


jqz

The native file format of the JQuiz Generator program. Quizzes can be saved to disk and reloaded in this format.


HTML

Hypertext Markup Language, the language used to write World Wide Web pages.


browser

Program such as Netscape Navigator or Microsoft Internet Explorer, used to view World Wide Web pages.