1. (50 points) The Top 100 Learning Tools of 2013 (http://c4lpt.co.uk/top100tools/) are shown to the left in a textarea named ta contained in a form named f1. The data represents a poll of 500 learning professionals. Each of the entries contain:
1. rank_this_yr followed by a comma 2. website followed by a comma 3. tool_description followed by a comma 4. rank_change_from_last_yr followed by a "*" (except the last one) values of rank_change_from_last_yr can be: "same" -- rank_this_yr is same as last year "new" -- never been on the list before "back" -- on the list before -- but not last year "up": follow by an integer (on the list last year and rose integer ranks) "down": follow by an integer (on the list last year and dropped integer ranks) When the user clicks this "p1" button , a vbscript sub named "p1" is executed. This sub: 1. retrieves the value of ta 2. creates a 100 row by 4 column table. Each row has: column 1 contains the rank_this_yr column 2 contains the website column 3 contains the tool_description column 4 if rank_change_from_last_yr contains the "up" or "down" values, calculate and display the "rank_last_yr". e.g., if rank_change_from_last_yr="up by 2" and rank_this_yr=7, then rank_last_yr= 7 + 2 = 9 e.g., if rank_change_from_last_yr="down by 2" and rank_this_yr=7, then rank_last_yr= 7 - 2 = 5 if the rank_change_from_last_yr is "same", copy the value for column 4 from column 1 if the rank_change_from_last_yr is "back" or "new", display the value in the 4th cell of the row
This is the DIV with id="p1out"
Show NO HTML.
| |
2. (50 points) Write the javascript function p2 that creates an HTML table for the month and year specified by the two text boxes in a form named f2 shown to the left. The user enters: (1) the year in the text box named yr and (2) the month in a text box named mon. The calendar will have 8 rows:
row 1. the month name and then the year centered in the row (see month names array below) row 2. seven cells containing the day names (see the day names array below) row 3-8. the numbered days of the month
To find the values you need for specified month and year use this:
1. Beginning in the third row, count the table cells as you progress -- call this variable cellnum
Caution: in some months/years, the eighth row will not be needed. Assume two arrays are defined for you as follows:
var mname=new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); var dname = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); Show NO HTML. Show only the javascript for p2. |