UMass Lowell Dept. of Computer Science

91.461 GUI Programming I

Fall 2015 Semester, Section 201

Prof. Jesse M. Heines

Assignment No. 5

Formatting Dynamic Text

Date Due:  Tuesday, October 6, 2015


Contents     Top


What This Assignment Is About     Top

This assignment involves formatting text, which is mainly covered in Chapter 6 of CSS3: The Missing Manual by David Sawyer MacFarland (both the 2nd & 3rd editions).  However, the assignment includes a twist: the text you are to format will be read from a data structure, not hard-coded within your HTML pages. 

The data structure we will use is JSON, which is introduced on pages 370-373 of JavaScript & jQuery: The Missing Manual, which is also by David Sawyer MacFarland.  That introduction involves Ajax, which is beyond the scope of this assignment, as do most of the references and tutorials that you can easily find on the web with a Google search.  We’re going to use JSON in this assignment much more simply than that, although, as always, students who are familiar with JSON are welcome to use more advanced techniques if they like.  Wikipedia has a good, simple introduction to basic JSON syntax at http://en.wikipedia.org/wiki/Json.  You need only be concerned with the sections 1 and 2 of this article, which I have captured as a PDFPatrick Hunlock has also written a nice, clear introduction to JSON in his blog post of April 10, 2007.  Again, you need only be concerned with the first part of this post, which I have also captured as a PDF.

The use of JSON also requires a bit of JavaScript, which we haven’t covered yet, either.  But again, we will only use a few very basic techniques to illustrate the fact that CSS can be applied to dynamic as well as static text.  This is the critical lesson to take away from this assignment.  As often requested, you can see my rudimentary solution to this assignment herePlease note that my solution is not meant to be complete.  There is always much more that you can do.

As usual, we will spend class time to go over everything you need to know to use JSON and JavaScript in this assignment.


What You Are To Do     Top

  1. By now you should have read Chapters 1, 2, 3, and 6 of our CSS textbook.
     
  2. Read the excerpts of the two JSON articles mentioned above by clicking the following links:
  3. Pick a text passage that you would like to work with.  This may be any text you like, but it must be “rich” enough to allow you to do a variety of text formatting.
     
  4. Construct a JSON file containing your text that you will read into your page and format.  To help you format your JSON file correctly, you might want to use the JSON Editor Online at http://www.jsoneditoronline.org/.  [Thank you to student David Lordan in the 2014 class for bringing “this gem” to our attention.]
     
  5. Write your basic HTML page, including the JavaScript needed to load the JSON file.  My JavaScript is as follows:
  6. Test your page at this point with your browser’s debugging tools turned on.  Make sure that it loads without error.
     
  7. Now add JavaScript to display the text with basic HTML tags that have either IDs or class names so that you can style them.  My JavaScript is below.  Again, test your page at this point to ensure that it is working before adding CSS to style the content.
  8. Finally, create a CSS file to style the HTML elements output by your JavaScript.  Reference the various IDs and classes in your CSS file to style various page elements differently.  Experiment.  Be creative.  Try to do something interesting.  Make errors and figure out how to correct them.  This is how you learn.

Code Criteria


Submitting Your Assignment for Grading     Top

As always, submit your assignment using the Assignment Submission Form.  This form will lead you through providing all the information we need to evaluate your work, confirming that it is correct, and then e-mailing that information to me with a copy to yourself.  Be sure to select 91.461 Assignment No. 5: Formatting Dynamic Text from the assignment drop-down list on that form.

Important Note:  Don’t forget to click the “Submit Assignment” button on the Assignment Confirmation Form page!  You should then receive an e-mail from the system within a few minutes confirming that your assignment has been submitted.  If you do not receive an e-mail after clicking the “Submit Assignment” button, neither will we.  In that case, something has gone wrong somewhere.  Please try submitting again or contact me.


How You Will Be Graded     Top

This assignment will be graded on a 40-point system with points awarded as follows.  Please note that the lists of features provided below are not meant to be exhaustive.  They are merely representative of the types of things we are looking for in each grading category.  Also, please note that 8 points — 20% of your grade — are for documentation.

The fact that this assignment is graded on a 40-point system while the previous ones were graded on a 20-point system is merely to give us more leeway in assigning points.  All assignments are normalized to 100 points.  The weight of this assignment in your final average is therefore the same as that of our previous two assignments.

Criteria Possible
Points

Program Integrity / Design

  • page displays properly as intended from the weblab.cs.uml.edu server (2 points)
  • source code for all files is visible on the web and/or accessible via links on the assignment or index page (2 points)
  • all CSS resides in a separate file with an extension of .css in a subdirectory named css (4 points)
  • main text content is read from a JSON file (4 points)
  • page exhibits creativity and effort, not just trivial implementations (14 points)
  • page validates using the W3C Markup Validation Service or includes an explanation of why not (3 points)
  • page validates using the W3C CSS Validation Service or includes an explanation of why not (3 points)

32

Source Code Documentation and Formatting

  • user name and pertinent contact information appear in all source files (2 points)
  • code is logically organized (2 points)
  • all files contain adequate explanatory documentation that is meaningful and does not merely echo code (2 points)
  • all files are properly indented and formatted with adequate white space for readability (1 point)
  • any sources used are cited in comments embedded within code (1 point)

8




This is document http://jesseheines.com:8080/~heines/91.461/91.461-2015-16f/461-assn/FormattingText-v05.jsp.  It was last modified on Friday, August 26, 2022 at 4:09 PM.
Copyright © 2022 by Jesse M. Heines.  All rights reserved.  May be freely copied or excerpted for educational purposes with credit to the author.