Difference between revisions of "WebFund 2015W: Assignment 2"

From Soma-notes
Jump to navigation Jump to search
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
'''This assignment is not yet finalized'''
In this assignment you will be modifying the the [http://homeostasis.scs.carleton.ca/~soma/webfund-2015w/code/form-demo.zip form-demo] code from Tutorial 2.


In addition to the points below, you also get up to 2 points for overall programming styleIn total, there are 10 points. '''The questions below will be automatically graded for everything but style.''' Further details on how to structure your output will be added here soon.
Please submit your answers as a single zip file called "<username>-comp2406-assign2.zip" (where username is your MyCarletonOne username)This zip file should unpack into a directory of the same name (minus the .zip extension of course)This directory should contain your modified version of <tt>form-demo</tt> (one version with all code changes).


The following questions require you to modify the [http://homeostasis.scs.carleton.ca/~soma/webfund-2015w/code/form-demo.zip form-demo] code from Tutorial 2.
In addition to the points below, you also get up to 2 points for overall programming style. In total, there are 10 points. '''The questions below will be automatically graded for everything but style.'''
 
==Questions==


# [1] Make the application listen on port 3200 by default.
# [1] Make the application listen on port 3200 by default.
Line 9: Line 11:
# [2] Add a "Phone" field to the end of the form that behaves similarly to all of the other form entries, in all parts of the application.
# [2] Add a "Phone" field to the end of the form that behaves similarly to all of the other form entries, in all parts of the application.
#* the name attribute of the phone field should be "phone"
#* the name attribute of the phone field should be "phone"
# [4] Implement a simple query interface that searches previous records for any record containing partial matches to the query in any of the filled in fields. This interface should:  
# [4] Implement a simple query interface that searches previous records for any record containing partial matches to the query in any of the filled in fields. For example, if the user inputs the string "test" and hits submit, the list screen should have all records which have "test" somewhere in one of its fields.  Specifically, this interface should:  
#* be a new screen accessible from the main page (/) from a button whose text says "Query"
#* be a new screen accessible from the main page (/) from a button whose text says "Query"
#* be located at a route named /query
#* be located at a route named /query
Line 15: Line 17:
#* once submitted, return a listing screen (based on the already existing /list screen) that lists only the records which contain, in one or more of its fields, the input string as a substring.
#* once submitted, return a listing screen (based on the already existing /list screen) that lists only the records which contain, in one or more of its fields, the input string as a substring.


For example, if the user inputs the string "test" and hits submit, the list screen should have all records which have "test" somewhere in one of its fields.
==Solutions==
See [http://scs.carleton.ca/~mbingham/assn2-solutions.zip solution code].

Latest revision as of 11:11, 9 February 2015

In this assignment you will be modifying the the form-demo code from Tutorial 2.

Please submit your answers as a single zip file called "<username>-comp2406-assign2.zip" (where username is your MyCarletonOne username). This zip file should unpack into a directory of the same name (minus the .zip extension of course). This directory should contain your modified version of form-demo (one version with all code changes).

In addition to the points below, you also get up to 2 points for overall programming style. In total, there are 10 points. The questions below will be automatically graded for everything but style.

Questions

  1. [1] Make the application listen on port 3200 by default.
  2. [1] Add a "Home" link to the submit results screen (/add) that takes you back to the form screen. Note that this should be a link (a tag)!
  3. [2] Add a "Phone" field to the end of the form that behaves similarly to all of the other form entries, in all parts of the application.
    • the name attribute of the phone field should be "phone"
  4. [4] Implement a simple query interface that searches previous records for any record containing partial matches to the query in any of the filled in fields. For example, if the user inputs the string "test" and hits submit, the list screen should have all records which have "test" somewhere in one of its fields. Specifically, this interface should:
    • be a new screen accessible from the main page (/) from a button whose text says "Query"
    • be located at a route named /query
    • contain a form with a single text input whose name attribute is "input" and a single submit button whose action is "/doquery" using a POST request.
    • once submitted, return a listing screen (based on the already existing /list screen) that lists only the records which contain, in one or more of its fields, the input string as a substring.

Solutions

See solution code.