|
home—lects—hws
D2L—breeze (snow day)
due Feb.18 (Thu), 23:59
You have been hired to help develop the game Okaymon -- a crowdsourced game of evolving monsters! You need to develop a web form with the information below; when the form is submitted, the user is shown a page which simply re-caps the submitted information.
In this homework, we will
(A) add more utility helper-functions for producing html to
Write the following functions in php:
For extra credit (2pts), include an additional, optional input,
of type boolean-or-string:
A
(10pts) Write
As you create your test cases, you'll need to think about and decide how to generate each radio-button's name and value.
Make a form (10pts) and a form-handler (10pts) for entering new species of pokemon, including tests — see “handle-sample” below.
Your forms don't need to look exactly like the above1,
but should have the same information
(and look respectable).
(You'll also need a submit button, of course!)
The units for weight should
be kg and lbs.
You should have the fivesix energy-type resistances listed in their own section.
No data-validation is required, but
when you print the results you must sanitize the html:
the information must render as the user entered it.
(Hint: make a helper function, and test it.)
In order to test your form, you must also have three files
“
For the copyright notice, use a label tag, so that the user can click on the text to as well as the checkbox itself.
Of course, you should call functions from part (a) appropriately, and write any additional functions (and tests) as appropriate. Use an array to hold the various energy-types: if we add twenty more energy-types, you shouldn't need to change anything but that array, and everything else should work.
Deliverable:
Your form must be viewable on-line at
and the form-handler (named “
1In particular, you don't need to have an apostrophe when mentioning thinkin' energy. ↩
home—lects—hws
D2L—breeze (snow day)
©2015, Ian Barland, Radford University Last modified 2016.Feb.17 (Wed) |
Please mail any suggestions (incl. typos, broken links) to ibarlandradford.edu |