WebFund 2015W: Assignment 2: Difference between revisions
No edit summary |
No edit summary |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
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. | |||
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). | |||
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. | ||
# [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)! | # [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)! | ||
# [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. | ||
# [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. | #* 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. 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 14: | 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. | ||
==Solutions== | |||
See [http://scs.carleton.ca/~mbingham/assn2-solutions.zip solution code]. |
Latest revision as of 15: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] Make the application listen on port 3200 by default.
- [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)!
- [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] 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.