ICT-4570 Homework 7
Purpose
What to Hand In
Canvas submission instructions:
Please combine multiple files into a single "zip" archive, and save it in a location
that you will remember.
When you are ready to submit the assignment solution, open the assignment in Canvas,
and click on the Submit for Evaluation button at the top,
attach the file, and click Submit for Evaluation at the bottom.
Problems
-
Revisit Assignment 4 (gradebook form) and integrate LocalStorage to persist results.
Upon computing the average(s), store the current values.
Upon initializing the form, retrieve the stored values, populate the form, and ensure the averages are computed.
Notes
-
You will want to use localStorage rather than sessionStorage -
localStorage is not supported by IE7 or earlier. -
You do need to check whether localStorage is supported.
A test like the following will suffice (from w3schools.com):if ( typeof( Storage ) !== "undefined") { // Yes! localStorage and sessionStorage support! // Some code..... } else { // Sorry! No web storage support.. }
-
You should also access localStorage when loading the page, and populate the fields if not undefined -
The choice of data storage schema is entirely yours. For instance, is homework an array, or represented by separate items.
Evaluation
Criteria | Weight |
---|---|
HTML form and styling | 10% |
Score and average computation | 10% |
Retrieving previous scores upon page load | 30% |
Storing current values upon evaluation | 30% |
Screenshot(s) showing initial load | 10% |
Screenshot(s) showing reload | 10% |