Chris Pollett> Old Classses >
CS174

( Print View )

Student Corner:
[Final-PDF]

[Submit Sec1]
[Grades Sec1]

[Lecture Notes]
[Discussion Board]

Course Info:
[Texts & Links]
[Description]
[Course Outcomes]
[Outcomes Matrix]
[Course Schedule]
[Grading]
[Requirements/HW/Quizzes]
[Class Protocols]
[Exam Info]
[Regrades]
[University Policies]
[Announcements]

HW Assignments:
[Hw1] [Hw2] [Hw3]
[Hw4] [Hw5] [Quizzes]

Practice Exams:
[Midterm] [Final]

HW#3 --- last modified March 23 2021 02:54:04.

Solution set.

Due date: Apr 14

Files to be submitted:
  Hw3.zip

Purpose:: To write an application that uses databases and uses the MVA design pattern.

Related Course Outcomes:

The main course outcomes covered by this assignment are:

CLO3 -- Write server-side scripts that process HTML forms.

CLO5 -- Develop and deploy web applications that involve components, web services, and databases.

Description: For this homework, you will create a web application called Talking Points to make it easy to share meeting agendas on the web. Here are some mock-ups of the pages for your web application:

Landing Page
A Category Page.

Talking Points

New Category Page

Talking Points/Education

New Agenda

:
:
:
:
New Agenda Page

Talking Points/Education

SJSU CS Dept Mtg

2021-05-12

  • Approve Feb Meeting Minutes
  • Faculty Callouts
  • Upcoming ABET Review
  • News from UCC
  • News from GCC
  • CS 999 New Course Approval
Display Agenda Page

Here are the requirements for your project:

  1. Your Hw3.zip folder has a readme.txt file with all the names and ids for your group.
  2. All the web pages you output validate as XHTML 5.
  3. Your project is written using namespaces. You only create variables, arrays, objects, define new classes, etc. in the namespace cool_name_for_your_group\hw3 and subnamespaces thereof.
  4. Your project directory structure and urls that are linked to by your project are as follows:
    index.php -- entry point into your project. No other file in your project is directly linked-to.
        All urls used as links by your project are in the format (including links to images):
        BASE_URL/index.php?c=name_of_controller&m=name_of_method&arg1=value_for_arg1& ...&argn=value_for_argn 
    src
     |-configs |- Config.php contains a class with constants for things like 
     |         |       database user, password, host, port, etc. Basically, 
     |         |       it should have anything you think the grader might need
     |         |       to get your program running on the grader's machine.
     |         |- CreateDB.php can be run from the command-line to make a good initial
     |                database.
     |-controllers -- contains all the controller classes you write, one per file
     |-models -- contains all the model classes you write, one per file
     |-resources -- contains any resources used by your app such as images
     |-styles -- has any external stylesheets you need
     |-views -- contains all the view classes you write, one per file
          |-elements -- contains all the element classes you write, one per file
          |-helpers -- contains all the helper classes you write, one per file
          |-layouts -- contains all the helper classes you write, one per file    
    
  5. Typing php CreateDb.php while in a shell in the configs folder creates an initial Mysql Database with tables created in BCNF. The tables' schemas is reasonable for storing and retrieving any data similar to that given in the mock-up views above.
  6. Your project defines base classes: Controller, Model, View, Element, and Helper. The namespaces for these and their subclasses should be respectively: cool_name_for_your_group\hw3\controllers, cool_name_for_your_group\hw3\models, cool_name_for_your_group\hw3\views, cool_name_for_your_group\hw3\views\elements, and cool_name_for_your_group\hw3\views\helpers.
  7. Your project uses the Model View Adapter pattern that we have discussed in class. This item is for overall how well you succeeded at this. What this means for particular classes will be described in the next several points.
  8. Only controller classes directly handle request/form data. Controllers use this information to invoke model methods that make database calls to get/set/update info in the database, then choose a view, instantiate it, and call its render() method to display a web page back to the requesting browser.
  9. Only subclasses of Model interact with the database. The base Model class has methods for performing the initial connection to the database. Model classes have methods to marshal a particular kind of object from one or more tables, and to take already created objects and unmarshal them persistently into the database.
  10. Only subclasses of View, Element, Helper, Layout are allowed to render HTML. Each view is used to render a particular kind of whole web page. Elements are used to render a particular portion of a web page that might occur on several kinds of web pages (for example, a navigation block). Helpers have methods which make it easy to output the HTML for particular kinds of widgets (say a method that takes an array and uses it to output the HTML for a dropdown with the elements coming from the array). Layouts are used to output common header and footer HTML that might be used by several views.
  11. On the Landing page and Meeting Subject page, Meeting Subject links take one to the page of the appropriate Meeting Subject.
  12. Agenda links take one to the appropriate Display Agenda page. Next to a Agenda link is the date on which that meeting will happen.
  13. The main landing page Upcoming list contains the three next upcoming meetings froom soonest occurring to latest occurring. If the meeting time is on the same day then the word Today is used in the time, if the meeting time is on the next day the word Tomorrow is used.
  14. [-] links next to a Category only appear on the landing page and indicate the Category currently doesn't have Agendas. Clicking the link deletes that genre. [-] links next to a particular Agenda link only appear on Meeting Subject pages. Clicking this link deletes the Agenda. As [-] by itself doesn't say what this link does, you should implement some way of making these links WAI compliant.
  15. Links on each pages main heading take one to the appropriate genre or the landing page. I.e., in Talking Points/Education, the Talking Points link takes one to the landing page, the Education link takes one to the Education genre page.
  16. On a Category pages, all agendas for that category are listed in descending order of date. Sorting is done at the database query level, not after the data is retrieved.
  17. Categories are always listed in alphabetical order. Sorting is done at the database query level, not after the data is retrieved.
  18. The link to the New Category page is only on the landing page. The New Category page allows a new category to be added to the list of current categories. If the name is blank, or sanitizes using filter_var to blank no new category is added. In both cases, after the action is performed the current landing page is shown.
  19. The New Agenda page allows a new agenda to be added to the current Category. The link to an New Agenda link does not appear on the landing page, but does appear on every Category page. On the new Agenda Page, clicking Add Item stores the form data so far into a session. The view is then drawn with an additional text field for another Agenda Item. Clicking Done saves the agenda to database tables provided the Title, Date, Time, and at least one list item is filled after sanitization with filter_var. On successful saving the user is returned to the landing page, otherwise, the user remains on the New Agenda Page.
  20. The Display Agenda page shows a previously created agenda as illustrated in the mock-ups above.
Point Breakdown
Items (a)-(t) are each worth (1/2pt). If an item involves several sentences, then all of the sentences must be accomplished to receive the 1/2 pt. 10pts
Total10pts