Creating an Online Quiz (page 5)

Advanced HTML Editing

"hiding the answers"

While taking the online quiz generated by the quiz creator a student could view the page source and see the answers.
A way to make it harder to see the answers follows:

Here is an example of the answers in the html of a quiz:

<script language="JavaScript">

<!--

var numQues = 20;

var numChoi = 3;

var answers = new Array(20);

answers[0] = "Motherboard";
answers[1] = "Hard Disk Drive";
answers[2] = "CPU";
answers[3] = "RAM";
answers[4] = "Floppy Disk Drive";
answers[5] = "Communications Port";
answers[6] = "Parallel Port";
answers[7] = "Power Supply";
answers[8] = "Network Card";
answers[9] = "Video Card";
answers[10] = "17 Gigabytes";
answers[11] = "56 Kilobytes per second";
answers[12] = "96 Megabytes";
answers[13] = "Ink Jet";
answers[14] = "Intel Celeron";
answers[15] = "Programs";
answers[16] = "Megahertz";
answers[17] = "Size";
answers[18] = "Ink jet";
answers[19] = "Multitasking";

 

function getScore(form) {

Highlight from:

var answers = new Array(20);.......to the last answer .....answers[19] = "Multitasking";

cut that text from the html document and paste it into a word processor and save it as a text file with a file extension ".js" (example "answer.js"). You need to save the file in the same folder as your original quiz.htm document

Add the following code into the top of your quiz.htm document:

Original created by the quiz creator:

<html>
<head>
<title>
</title>
<script language="JavaScript">
<!--

After editing: Add line 5 below that will include your answers but the students will not be able to easily see them.

<html>
<head>
<title>
</title>
<script language="JavaScript" SRC="answers.js"></script>
<script language="JavaScript">
<!--

After you publish your web page, you can then sit back and work on other things while the computer grades your quizzes and emails you the results!

 

Back to the Start
Getting Started
Setting UpYour Quiz
Entering your Quiz
Saving the HTML
E-Mailing the Results
Hiding the Answers