Homework 1

For homework 1, you’ll be working from existing code and building upon it. This is an opportunity to get used to the elements of HTML5 and start working with simple JavaScript elements to create dynamic web experiences. We’ll be working with the Phrase-O-Matic on page 70 of your text (HF). The base project takes arrays of words and combines them to make a random phrase display on the page each time the page loads.

This project requires:
  • Creating at least 3 arrays and filling them with strings of text
  • Using the Math.random() function to choose words
  • Printing out chosen words to a specified paragraph in the document
  • Using the “onload” command to display a phrase
For full credit, you need to attempt additional modifications. Here is the rubric for each grade:
  • A-Level Work: Convert the phrase generator to a poetry generator, imposing a structure and style on the generated content. Modify the stylesheet so that elements display appropriately and add context to the work. A-Level work must be cleanly formatted, include commenting for scripting, and use HTML5 elements appropriately.
  • B-Level Work: Extend the body section to include multiple paragraphs, each with a different phrase. B-level work should be cleanly formatted, include commenting for scripting, and use HTML5 elements appropriately.
  • C-Level Work: Get the phrase-o-matic working with your own content and at least one change in style, length of phrase, or another variable. C-level work should show an attempt at clean formatting, commenting and use of HTML5 but may not succeed in all elements.
  • D-Level Work: Phrase-o-matic is attempted but fails to compile due to errors in coding. The base of the scripting is present but not functional.
  • Failing Work: Project is not submitted or demonstrates no attempt to complete the task.
Challenge task: Change the code so that the user has some level of control. This might include pressing a button to generate a new phrase or poem, submitting words for inclusion in the phrase, or choosing the style of poem. (Challenge tasks are optional, and require working ahead in the book to succeed.)

Comments are closed.