COMP721 Web Development Assignment 1
Semester 1, 2022 DUE ON: 11:59 PM Wednesday 13 April 2022
Assignment Worth: 25% of total grade
NB: Assignments will be accepted up to five (5) calendar days late, but a penalty of 5% per day (or part of a day) late will be imposed on the submission. This is an individual assignment. Students are referred to the school’s policy on plagiarism. A confirmed plagiarism case will incur zero mark to all the involved students.
Copyright By PowCoder代写 加微信 powcoder
Specifications:
The aim of this assignment is to create a diary system for a social networking site. This system will allow users to post their status and save it to a database table. These posted status details can also be retrieved using text matching and all matched status reports can be viewed in the order they are posted.
For this assignment, you will need to create all the appropriate HTML, PHP files and database table(s). For HTML pages, you are free to either use plain HTML+CSS or use CSS frameworks such as Bootstrap. You should save and test all your HTML and PHP files on cmslamp14.aut.ac.nz server in a directory ” /home/
Task 1 – Home Page index.html
This web page contains:
Your name
Your student ID
Your email address
A statement: “I declare that this assignment is my individual work. I have not worked
collaboratively nor have I copied from any other student’s work or from any other source.”
An absolute URL link (HTML anchor element) to the post status into the system
(poststatusform.php).
o Thelinkmustfollowthesyntax:
http://
o Thecontentoftheanchorelementmustbe:Postanewstatusasshownonthe below sample screenshot.
An absolute URL link to the status searching process (searchstatusform.html)
o Thelinkmustfollowthesyntax:
http://
o The content of the anchor element must be: Search status as shown on the below sample screenshot.
An absolute URL link to “about.html” page that tells us what you have attempted (see Task 6).
o Thelinkmustfollowthesyntax:
http://
o The content of the anchor element must be: About the assignment as shown on the below sample screenshot.
Sample screenshot of the home page:
Status Posting System
Student ID: abc1234
I declare that this assignment is my individual work. I have not worked collaboratively, nor have I copied from any other student’s work or from any other source
Post a new status
Search status About this assignment
Task 2 – Post Status Page poststatusform.php
This web page contains the form that enables a status to be submitted and saved. Make sure all the required input elements on this page are inside a single form element, and clearly state the type, name and value of the input elements where necessary.
Step 1. Status data contains the following form elements:
Status Code
o Textinputtype.
o Mustsetthenameattributeto”statuscode”:
o NOTNULL.
o Statuscodesshouldbeunique.
o Thecodeis5charactersinlength.Itmuststartwithanuppercaseletter“S”followed
by 4 digits, e.g. S0001. Status
o Textinputtype.
o Mustsetthenameattributeto”status”:
o NOTNULL,e.g.Doingmyfirstassignment.
o Thestatuscanonlycontainalphanumericals,comma,period(fullstop),exclamation
mark and question mark. Other characters or symbols are not allowed. Note that spaces on their own cannot make up a status. In other words, spaces can only be used after a character or symbol.
o Radiobuttontype.
o Mustincludethreeoptions:Public,Friends,OnlyMe.
o Textordateinputtype.
o Mustsetthenameattributeto”date”.
o NOTNULL.
o Mustsetthecurrentserverdateasthedefaultvalue.
Hint: You can fetch the current server date using the DateTime class or date() function in PHP.
o Datemustbeintheformatofdd/mm/yyyy,e.g.15/02/2022.
o Thedatemustbeeditablebyusers.
Permission
o Checkboxtype.
o Mustincludethreeselections:AllowLike,AllowComments,AllowShare.
Step 2. POST method for form submission is used.
Step 3. Link to return to the Home page is provided and works as intended.
Sample screenshot of the status form:
Task 3 – Process Post Status Page poststatusprocess.php
This web page checks the input data, writes the data to a database table and generates the corresponding HTML output in response to the user’s request.
Status Code and Status are mandatory fields.
Check if the database table exists. If not, create the table. (This means the tables can be
created either manually beforehand or be created on-the-fly in your code.)
The program should not allow saving of status to the database table if any of these fields are
not supplied or not valid (see rule in Task 2 – Step 1).
When needed, provide a proper error message (see the following instructions) to the user
that includes links to return to the Home page and Post Status page.
o Iftheuserinputsastatuscodeinawrongformat,theerrormessagemustcontainat
least one of these keywords: “S0001”, “format”. For example: Wrong format! The
status code must start with an “S” followed by four digits, like “S0001.
o If the user inputs a duplicated status code, the error message must contain at least one of these keywords: “unique”, “duplicate”, “exist”. For example: The status code already exists. Please try another one!
If the user inputs a status in a wrong format or an empty string, the error message must contain at least one of these keywords: “format”, “empty”, “alphanumericals”. For example: Your status is in a wrong format! The status can only contain alphanumericals and spaces, comma, period, exclamation point and question mark and cannot be blank!
The date must also be validated using the checkDate function in the DateTime class.
The Status Code must be checked for its uniqueness within the database table.
Step 2. Once the status is stored successfully in the database, a confirmation message should be generated for this entry followed by a link to return to the Home page.
The confirmation message must contain at least one of these keywords: “success”, “stored”, “saved”, “posted”. For example: Congratulations! The status has been posted!
NB: Everything on this page including your confirmation and error messages must be inside a single HTML div element with a class attribute valued content (except the header and footer if you have them on your page).
Task 4 – Search Status Page searchstatusform.html
This web page contains a form that accepts a status search input string. Users can type in a text string into the input text field to search for status record(s) containing the input string.
Step 1. The search status page should contain an input text field for typing in a status in order to retrieve any relevant records saved in the database table.
Step 2. GET method for form submission is used. Step 3. Link to return to the Home page is provided.
The form elements of status search (input text field) and view status (button) must be identified by the name of ”Search” and value of ”Show Results” respectively.
Sample screenshot of search status page:
Task 5 – Search Status Result Page searchstatusprocess.php
This web page retrieves an input string for the status search, reads data from the status database table, searches for the occurrence of the input status string and generates the corresponding HTML output in response to a user’s search request.
The status search string should not be empty.
If validation fails, provide an appropriate error message to user that includes links to return
to the Home page and Search Status page.
o Theerrormessagemustcontainatleastoneofthekeywordsof“empty”,“blank”.For
example: The search string is empty. Please enter a keyword to search.
Note: The input string should be used to match the status column instead of the status
code column.
All the status records are searched based on keyword match.
If there is no matching status, show a message to user that includes links to return to the
Home page and Search Status page.
o The message must contain at least one of these keywords: “not found”, “no status”,
“not exist”. For example: Status not found. Please try a different keyword.
When one or more matching records are found, the details of requested status information
should be presented along with links to return to the Home page and Search Status page.
If multiple records meet the search criteria, all matched records must be presented.
Sample screenshot of status search result information page:
Status Information
Status: Doing my first assignment Status Code: S0001
Share: Public
Date Posted: August 22, 2017 Permission: Allow Like
Search for another status
Return to Home Page
* Multiple search matches must be displayed when applicable. This screenshot only shows the case when one match is found.
NB: Everything on this page including your confirmation and error messages must be inside a single HTML div element with a class attribute valued content (except the header and footer if you have them on your page).
Task 6: About Page about.html
This is a report webpage for presenting what you have done based on the question provided.
Step 1.List your answers in bullet point for each question. For readability, include the questions as well.
What special features have you done or attempted in creating the website?
Which part(s) did you have trouble with?
What would you like to do better next time?
What you have learnt along the way? Did you use any references or resources during this
project? If so, please include the sources. Step 2. Provide a link to return to the Home page.
Submission & Assessment Process:
Create your site structure as described below.
index.html poststatusform.php poststatusprocess.php searchstatusform.html searchstatusprocess.php about.html
You must have this folder – case sensitive! Home page
Post a new status page
Process status data
Search status page
Process status search data
About page
Folder for any images used for page content (optional) CSS style sheet rules for your stylesheet (optional)
style/ Folder for any stylesheet images (optional)
PHP files should only be in the base “assign1/” folder – not anywhere else.
Please make sure all links are working
Assignment Submission:
The assignment should also be submitted as an individual work using the Assignment One link on Canvas (under the Assignments section). In this way, we can check the source code of your assignment project.
Please follow the steps below to submit:
1. Make sure your code works on the cmslamp14 server in the folder “assign1”.
2. Download the folder ‘assign1’ (including all the files in it) to your local machine.
3. If any PHP file in the folder contains your password, replace the password string with an
empty string in a text editor.
4. Zip this folder and submit on Canvas, i.e. the file to submit should be in .zip format.
The reason that we ask you to remove database login details from the files before submitting to Canvas is to avoid potential privacy exposure. However, please do not remove the password from the files on cmslamp14 server as otherwise your code will not work.
* Make sure to test your program on the cmslamp14 server before your submission.
* If your assignment cannot run on cmslamp14, your result will be 0 marks for this assignment.
Provisional Marking Scheme
Marking will be based on the detailed requirements as specified above for each task. A general marking scheme is given below.
The assignment is to be marked out of 100.
Home a. b.
(index.html) 5 Page contained information shown in the screenshot
Links work as intended
Post Status Page (poststatusform.html)
a. Form contained all information shown in the screen shot
b. Date field shows the current date by default
c. Web page used the POST method
d. The link works as intended
Process Post Status Page (poststatusprocess.php)
a. Existence of the database table checked. E.g., query the
INFORMATION_SCHEMA.TABLES.
b. If database table doesn’t exist, create the table.
c. Validation of input data
a. Checks Status Code has a non-empty entry.
b. Status Code follows the required format (refer to Task 2
Step 1). Status code format can be validated on server side
(using PHP) or on client side (using HTML pattern).
c. Checks status has a non-empty entry.
d. Status code is verified to be unique.
This requires database communication.
e. Error messages
f. Appropriate error message generated when errors occur. a. Link(s) work as intended in the error messages.
g. Confirmation messages
h. Appropriate confirmation message generated as expected.
i. Link works as intended in the confirmation message.
Search Status Page (searchstatus.html)
a. The search status page contains information similar to the
screenshot
b. GET method is used.
c. Link works as intended.
Search Status Result Page (searchstatusprocess.php)
a. Input search string is validated to be non-empty. A status with only
spaces cannot be submitted and is considered invalid.
b. Existence of the database table is checked.
c. Search results
Status search functions as intended.
When applicable, all matching records are displayed.
Links work as intended.
d. Error message
When errors occur, appropriate error messages are generated.
Links work as intended.
About a. b. Overall a. Quality b.
Page (about.html) 5 All questions answered.
Link works as intended.
User interface layout improved 10 CSS used for colours and styles
Undesirable Feature
1. Source code has poor or no indentation.
2. Source code has no or vague comments. An example of a bad
comment is “this assigns a value to $a”.
3. Source code contains commented out code or code blocks.
4. Messages used for debugging and/or testing are included in the
final version of the project.
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com