Test 1/Spring '07 On-Line Instructions

This portion of your test involves getting a couple of scripts working. It involves two parts: a script modification problem and either a debug or a programming problem. You are allowed to open Notepad, Dreamweaver, Visual Studio, and/or one or more browsers during the exam. The only sites/pages you may access through the browser windows are:

Please do not open any other applications, web sites, or other files containing javascript code. Opening other applications will result in a grade of "F" for this portion of the exam. Remember to write code that is xhtml compliant. Good luck!

Part 1: Modification of Existing Script (25 points)

Below, I have given you a link to a file containing a script. At this point, it contains a single textarea named link_description_text within a form named link_description. Above this textarea is an unordered list with a single link to the DevGuru site. When you open this page in a browser, notice that placing the mouse cursor over the DevGuru link changes the description in the textarea to, "Devguru.com is a reference for web programming in languages such as ASP, CSS2, JavaScript, PHP, VBScript, XHTML, XML."

To obtain full credit for this portion of the test, you must do the following modifications to this script:

Link Text
Link URL
Link Description
Tarnoff's CSCI Home http://faculty.etsu.edu/tarnoff/ A site that all of the downtrodden students in Tarnoff's classes need to visit
CSCI Web Site http://www-cs.etsu.edu/ ETSU's CSCI Department's web site. It's still growing and changing, so visit often
ETSU Web Site http://www.etsu.edu/ ETSU's Homepage provides information regarding attending ETSU or working there

The file you are to modify can be downloaded from: http://faculty.etsu.edu/tarnoff/labs2910/t1_s07/modify.htm. When you have completed this portion of the program, send it to me using your digital dropbox in Blackboard. Use the file name <your_last_name>_modify.htm. For example, John Smith would submit the file "smith_modify.htm".

Be careful in your editing. There is already one debugging exercise here, and this one isn't supposed to be it.

Part 2: Either Debug Existing Code or Write New Code (25 points)

For this last portion of the test, I'm allowing you to pick one of two options, either a debugging exercise or a coding exercise.

Option 1: Debugging Exercise

I have created an XHTML file containing a form and a form validation script to be executed when the button labeled "Finished" is clicked. (You should recognize this form.) There are six errors in the page, each of which can be corrected by simply changing one or two characters in the code. All errors are with syntax, there are no problems with the program's logic. The structure of the program and the numeric algorithms are correct. All six errors are in the script's function validateForm(). The script is commented, so you should not have any problem figuring out what does what.

The file you are to debug can be downloaded from: http://faculty.etsu.edu/tarnoff/labs2910/t1_s07/debug.htm. When you have completed this portion of the program, send it to me using your digital dropbox in Blackboard. Use the file name <your_last_name>_debug.htm. For example, John Smith would submit the file "smith_debug.htm". If you prefer, you may hand in a hard copy of the debug exercise. I will have paper copies with me during the test.

Option 2: Coding Exercise

For this option, you will be using a for-loop to generate a table with 6 columns. For each of the values from 0 to 255, you will generate a row of the table.

Click here to see a sample of the table I'm looking for.

For the first four columns, you will be using the toString(radix) function where radix represents the base. For example, if I want to output the value contained in mynum as a binary value, I use the code:

mynum.toString(2)

As for the character entity (the fifth column), you can simply insert the number into the numeric form of the character entity tag. For example, to output the character entity of the value 25, the HTML code would look like:

&#25;

For the last column, you will be making a <td> entry that looks like this:

<td bgcolor="#rrggbb">&nbsp;</td>

where rr, gg, and bb all equal the hexadecimal value of the value. For example, when the value of the loop counter equals 23 hex, the <td> tag should look like:

<td bgcolor="#232323">&nbsp;</td>

This column may seem rather complex, but it isn't. Just insert the value of the counter three times after the quotation mark. There is one trick. You will need to add a leading zero to any hex value that is a single digit.

You should not need a template for this file, just being with a standard XHTML template and insert your script between the body tags. When you have completed this portion of the program, send it to me using your digital dropbox in Blackboard. Use the file name <your_last_name>_coding.htm. For example, John Smith would submit the file "smith_coding.htm".